SDK-Golang: github.com/RecastAI/SDK-Golang/recast Index | Files

package recast

import "github.com/RecastAI/SDK-Golang/recast"

Index

Package Files

components.go connect.go constants.go context.go conversation.go entity.go intent.go request.go response.go

Constants

const (
    ActAssert  string = "assert"
    ActCommand        = "command"
    ActWhQuery        = "wh-query"
    ActYnQuery        = "yn-query"

    TypeAbbreviation = "abbr:"
    TypeEntity       = "enty:"
    TypeDescription  = "desc:"
    TypeHuman        = "hum:"
    TypeLocation     = "loc:"
    TypeNumber       = "num:"

    SentimentPositive     = "positive"
    SentimentVeryPositive = "vpositive"
    SentimentNegative     = "negative"
    SentimentVeryNegative = "vnegative"
    SentimentNeutral      = "neutral"
)

Variables

var (
    ErrNoMessageToSend = errors.New("No message to send")
    ErrNoRequestBody   = errors.New("The request's body is empty")
)
var (
    // ErrTokenNotSet is returned when the token for a client is empty
    ErrTokenNotSet = errors.New("Request cannot be made without a token set")
)

type Action Uses

type Action struct {
    Slug  string `json:"slug"`
    Done  bool   `json:"done"`
    Reply string `json:"reply"`
}

Action represents a conversation action

type Attachment Uses

type Attachment struct {
    // Type must be set according to the content sent
    // It can be either "text", "picture" or "video"
    Type    string `json:"type"`
    Content string `json:"content"`
}

Attachment holds data for both text, picture and video messages

attachment := Attachment{
	Type: "text",
	Content: "Hello World",
}

func NewTextMessage Uses

func NewTextMessage(text string) Attachment

NewTextMessage returns a new text attachment

func (Attachment) IsComponent Uses

func (c Attachment) IsComponent() bool

IsComponent marks Attachment as a valid messaging content

type Card Uses

type Card struct {
    Type    string      `json:"type"`
    Content CardContent `json:"content"`
}

Card holds formats for a generic messaging card for Recast.AI botconnector

card := recast.NewCard("Do you like to code?").
	AddImage("https://unsplash.it/1920/1080/?random").
	AddButton("Yes", "postback", "I like to code").
	AddButton("No", "postback", "I don't like to code")

func NewCard Uses

func NewCard(title, subtitle string) *Card

NewCard initializes a new card with the specified title It can be used to display informations and images to the user or to ask multiple choice question with actionable buttons

func (*Card) AddButton Uses

func (c *Card) AddButton(title, typ, value string) *Card

AddButton adds a button with the specified title, type and value to a Card

func (*Card) AddImage Uses

func (c *Card) AddImage(imageUrl string) *Card

AddImage sets the image that will be displayed in the message

func (*Card) IsComponent Uses

func (c *Card) IsComponent() bool

IsComponent marks Card as a valid messaging content

type CardButton Uses

type CardButton struct {
    Title string `json:"title"`
    Type  string `json:"type"`
    Value string `json:"value"`
}

CardButton holds data for a button in messaging channels formats

type CardContent Uses

type CardContent struct {
    Title    string       `json:"title"`
    Subtitle string       `json:"subtitle"`
    ImageUrl string       `json:"imageUrl"`
    Buttons  []CardButton `json:"buttons"`
}

CardContent holds data for a card in messaging platforms

type Cardinal Uses

type Cardinal struct {
    Bearing    float64 `json:"bearing"`
    Raw        string  `json:"raw"`
    Confidence float64 `json:"confidence"`
}

Cardinal Recast.AI entity

type Carousel struct {
    Type    string          `json:"type"`
    Content []*CarouselCard `json:"content"`
}

func NewCarousel Uses

func NewCarousel() *Carousel

func (*Carousel) AddCard Uses

func (c *Carousel) AddCard(card *CarouselCard) *Carousel

func (*Carousel) IsComponent Uses

func (c *Carousel) IsComponent() bool

type CarouselCard Uses

type CarouselCard struct {
    Title    string       `json:"title"`
    Subtitle string       `json:"subtitle"`
    ImageUrl string       `json:"imageUrl"`
    Buttons  []CardButton `json:"buttons"`
}

func NewCarouselCard Uses

func NewCarouselCard(title, subtitle string) *CarouselCard

func (*CarouselCard) AddButton Uses

func (c *CarouselCard) AddButton(title, typ, value string) *CarouselCard

func (*CarouselCard) AddImage Uses

func (c *CarouselCard) AddImage(image string) *CarouselCard

type Color Uses

type Color struct {
    Rgb        string  `json:"rgb"`
    Hex        string  `json:"hex"`
    Raw        string  `json:"raw"`
    Confidence float64 `json:"confidence"`
}

Color Recast.AI entity

type Component Uses

type Component interface {
    IsComponent() bool
}

Component interface is used as a marker for the connector message formats All data structure that can be sent as a message has to implement this interface

type ConnectClient Uses

type ConnectClient struct {
    Token string
    // contains filtered or unexported fields
}

ConnectClient provides an interface to Recast.AI connector service It allows to send message to a particular user and broadcast message to all users of a bot

client := recast.ConnectClient{"YOUR_TOKEN"}
message := recast.NewTextMessage("Hello")
err := client.SendMessage("CONVERSATION_ID", message)

func NewConnectClient Uses

func NewConnectClient(token string) *ConnectClient

NewConnectClient creates a new client with the provided API token.

func (*ConnectClient) BroadcastMessage Uses

func (client *ConnectClient) BroadcastMessage(messages ...Component) error

BroadcastMessage sends messages to all users of a bot

card := recast.NewQuickReplies("").
	AddButton("Say hello", "Hello").
	AddButton("Say goodbyes", "Goodbye")
err := client.BroadcastMessage(card)

func (*ConnectClient) SendMessage Uses

func (client *ConnectClient) SendMessage(conversationId string, messages ...Component) error

SendMessage send messages to Recast.AI botconnector service A message can either be a Card, a QuickReplies or an Attachment structure

card := recast.NewCard("Hi!").
	AddImage("https://unsplash.it/1920/1080/?random").
	AddButton("Say hello", "postback", "Hello").
	AddButton("Say goodbyes", "postback", "Goodbye")
err := client.SendMessage("CONVERSATION_ID", card)

func (*ConnectClient) ServeHTTP Uses

func (client *ConnectClient) ServeHTTP(w http.ResponseWriter, r *http.Request)

func (*ConnectClient) UseHandler Uses

func (client *ConnectClient) UseHandler(h MessageHandler)

UseHandler specify the handler when message are received. By default, the message are printed to stdout.

type Context Uses

type Context struct {
    ConversationId string
    SenderId       string
}

Context holds the information about a conversation context

type Conversation Uses

type Conversation struct {
    ConversationToken  string                 `json:"conversation_token"`
    UUID               string                 `json:"uuid"`
    Source             string                 `json:"source"`
    Replies            []string               `json:"replies"`
    Action             Action                 `json:"action"`
    NextActions        []Action               `json:"next_actions"`
    Memory             map[string]interface{} `json:"memory"`
    Intents            []Intent               `json:"intents"`
    Sentiment          string                 `json:"sentiment"`
    Entities           Entities               `json:"entities"`
    Language           string                 `json:"language"`
    ProcessingLanguage string                 `json:"processing_language"`
    Version            string                 `json:"version"`
    Timestamp          time.Time              `json:"timestamp"`
    Status             int                    `json:"status"`
    AuthorizationToken string
    CustomEntities     map[string][]CustomEntity
}

Conversation contains the response from the converse endpoint of the API

func (Conversation) IsNegative Uses

func (conv Conversation) IsNegative() bool

IsNegative returns whether or not the sentiment is negative

func (Conversation) IsNeutral Uses

func (conv Conversation) IsNeutral() bool

IsNeutral returns whether or not the sentiment is neutral

func (Conversation) IsPositive Uses

func (conv Conversation) IsPositive() bool

IsPositive returns whether or not the sentiment is positive

func (Conversation) IsVeryNegative Uses

func (conv Conversation) IsVeryNegative() bool

IsVeryNegative returns whether or not the sentiment is very negative

func (Conversation) IsVeryPositive Uses

func (conv Conversation) IsVeryPositive() bool

IsVeryPositive returns whether or not the sentiment is very positive

func (*Conversation) Reset Uses

func (conv *Conversation) Reset() error

Reset resets all the conversation (actions and variables)

func (*Conversation) ResetMemory Uses

func (conv *Conversation) ResetMemory() error

ResetMemory empties all variables in the conversation

func (*Conversation) SetMemory Uses

func (conv *Conversation) SetMemory(memory map[string]map[string]interface{}) error

SetMemory allows to change the conversation memory variables

type ConverseOpts Uses

type ConverseOpts struct {
    ConversationToken string
    Memory            map[string]map[string]interface{}
    Language          string
    Token             string
}

ConverseOpts contains options for ConverseText method

type CustomEntity Uses

type CustomEntity struct {
    // Raw string detected and extracted from the input
    Raw string `json:"raw"`

    // Value of the entity
    Value string `json:"value"`

    // Detection confidence
    Confidence float64 `json:"value"`

    // Name of the entity
    Name string
}

CustomEntity represents a Recast.AI user-defined entity

type Datetime Uses

type Datetime struct {
    Formatted  string  `json:"formatted"`
    Iso        string  `json:"iso"`
    Accuracy   string  `json:"accuracy"`
    Chronology string  `json:"chronology"`
    Raw        string  `json:"raw"`
    Confidence float64 `json:"confidence"`
}

Datetime Recast.AI entity

type Distance Uses

type Distance struct {
    Scalar     float64 `json:"scalar"`
    Unit       string  `json:"unit"`
    Meters     float64 `json:"meters"`
    Raw        string  `json:"raw"`
    Confidence float64 `json:"confidence"`
}

Distance Recast.AI entity

type Duration Uses

type Duration struct {
    Chrono     string  `json:"chrono"`
    Years      float64 `json:"years"`
    Months     float64 `json:"months"`
    Days       float64 `json:"days"`
    Hours      float64 `json:"hours"`
    Minutes    float64 `json:"minutes"`
    Seconds    float64 `json:"seconds"`
    Raw        string  `json:"raw"`
    Confidence float64 `json:"confidence"`
}

Duration Recast.AI entity

type Email Uses

type Email struct {
    Local      string `json:"local"`
    Tag        string `json:"tag"`
    Domain     string `json:"domain"`
    Raw        string `json:"raw"`
    Confidence string `json:"confidence"`
}

Email Recast.AI entity

type Emoji Uses

type Emoji struct {
    Formatted   string   `json:"formatted"`
    Feeling     string   `json:"feeling"`
    Tags        []string `json:"tags"`
    Unicode     string   `json:"unicode"`
    Description string   `json:"description"`
    Raw         string   `json:"raw"`
    Confidence  float64  `json:"confidence"`
}

Emoji Recast.AI entity

type Entities Uses

type Entities struct {
    Cardinal     []Cardinal     `json:"cardinal"`
    Color        []Color        `json:"color"`
    Datetime     []Datetime     `json:"datetime"`
    Distance     []Distance     `json:"distance"`
    Duration     []Duration     `json:"duration"`
    Email        []Email        `json:"email"`
    Emoji        []Emoji        `json:"emoji"`
    Ip           []Ip           `json:"ip"`
    Interval     []Interval     `json:"interval"`
    Job          []Job          `json:"job"`
    Language     []Language     `json:"language"`
    Location     []Location     `json:"location"`
    Mass         []Mass         `json:"mass"`
    Money        []Money        `json:"money"`
    Nationality  []Nationality  `json:"nationality"`
    Number       []Number       `json:"number"`
    Ordinal      []Ordinal      `json:"ordinal"`
    Organization []Organization `json:"organization"`
    Percent      []Percent      `json:"percent"`
    Person       []Person       `json:"person"`
    Phone        []Phone        `json:"phone"`
    Pronoun      []Pronoun      `json:"pronoun"`
    Set          []Set          `json:"set"`
    Sort         []Sort         `json:"sort"`
    Speed        []Speed        `json:"speed"`
    Temperature  []Temperature  `json:"temperature"`
}

Entities holds the entity hashmap returned by a call to Recast.AI Natural Language Processing service

type Intent Uses

type Intent struct {
    Slug       string  `json:"slug"`
    Confidence float64 `json:"confidence"`
}

Intent defines the details which define a single intent

type Interval Uses

type Interval struct {
    Begin           string  `json:"begin"`
    End             string  `json:"end"`
    BeginChronology string  `json:"begin_chronology"`
    EndChronology   string  `json:"end_chronology"`
    BeginAccuracy   string  `json:"begin_accuracy"`
    EndAccuracy     string  `json:"end_accuracy"`
    Timespan        float64 `json:"timespan"`
    Raw             string  `json:"raw"`
    Confidence      float64 `json:"confidence"`
}

Interval Recast.AI entity

type Ip Uses

type Ip struct {
    Formatted  string  `json:"formatted"`
    Lat        float64 `json:"lat"`
    Lng        float64 `json:"lng"`
    Raw        string  `json:"raw"`
    Confidence float64 `json:"confidence"`
}

Ip Recast.AI entity

type Job Uses

type Job struct {
    Raw        string  `json:"raw"`
    Confidence float64 `json:"confidence"`
}

Job Recast.AI entity

type Language Uses

type Language struct {
    Short      string `json:"short"`
    Long       string `json:"long"`
    Raw        string `json:"raw"`
    Confidence string `json:"confidence"`
}

Language Recast.AI entity

type List Uses

type List struct {
    Type    string      `json:"type"`
    Content ListContent `json:"content"`
}

List hold formats for a list of the Recast.AI botconnector

func NewList Uses

func NewList() *List

NewList initializes an empty list with the given title and subtitle

func (*List) AddButton Uses

func (l *List) AddButton(title, typ, value string) *List

AddButton adds a button to a list

func (*List) AddElement Uses

func (l *List) AddElement(e *ListElement) *List

AddElement adds a list element to a list A list can hold a maximum of 4 elements

func (*List) IsComponent Uses

func (l *List) IsComponent() bool

IsComponent marks Card as a valid messaging content

type ListButton Uses

type ListButton CardButton

ListButton has the same content as a card button

type ListContent Uses

type ListContent struct {
    Elements []*ListElement `json:"elements"`
    Buttons  []ListButton   `json:"buttons"`
}

ListContent holds data for the list content

type ListElement Uses

type ListElement struct {
    Title    string       `json:"title"`
    ImageUrl string       `json:"imageUrl"`
    Subtitle string       `json:"subtitle"`
    Buttons  []ListButton `json:"buttons"`
}

ListElement holds data for one list item

func NewListElement Uses

func NewListElement(title, subtitle string) *ListElement

NewListElement initializes an empty list element with the given title and subtitle

func (*ListElement) AddButton Uses

func (e *ListElement) AddButton(title, typ, value string) *ListElement

AddButton adds a button to a list element Each element can hold only one button

func (*ListElement) AddImage Uses

func (e *ListElement) AddImage(image string) *ListElement

AddImage adds an image to a list element

type Location Uses

type Location struct {
    Formatted  string  `json:"formatted"`
    Lat        float64 `json:"lat"`
    Lng        float64 `json:"lng"`
    Place      string  `json:"place"`
    Type       string  `json:"type"`
    Raw        string  `json:"raw"`
    Confidence float64 `json:"confidence"`
}

Location Recast.AI entity

type Mass Uses

type Mass struct {
    Scalar     float64 `json:"scalar"`
    Unit       string  `json:"unit"`
    Grams      float64 `json:"grams"`
    Raw        string  `json:"raw"`
    Confidence float64 `json:"confidence"`
}

Mass Recast.AI entity

type Message Uses

type Message struct {
    ConversationId string     `json:"conversation"`
    Attachment     Attachment `json:"attachment"`
    SenderId       string
    ChatId         string
}

Message contains data sent by Recast.AI connector.

func ParseConnectorMessage Uses

func ParseConnectorMessage(r *http.Request) (Message, error)

ParseConnectorMessage handles a request coming from BotConnector API. It parses the request body into a MessageData struct

type MessageData Uses

type MessageData struct {
    Message  Message `json:"message"`
    SenderId string  `json:"senderId"`
    ChatId   string  `json:"chatId"`
}

MessageData contains the Message and messaging informations about the message

type MessageHandler Uses

type MessageHandler interface {
    ServeMessage(w MessageWriter, m Message)
}

MessageHandler is implemented by any element that would like to receive a message.

type MessageHandlerFunc Uses

type MessageHandlerFunc func(w MessageWriter, m Message)

MessageHandlerFunc simpler wrapper for function.

func (MessageHandlerFunc) ServeMessage Uses

func (f MessageHandlerFunc) ServeMessage(w MessageWriter, m Message)

ServeMessage implements the MessageHandler interface.

type MessageWriter Uses

type MessageWriter interface {
    Reply(messages ...Component) error
    Broadcast(messages ...Component) error
}

MessageWriter is the structure allowing you to respond.

type Money Uses

type Money struct {
    Amount     float64 `json:"amount"`
    Currency   string  `json:"currency"`
    Dollars    float64 `json:"dollars"`
    Raw        string  `json:"raw"`
    Confidence string  `json:"confidence"`
}

Money Recast.AI entity

type Nationality Uses

type Nationality struct {
    Short      string  `json:"short"`
    Long       string  `json:"long"`
    Country    string  `json:"country"`
    Raw        string  `json:"raw"`
    Confidence float64 `json:"confidence"`
}

Nationality Recast.AI entity

type Number Uses

type Number struct {
    Scalar     float64 `json:"scalar"`
    Raw        string  `json:"raw"`
    Confidence float64 `json:"confidence"`
}

Number Recast.AI entity

type Ordinal Uses

type Ordinal struct {
    Rank       int32   `json:"rank"`
    Raw        string  `json:"raw"`
    Confidence float64 `json:"confidence"`
}

Ordinal Recast.AI entity

type Organization Uses

type Organization struct {
    Raw        string  `json:"raw"`
    Confidence float64 `json:"confidence"`
}

Organization Recast.AI entity

type Percent Uses

type Percent struct {
    Scalar     float64 `json:"scalar"`
    Unit       string  `json:"unit"`
    Raw        string  `json:"raw"`
    Confidence float64 `json:"confidence"`
}

Percent Recast.AI entity

type Person Uses

type Person struct {
    Fullname   string  `json:"fullname"`
    Raw        string  `json:"raw"`
    Confidence float64 `json:"confidence"`
}

Person Recast.AI entity

type Phone Uses

type Phone struct {
    Number     string  `json:"number"`
    Raw        string  `json:"raw"`
    Confidence float64 `json:"confidence"`
}

Phone Recast.AI entity

type Pronoun Uses

type Pronoun struct {
    Person     int32   `json:"person"`
    Number     string  `json:"number"`
    Gender     string  `json:"gender"`
    Raw        string  `json:"raw"`
    Confidence float64 `json:"confidence"`
}

Pronoun Recast.AI entity

type QuickReplies Uses

type QuickReplies struct {
    Type    string              `json:"type"`
    Content QuickRepliesContent `json:"content"`
}

QuickReplies holds format for generic quick replies for Recast.AI botconnector It allows the user to quickly choose a response that will be sent back as a text message to the bot

quickReplies := recast.NewQuickReplies("Do you like to code?").
	AddButton("Yes", "I like to code").
	AddButton("No", "I don't like to code")

func NewQuickReplies Uses

func NewQuickReplies(title string) *QuickReplies

NewQuickReplies initializes a new QuickReply structure with the specified title

func (*QuickReplies) AddButton Uses

func (q *QuickReplies) AddButton(title, value string) *QuickReplies

AddButton adds a button to replies choices proposed to the user the title parameter will be displayed in the messaging app and the value will be sent back as a text message if the user chooses it

func (*QuickReplies) IsComponent Uses

func (q *QuickReplies) IsComponent() bool

IsComponent marks QuickReplies as a valid messaging content

type QuickRepliesButton Uses

type QuickRepliesButton struct {
    Title string `json:"title"`
    Value string `json:"value"`
}

QuickRepliesButton holds format for a generic quickreply

type QuickRepliesContent Uses

type QuickRepliesContent struct {
    Title   string               `json:"title"`
    Buttons []QuickRepliesButton `json:"buttons"`
}

QuickRepliesContent holds data for QuickReplies

type ReqOpts Uses

type ReqOpts struct {
    Token    string
    Language string
}

ReqOpts are used to overwrite the client token and language on a per request baises if a user wises to do so

type RequestClient Uses

type RequestClient struct {
    Token    string
    Language string
}

RequestClient provides an interface to interact with Recast.AI Natural Language Processing API

func (*RequestClient) AnalyzeFile Uses

func (c *RequestClient) AnalyzeFile(filename string, opts *ReqOpts) (Response, error)

AnalyzeFile handles voice file request to Recast.Ai and returns a Response opts can be used to specify a token and/or language to use for this request Set opts to nil if you want the request to use the client's token and language

client := recast.RequestClient{
	Token: "YOUR_AUTHORIZATION_TOKEN",
	Language: "fr",
}
opts := recast.ReqOpts{Language: "en"}
// This request will be processed in english
response, err := client.AnalyzeFile("audio_file.wav", &opts)

func (*RequestClient) AnalyzeText Uses

func (c *RequestClient) AnalyzeText(text string, opts *ReqOpts) (Response, error)

AnalyzeText processes a text request to Recast.AI API and returns a Response opts can be used to specify a token and/or language to use for this request Set opts to nil if you want the request to use the client's token and language

client := recast.RequestClient{
	Token: "YOUR_AUTHORIZATION_TOKEN",
	Language: "fr",
}
opts := recast.ReqOpts{Language: "en"}
// This request will be processed in english
response, err := client.AnalyzeText("Hello what is the weather in London?", &opts)

func (*RequestClient) ConverseText Uses

func (c *RequestClient) ConverseText(text string, opts *ConverseOpts) (Conversation, error)

ConverseText processes a text request to Recast.AI API and returns a Response ConverseOpts can be used to specify a conversation token, an authorization token, a memory state and a language to use for this request Set opts to nil if you want the request to use the client's token and language If a conversation token is present in the options, the request will be processed in this conversation, othewise a new conversation is created and the token is returned

client := recast.RequestClient{
	Token: "YOUR_AUTHORIZATION_TOKEN",
	Language: "fr",
}
opts := recast.ReqOpts{Language: "en"}
// This request will be processed in english
conversation, err := client.ConverseText("Hello what is the weahter in London?", &opts)

type Response Uses

type Response struct {
    UUID               string    `json:"uuid"`
    Source             string    `json:"source"`
    Intents            []Intent  `json:"intents"`
    Act                string    `json:"act"`
    Type               string    `json:"type"`
    Sentiment          string    `json:"sentiment"`
    Entities           Entities  `json:"entities"`
    Language           string    `json:"language"`
    ProcessingLanguage string    `json:"processing_language"`
    Version            string    `json:"version"`
    Timestamp          time.Time `json:"timestamp"`
    Status             int       `json:"status"`
    CustomEntities     map[string][]CustomEntity
}

Response is the HTTP response from the Recast.AI Natural Language Processing API

func (Response) Intent Uses

func (r Response) Intent() (Intent, error)

Intent returns the first matched intent, or an error if no intent where matched

func (Response) IsAbbreviation Uses

func (r Response) IsAbbreviation() bool

IsAbbreviation returns whether or not the sentence is asking for an abbreviation

func (Response) IsAssert Uses

func (r Response) IsAssert() bool

IsAssert returns whether or not the sentence is an assertion

func (Response) IsCommand Uses

func (r Response) IsCommand() bool

IsCommand returns whether or not the sentence is a command

func (Response) IsDescription Uses

func (r Response) IsDescription() bool

IsDescription returns whether or not the sentence is asking for an description

func (Response) IsEntity Uses

func (r Response) IsEntity() bool

IsEntity returns whether or not the sentence is asking for an entity

func (Response) IsHuman Uses

func (r Response) IsHuman() bool

IsHuman returns whether or not the sentence is asking for an human

func (Response) IsLocation Uses

func (r Response) IsLocation() bool

IsLocation returns whether or not the sentence is asking for an location

func (Response) IsNegative Uses

func (r Response) IsNegative() bool

IsNegative returns whether or not the sentiment is negative

func (Response) IsNeutral Uses

func (r Response) IsNeutral() bool

IsNeutral returns whether or not the sentiment is neutral

func (Response) IsNumber Uses

func (r Response) IsNumber() bool

IsNumber returns whether or not the sentence is asking for an number

func (Response) IsPositive Uses

func (r Response) IsPositive() bool

IsPositive returns whether or not the sentiment is positive

func (Response) IsVeryNegative Uses

func (r Response) IsVeryNegative() bool

IsVeryNegative returns whether or not the sentiment is very negative

func (Response) IsVeryPositive Uses

func (r Response) IsVeryPositive() bool

IsVeryPositive returns whether or not the sentiment is very positive

func (Response) IsWhQuery Uses

func (r Response) IsWhQuery() bool

IsWhQuery returns whether or not the sentence is a wh query

func (Response) IsYnQuery Uses

func (r Response) IsYnQuery() bool

IsYnQuery returns whether or not the sentence is a yes-no question

type Set Uses

type Set struct {
    Next       string  `json:"next"`
    Frequency  string  `json:"frequency"`
    Interval   string  `json:"interval"`
    Rrule      string  `json:"rrule"`
    Raw        string  `json:"raw"`
    Confidence float64 `json:"confidence"`
}

Set Recast.AI entity

type Sort Uses

type Sort struct {
    Order      string  `json:"order"`
    Criterion  string  `json:"criterion"`
    Raw        string  `json:"raw"`
    Confidence float64 `json:"confidence"`
}

Sort Recast.AI entity

type Speed Uses

type Speed struct {
    Scalar     float64 `json:"scalar"`
    Unit       string  `json:"unit"`
    Mps        float64 `json:"mps"`
    Raw        string  `json:"raw"`
    Confidence float64 `json:"confidence"`
}

Speed Recast.AI entity

type Temperature Uses

type Temperature struct {
    Scalar     float64 `json:"scalar"`
    Unit       string  `json:"unit"`
    Celsius    float64 `json:"celsius"`
    Raw        string  `json:"raw"`
    Confidence float64 `json:"confidence"`
}

Temperature Recast.AI entity

type Url Uses

type Url struct {
    Scheme     string  `json:"scheme"`
    Host       string  `json:"host"`
    Path       string  `json:"path"`
    Param      string  `json:"param"`
    Query      string  `json:"query"`
    Fragment   string  `json:"fragment"`
    Raw        string  `json:"raw"`
    Confidence float64 `json:"confidence"`
}

Url Recast.AI entity

type Volume Uses

type Volume struct {
    Scalar     float64 `json:"scalar"`
    Unit       string  `json:"unit"`
    Liters     float64 `json:"liters"`
    Raw        string  `json:"raw"`
    Confidence float64 `json:"confidence"`
}

Volume Recast.AI entity

Package recast imports 9 packages (graph). Updated 2017-10-21. Refresh now. Tools for package owners.