wit

package
v0.214.3 Latest Latest
Warning

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

Go to latest
Published: May 21, 2024 License: AGPL-3.0, AGPL-3.0-or-later Imports: 11 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewService

func NewService(httpClient *http.Client, httpRetries *httpx.RetryConfig, classifier *flows.Classifier, accessToken string) flows.ClassificationService

NewService creates a new classification service

Types

type Client

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

Client is a basic Wit.ai client

func NewClient

func NewClient(httpClient *http.Client, httpRetries *httpx.RetryConfig, accessToken string) *Client

NewClient creates a new client

func (*Client) Message

func (c *Client) Message(q string) (*MessageResponse, *httpx.Trace, error)

Message gets the meaning of a message

type EntityMatch added in v0.95.0

type EntityMatch struct {
	ID         string          `json:"id"`
	Name       string          `json:"name"`
	Role       string          `json:"role"`
	Value      string          `json:"value"`
	Confidence decimal.Decimal `json:"confidence"`
}

EntityMatch is possible entity match

type IntentMatch added in v0.95.0

type IntentMatch struct {
	ID         string          `json:"id"`
	Name       string          `json:"name"`
	Confidence decimal.Decimal `json:"confidence"`
}

IntentMatch is possible intent match

type MessageResponse

type MessageResponse struct {
	Text     string                   `json:"text"`
	Intents  []IntentMatch            `json:"intents" validate:"required"`
	Entities map[string][]EntityMatch `json:"entities"`
	Traits   map[string][]TraitMatch  `json:"traits"`
}

MessageResponse is the response from a /message request

type TraitMatch added in v0.95.0

type TraitMatch struct {
	ID         string          `json:"id"`
	Value      string          `json:"value"`
	Confidence decimal.Decimal `json:"confidence"`
}

TraitMatch is possible trait match

Jump to

Keyboard shortcuts

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