luis

package
v0.211.0 Latest Latest
Warning

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

Go to latest
Published: May 8, 2024 License: AGPL-3.0, AGPL-3.0-or-later Imports: 13 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewService

func NewService(httpClient *http.Client, httpRetries *httpx.RetryConfig, httpAccess *httpx.AccessConfig, classifier *flows.Classifier, endpoint, appID, key, slot string) flows.ClassificationService

NewService creates a new classification service

Types

type Client

type Client struct {
	// contains filtered or unexported fields
}

Client is a basic LUIS client

func NewClient

func NewClient(httpClient *http.Client, httpRetries *httpx.RetryConfig, httpAccess *httpx.AccessConfig, endpoint, appID, key, slot string) *Client

NewClient creates a new client

func (*Client) Predict

func (c *Client) Predict(q string) (*PredictResponse, *httpx.Trace, error)

Predict gets the published endpoint predictions for the given query

type Entities added in v0.132.0

type Entities struct {
	Values   map[string][]string
	Instance map[string][]Entity
}

func (*Entities) UnmarshalJSON added in v0.132.0

func (e *Entities) UnmarshalJSON(data []byte) error

type Entity added in v0.132.0

type Entity struct {
	Type   string          `json:"type"`
	Text   string          `json:"text" validate:"required"`
	Length int             `json:"length"`
	Score  decimal.Decimal `json:"score" validate:"required"`
}

type Intent added in v0.132.0

type Intent struct {
	Score decimal.Decimal `json:"score"`
}

type PredictResponse

type PredictResponse struct {
	Query      string      `json:"query"`
	Prediction *Prediction `json:"prediction" validate:"required"`
}

PredictResponse is the response from a predict request

type Prediction added in v0.132.0

type Prediction struct {
	TopIntent string            `json:"topIntent"`
	Intents   map[string]Intent `json:"intents" validate:"required"`
	Entities  *Entities         `json:"entities"`
	Sentiment *Sentiment        `json:"sentiment"`
}

type Sentiment added in v0.132.0

type Sentiment struct {
	Label string          `json:"label"`
	Score decimal.Decimal `json:"score"`
}

Jump to

Keyboard shortcuts

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