runtime

package
v49.0.0+incompatible Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 1, 2020 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Overview

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

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

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.

Types

type APIError

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

type BaseClient struct {
	autorest.Client
	Endpoint string
}

BaseClient is the base client for Runtime.

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

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

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

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

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

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

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

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

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

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

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

type PredictionClient struct {
	BaseClient
}

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

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

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

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL