runtime

package
v17.4.0+incompatible Latest Latest
Warning

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

Go to latest
Published: Jun 19, 2018 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Overview

Package runtime implements the Azure ARM Runtime service API version v2.0 preview.

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 AzureRegions

type AzureRegions string

AzureRegions enumerates the values for azure regions.

const (
	// Australiaeast ...
	Australiaeast AzureRegions = "australiaeast"
	// Brazilsouth ...
	Brazilsouth AzureRegions = "brazilsouth"
	// Eastasia ...
	Eastasia AzureRegions = "eastasia"
	// Eastus ...
	Eastus AzureRegions = "eastus"
	// Eastus2 ...
	Eastus2 AzureRegions = "eastus2"
	// Northeurope ...
	Northeurope AzureRegions = "northeurope"
	// Southcentralus ...
	Southcentralus AzureRegions = "southcentralus"
	// Southeastasia ...
	Southeastasia AzureRegions = "southeastasia"
	// Westcentralus ...
	Westcentralus AzureRegions = "westcentralus"
	// Westeurope ...
	Westeurope AzureRegions = "westeurope"
	// Westus ...
	Westus AzureRegions = "westus"
	// Westus2 ...
	Westus2 AzureRegions = "westus2"
)

func PossibleAzureRegionsValues

func PossibleAzureRegionsValues() []AzureRegions

PossibleAzureRegionsValues returns an array of possible values for the AzureRegions const type.

type BaseClient

type BaseClient struct {
	autorest.Client
	AzureRegion AzureRegions
}

BaseClient is the base client for Runtime.

func New

func New(azureRegion AzureRegions) BaseClient

New creates an instance of the BaseClient client.

func NewWithoutDefaults

func NewWithoutDefaults(azureRegion AzureRegions) 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 *float64 `json:"startIndex,omitempty"`
	// EndIndex - The position of the last character of the matched entity within the utterance.
	EndIndex *float64 `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.

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 *float64 `json:"startIndex,omitempty"`
	// EndIndex - The position of the last character of the matched entity within the utterance.
	EndIndex *float64 `json:"endIndex,omitempty"`
}

EntityWithResolution ...

func (EntityWithResolution) MarshalJSON

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

MarshalJSON is the custom marshaler for EntityWithResolution.

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 *float64 `json:"startIndex,omitempty"`
	// EndIndex - The position of the last character of the matched entity within the utterance.
	EndIndex *float64 `json:"endIndex,omitempty"`
}

EntityWithScore ...

func (EntityWithScore) MarshalJSON

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

MarshalJSON is the custom marshaler for EntityWithScore.

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

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(azureRegion AzureRegions) PredictionClient

NewPredictionClient creates an instance of the PredictionClient client.

func (PredictionClient) Resolve

func (client PredictionClient) Resolve(ctx context.Context, appID string, 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 string, 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.

Jump to

Keyboard shortcuts

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