wit

package
v0.64.10 Latest Latest
Warning

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

Go to latest
Published: Jan 22, 2020 License: AGPL-3.0 Imports: 8 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 EntityCandidate

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

type MessageResponse

type MessageResponse struct {
	MsgID    string                       `json:"msg_id"`
	Text     string                       `json:"_text"`
	Entities map[string][]EntityCandidate `json:"entities" validate:"required"`
}

MessageResponse is the response from a /message request

Jump to

Keyboard shortcuts

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