...

Package runtime

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

Overview ▾

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

Index ▾

func UserAgent() string
func Version() string
type APIError
type BaseClient
    func New(endpoint string) BaseClient
    func NewWithoutDefaults(endpoint string) BaseClient
type CompositeChildModel
type CompositeEntityModel
type EntityModel
    func (em EntityModel) MarshalJSON() ([]byte, error)
    func (em *EntityModel) UnmarshalJSON(body []byte) error
type EntityWithResolution
    func (ewr EntityWithResolution) MarshalJSON() ([]byte, error)
    func (ewr *EntityWithResolution) UnmarshalJSON(body []byte) error
type EntityWithScore
    func (ews EntityWithScore) MarshalJSON() ([]byte, error)
    func (ews *EntityWithScore) UnmarshalJSON(body []byte) error
type IntentModel
type LuisResult
type PredictionClient
    func NewPredictionClient(endpoint string) PredictionClient
    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)
    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)
    func (client PredictionClient) ResolveResponder(resp *http.Response) (result LuisResult, err error)
    func (client PredictionClient) ResolveSender(req *http.Request) (*http.Response, error)
type Sentiment

Package files

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

func UserAgent

func UserAgent() string

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

func Version

func Version() string

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

type APIError

APIError error information returned by the API

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

type BaseClient

BaseClient is the base client for Runtime.

type BaseClient struct {
    autorest.Client
    Endpoint string
}

func New

func New(endpoint string) BaseClient

New creates an instance of the BaseClient client.

func NewWithoutDefaults

func NewWithoutDefaults(endpoint string) BaseClient

NewWithoutDefaults creates an instance of the BaseClient client.

type CompositeChildModel

CompositeChildModel child entity in a LUIS Composite Entity.

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

type CompositeEntityModel

CompositeEntityModel LUIS Composite Entity.

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"`
}

type EntityModel

EntityModel an entity extracted from the utterance.

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"`
}

func (EntityModel) MarshalJSON

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

MarshalJSON is the custom marshaler for EntityModel.

func (*EntityModel) UnmarshalJSON

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

UnmarshalJSON is the custom unmarshaler for EntityModel struct.

type EntityWithResolution

EntityWithResolution ...

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"`
}

func (EntityWithResolution) MarshalJSON

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

MarshalJSON is the custom marshaler for EntityWithResolution.

func (*EntityWithResolution) UnmarshalJSON

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

UnmarshalJSON is the custom unmarshaler for EntityWithResolution struct.

type EntityWithScore

EntityWithScore ...

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"`
}

func (EntityWithScore) MarshalJSON

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

MarshalJSON is the custom marshaler for EntityWithScore.

func (*EntityWithScore) UnmarshalJSON

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

UnmarshalJSON is the custom unmarshaler for EntityWithScore struct.

type IntentModel

IntentModel an intent detected from the utterance.

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"`
}

type LuisResult

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

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"`
}

type PredictionClient

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

type PredictionClient struct {
    BaseClient
}

func NewPredictionClient

func NewPredictionClient(endpoint string) PredictionClient

NewPredictionClient creates an instance of the PredictionClient client.

func (PredictionClient) Resolve

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

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

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

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

Sentiment sentiment of the input utterance.

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"`
}

Subdirectories

Name Synopsis
..
runtimeapi