...

Package runtime

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

Overview ▾

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

Index ▾

func UserAgent() string
func Version() string
type BaseClient
    func New(endpoint string) BaseClient
    func NewWithoutDefaults(endpoint string) BaseClient
type DynamicList
type Error
type ErrorBody
type ExternalEntity
type Intent
type Prediction
    func (p Prediction) MarshalJSON() ([]byte, error)
type PredictionClient
    func NewPredictionClient(endpoint string) PredictionClient
    func (client PredictionClient) GetSlotPrediction(ctx context.Context, appID uuid.UUID, slotName string, predictionRequest PredictionRequest, verbose *bool, showAllIntents *bool, logParameter *bool) (result PredictionResponse, err error)
    func (client PredictionClient) GetSlotPredictionPreparer(ctx context.Context, appID uuid.UUID, slotName string, predictionRequest PredictionRequest, verbose *bool, showAllIntents *bool, logParameter *bool) (*http.Request, error)
    func (client PredictionClient) GetSlotPredictionResponder(resp *http.Response) (result PredictionResponse, err error)
    func (client PredictionClient) GetSlotPredictionSender(req *http.Request) (*http.Response, error)
    func (client PredictionClient) GetVersionPrediction(ctx context.Context, appID uuid.UUID, versionID string, predictionRequest PredictionRequest, verbose *bool, showAllIntents *bool, logParameter *bool) (result PredictionResponse, err error)
    func (client PredictionClient) GetVersionPredictionPreparer(ctx context.Context, appID uuid.UUID, versionID string, predictionRequest PredictionRequest, verbose *bool, showAllIntents *bool, logParameter *bool) (*http.Request, error)
    func (client PredictionClient) GetVersionPredictionResponder(resp *http.Response) (result PredictionResponse, err error)
    func (client PredictionClient) GetVersionPredictionSender(req *http.Request) (*http.Response, error)
type PredictionRequest
type PredictionRequestOptions
type PredictionResponse
type RequestList
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 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 DynamicList

DynamicList defines an extension for a list entity.

type DynamicList struct {
    // ListEntityName - The name of the list entity to extend.
    ListEntityName *string `json:"listEntityName,omitempty"`
    // RequestLists - The lists to append on the extended list entity.
    RequestLists *[]RequestList `json:"requestLists,omitempty"`
}

type Error

Error represents the error that occurred.

type Error struct {
    Error *ErrorBody `json:"error,omitempty"`
}

type ErrorBody

ErrorBody represents the definition of the error that occurred.

type ErrorBody struct {
    // Code - The error code.
    Code *string `json:"code,omitempty"`
    // Message - The error message.
    Message *string `json:"message,omitempty"`
}

type ExternalEntity

ExternalEntity defines a user predicted entity that extends an already existing one.

type ExternalEntity struct {
    // EntityName - The name of the entity to extend.
    EntityName *string `json:"entityName,omitempty"`
    // StartIndex - The start character index of the predicted entity.
    StartIndex *int32 `json:"startIndex,omitempty"`
    // EntityLength - The length of the predicted entity.
    EntityLength *int32 `json:"entityLength,omitempty"`
    // Resolution - A user supplied custom resolution to return as the entity's prediction.
    Resolution interface{} `json:"resolution,omitempty"`
    // Score - A user supplied score to return as the entity's prediction score.
    Score *float64 `json:"score,omitempty"`
}

type Intent

Intent represents an intent prediction.

type Intent struct {
    // Score - The score of the fired intent.
    Score *float64 `json:"score,omitempty"`
    // ChildApp - The prediction of the dispatched application.
    ChildApp *Prediction `json:"childApp,omitempty"`
}

type Prediction

Prediction represents the prediction of a query.

type Prediction struct {
    // AlteredQuery - The query after spell checking. Only set if spell check was enabled and a spelling mistake was found.
    AlteredQuery *string `json:"alteredQuery,omitempty"`
    // TopIntent - The name of the top scoring intent.
    TopIntent *string `json:"topIntent,omitempty"`
    // Intents - A dictionary representing the intents that fired.
    Intents map[string]*Intent `json:"intents"`
    // Entities - A dictionary representing the entities that fired.
    Entities map[string]interface{} `json:"entities"`
    // Sentiment - The result of the sentiment analysis.
    Sentiment *Sentiment `json:"sentiment,omitempty"`
}

func (Prediction) MarshalJSON

func (p Prediction) MarshalJSON() ([]byte, error)

MarshalJSON is the custom marshaler for Prediction.

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) GetSlotPrediction

func (client PredictionClient) GetSlotPrediction(ctx context.Context, appID uuid.UUID, slotName string, predictionRequest PredictionRequest, verbose *bool, showAllIntents *bool, logParameter *bool) (result PredictionResponse, err error)

GetSlotPrediction gets the predictions for an application slot. Parameters: appID - the application ID. slotName - the application slot name. predictionRequest - the prediction request parameters. verbose - indicates whether to get extra metadata for the entities predictions or not. showAllIntents - indicates whether to return all the intents in the response or just the top intent. logParameter - indicates whether to log the endpoint query or not.

func (PredictionClient) GetSlotPredictionPreparer

func (client PredictionClient) GetSlotPredictionPreparer(ctx context.Context, appID uuid.UUID, slotName string, predictionRequest PredictionRequest, verbose *bool, showAllIntents *bool, logParameter *bool) (*http.Request, error)

GetSlotPredictionPreparer prepares the GetSlotPrediction request.

func (PredictionClient) GetSlotPredictionResponder

func (client PredictionClient) GetSlotPredictionResponder(resp *http.Response) (result PredictionResponse, err error)

GetSlotPredictionResponder handles the response to the GetSlotPrediction request. The method always closes the http.Response Body.

func (PredictionClient) GetSlotPredictionSender

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

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

func (PredictionClient) GetVersionPrediction

func (client PredictionClient) GetVersionPrediction(ctx context.Context, appID uuid.UUID, versionID string, predictionRequest PredictionRequest, verbose *bool, showAllIntents *bool, logParameter *bool) (result PredictionResponse, err error)

GetVersionPrediction gets the predictions for an application version. Parameters: appID - the application ID. versionID - the application version ID. predictionRequest - the prediction request parameters. verbose - indicates whether to get extra metadata for the entities predictions or not. showAllIntents - indicates whether to return all the intents in the response or just the top intent. logParameter - indicates whether to log the endpoint query or not.

func (PredictionClient) GetVersionPredictionPreparer

func (client PredictionClient) GetVersionPredictionPreparer(ctx context.Context, appID uuid.UUID, versionID string, predictionRequest PredictionRequest, verbose *bool, showAllIntents *bool, logParameter *bool) (*http.Request, error)

GetVersionPredictionPreparer prepares the GetVersionPrediction request.

func (PredictionClient) GetVersionPredictionResponder

func (client PredictionClient) GetVersionPredictionResponder(resp *http.Response) (result PredictionResponse, err error)

GetVersionPredictionResponder handles the response to the GetVersionPrediction request. The method always closes the http.Response Body.

func (PredictionClient) GetVersionPredictionSender

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

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

type PredictionRequest

PredictionRequest represents the prediction request parameters.

type PredictionRequest struct {
    // Query - The query to predict.
    Query *string `json:"query,omitempty"`
    // Options - The custom options defined for this request.
    Options *PredictionRequestOptions `json:"options,omitempty"`
    // ExternalEntities - The externally predicted entities for this request.
    ExternalEntities *[]ExternalEntity `json:"externalEntities,omitempty"`
    // DynamicLists - The dynamically created list entities for this request.
    DynamicLists *[]DynamicList `json:"dynamicLists,omitempty"`
}

type PredictionRequestOptions

PredictionRequestOptions the custom options for the prediction request.

type PredictionRequestOptions struct {
    // DatetimeReference - The reference DateTime used for predicting datetime entities.
    DatetimeReference *date.Time `json:"datetimeReference,omitempty"`
    // PreferExternalEntities - Whether to make the external entities resolution override the predictions if an overlap occurs.
    PreferExternalEntities *bool `json:"preferExternalEntities,omitempty"`
}

type PredictionResponse

PredictionResponse represents the prediction response.

type PredictionResponse struct {
    autorest.Response `json:"-"`
    // Query - The query used in the prediction.
    Query *string `json:"query,omitempty"`
    // Prediction - The prediction of the requested query.
    Prediction *Prediction `json:"prediction,omitempty"`
}

type RequestList

RequestList defines a sub-list to append to an existing list entity.

type RequestList struct {
    // Name - The name of the sub-list.
    Name *string `json:"name,omitempty"`
    // CanonicalForm - The canonical form of the sub-list.
    CanonicalForm *string `json:"canonicalForm,omitempty"`
    // Synonyms - The synonyms of the canonical form.
    Synonyms *[]string `json:"synonyms,omitempty"`
}

type Sentiment

Sentiment the result of the sentiment analysis.

type Sentiment struct {
    // Label - The label of the sentiment analysis result.
    Label *string `json:"label,omitempty"`
    // Score - The sentiment score of the query.
    Score *float64 `json:"score,omitempty"`
}

Subdirectories

Name Synopsis
..
runtimeapi