azure-sdk-for-go: github.com/Azure/azure-sdk-for-go/services/cognitiveservices/v2.0/luis/runtime Index | Files | Directories

package runtime

import "github.com/Azure/azure-sdk-for-go/services/cognitiveservices/v2.0/luis/runtime"

Package runtime implements the Azure ARM Runtime service API version 2.0.

Index

Package Files

client.go models.go prediction.go version.go

func UserAgent Uses

func UserAgent() string

UserAgent returns the UserAgent string to use when sending http.Requests.

func Version Uses

func Version() string

Version returns the semantic version (see http://semver.org) of the client.

type APIError Uses

type APIError struct {
    // StatusCode - HTTP Status code
    StatusCode *string `json:"statusCode,omitempty"`
    // Message - Cause of the error.
    Message *string `json:"message,omitempty"`
}

APIError error information returned by the API

type BaseClient Uses

type BaseClient struct {
    autorest.Client
    Endpoint string
}

BaseClient is the base client for Runtime.

func New Uses

func New(endpoint string) BaseClient

New creates an instance of the BaseClient client.

func NewWithoutDefaults Uses

func NewWithoutDefaults(endpoint string) BaseClient

NewWithoutDefaults creates an instance of the BaseClient client.

type CompositeChildModel Uses

type CompositeChildModel struct {
    // Type - Type of child entity.
    Type *string `json:"type,omitempty"`
    // Value - Value extracted by LUIS.
    Value *string `json:"value,omitempty"`
}

CompositeChildModel child entity in a LUIS Composite Entity.

type CompositeEntityModel Uses

type CompositeEntityModel struct {
    // ParentType - Type/name of parent entity.
    ParentType *string `json:"parentType,omitempty"`
    // Value - Value for composite entity extracted by LUIS.
    Value *string `json:"value,omitempty"`
    // Children - Child entities.
    Children *[]CompositeChildModel `json:"children,omitempty"`
}

CompositeEntityModel LUIS Composite Entity.

type EntityModel Uses

type EntityModel struct {
    // AdditionalProperties - Unmatched properties from the message are deserialized this collection
    AdditionalProperties map[string]interface{} `json:""`
    // Entity - Name of the entity, as defined in LUIS.
    Entity *string `json:"entity,omitempty"`
    // Type - Type of the entity, as defined in LUIS.
    Type *string `json:"type,omitempty"`
    // StartIndex - The position of the first character of the matched entity within the utterance.
    StartIndex *int32 `json:"startIndex,omitempty"`
    // EndIndex - The position of the last character of the matched entity within the utterance.
    EndIndex *int32 `json:"endIndex,omitempty"`
}

EntityModel an entity extracted from the utterance.

func (EntityModel) MarshalJSON Uses

func (em EntityModel) MarshalJSON() ([]byte, error)

MarshalJSON is the custom marshaler for EntityModel.

func (*EntityModel) UnmarshalJSON Uses

func (em *EntityModel) UnmarshalJSON(body []byte) error

UnmarshalJSON is the custom unmarshaler for EntityModel struct.

type EntityWithResolution Uses

type EntityWithResolution struct {
    // Resolution - Resolution values for pre-built LUIS entities.
    Resolution interface{} `json:"resolution,omitempty"`
    // AdditionalProperties - Unmatched properties from the message are deserialized this collection
    AdditionalProperties map[string]interface{} `json:""`
    // Entity - Name of the entity, as defined in LUIS.
    Entity *string `json:"entity,omitempty"`
    // Type - Type of the entity, as defined in LUIS.
    Type *string `json:"type,omitempty"`
    // StartIndex - The position of the first character of the matched entity within the utterance.
    StartIndex *int32 `json:"startIndex,omitempty"`
    // EndIndex - The position of the last character of the matched entity within the utterance.
    EndIndex *int32 `json:"endIndex,omitempty"`
}

EntityWithResolution ...

func (EntityWithResolution) MarshalJSON Uses

func (ewr EntityWithResolution) MarshalJSON() ([]byte, error)

MarshalJSON is the custom marshaler for EntityWithResolution.

func (*EntityWithResolution) UnmarshalJSON Uses

func (ewr *EntityWithResolution) UnmarshalJSON(body []byte) error

UnmarshalJSON is the custom unmarshaler for EntityWithResolution struct.

type EntityWithScore Uses

type EntityWithScore struct {
    // Score - Associated prediction score for the intent (float).
    Score *float64 `json:"score,omitempty"`
    // AdditionalProperties - Unmatched properties from the message are deserialized this collection
    AdditionalProperties map[string]interface{} `json:""`
    // Entity - Name of the entity, as defined in LUIS.
    Entity *string `json:"entity,omitempty"`
    // Type - Type of the entity, as defined in LUIS.
    Type *string `json:"type,omitempty"`
    // StartIndex - The position of the first character of the matched entity within the utterance.
    StartIndex *int32 `json:"startIndex,omitempty"`
    // EndIndex - The position of the last character of the matched entity within the utterance.
    EndIndex *int32 `json:"endIndex,omitempty"`
}

EntityWithScore ...

func (EntityWithScore) MarshalJSON Uses

func (ews EntityWithScore) MarshalJSON() ([]byte, error)

MarshalJSON is the custom marshaler for EntityWithScore.

func (*EntityWithScore) UnmarshalJSON Uses

func (ews *EntityWithScore) UnmarshalJSON(body []byte) error

UnmarshalJSON is the custom unmarshaler for EntityWithScore struct.

type IntentModel Uses

type IntentModel struct {
    // Intent - Name of the intent, as defined in LUIS.
    Intent *string `json:"intent,omitempty"`
    // Score - Associated prediction score for the intent (float).
    Score *float64 `json:"score,omitempty"`
}

IntentModel an intent detected from the utterance.

type LuisResult Uses

type LuisResult struct {
    autorest.Response `json:"-"`
    // Query - The input utterance that was analyzed.
    Query *string `json:"query,omitempty"`
    // AlteredQuery - The corrected utterance (when spell checking was enabled).
    AlteredQuery     *string      `json:"alteredQuery,omitempty"`
    TopScoringIntent *IntentModel `json:"topScoringIntent,omitempty"`
    // Intents - All the intents (and their score) that were detected from utterance.
    Intents *[]IntentModel `json:"intents,omitempty"`
    // Entities - The entities extracted from the utterance.
    Entities *[]EntityModel `json:"entities,omitempty"`
    // CompositeEntities - The composite entities extracted from the utterance.
    CompositeEntities      *[]CompositeEntityModel `json:"compositeEntities,omitempty"`
    SentimentAnalysis      *Sentiment              `json:"sentimentAnalysis,omitempty"`
    ConnectedServiceResult *LuisResult             `json:"connectedServiceResult,omitempty"`
}

LuisResult prediction, based on the input query, containing intent(s) and entities.

type PredictionClient Uses

type PredictionClient struct {
    BaseClient
}

PredictionClient is the client for the Prediction methods of the Runtime service.

func NewPredictionClient Uses

func NewPredictionClient(endpoint string) PredictionClient

NewPredictionClient creates an instance of the PredictionClient client.

func (PredictionClient) Resolve Uses

func (client PredictionClient) Resolve(ctx context.Context, appID uuid.UUID, query string, timezoneOffset *float64, verbose *bool, staging *bool, spellCheck *bool, bingSpellCheckSubscriptionKey string, logParameter *bool) (result LuisResult, err error)

Resolve gets predictions for a given utterance, in the form of intents and entities. The current maximum query size is 500 characters. Parameters: appID - the LUIS application ID (Guid). query - the utterance to predict. timezoneOffset - the timezone offset for the location of the request. verbose - if true, return all intents instead of just the top scoring intent. staging - use the staging endpoint slot. spellCheck - enable spell checking. bingSpellCheckSubscriptionKey - the subscription key to use when enabling Bing spell check logParameter - log query (default is true)

func (PredictionClient) ResolvePreparer Uses

func (client PredictionClient) ResolvePreparer(ctx context.Context, appID uuid.UUID, query string, timezoneOffset *float64, verbose *bool, staging *bool, spellCheck *bool, bingSpellCheckSubscriptionKey string, logParameter *bool) (*http.Request, error)

ResolvePreparer prepares the Resolve request.

func (PredictionClient) ResolveResponder Uses

func (client PredictionClient) ResolveResponder(resp *http.Response) (result LuisResult, err error)

ResolveResponder handles the response to the Resolve request. The method always closes the http.Response Body.

func (PredictionClient) ResolveSender Uses

func (client PredictionClient) ResolveSender(req *http.Request) (*http.Response, error)

ResolveSender sends the Resolve request. The method will close the http.Response Body if it receives an error.

type Sentiment Uses

type Sentiment struct {
    // Label - The polarity of the sentiment, can be positive, neutral or negative.
    Label *string `json:"label,omitempty"`
    // Score - Score of the sentiment, ranges from 0 (most negative) to 1 (most positive).
    Score *float64 `json:"score,omitempty"`
}

Sentiment sentiment of the input utterance.

Directories

PathSynopsis
runtimeapi

Package runtime imports 9 packages (graph) and is imported by 4 packages. Updated 2019-08-02. Refresh now. Tools for package owners.