Documentation ¶
Index ¶
- Constants
- Variables
- type Action
- type Attachment
- type Card
- type CardButton
- type CardContent
- type Cardinal
- type Carousel
- type CarouselCard
- type Color
- type Component
- type ConnectClient
- func (client *ConnectClient) BroadcastMessage(messages ...Component) error
- func (client *ConnectClient) SendMessage(conversationID string, messages ...Component) error
- func (client *ConnectClient) ServeHTTP(w http.ResponseWriter, r *http.Request)
- func (client *ConnectClient) UseHandler(h MessageHandler)
- type Context
- type Conversation
- func (conv Conversation) IsNegative() bool
- func (conv Conversation) IsNeutral() bool
- func (conv Conversation) IsPositive() bool
- func (conv Conversation) IsVeryNegative() bool
- func (conv Conversation) IsVeryPositive() bool
- func (conv *Conversation) Reset() error
- func (conv *Conversation) ResetMemory() error
- func (conv *Conversation) SetMemory(memory map[string]map[string]interface{}) error
- type ConverseOpts
- type CustomEntity
- type Datetime
- type Dialog
- type DialogConversation
- type DialogOpts
- type Distance
- type Duration
- type Email
- type Emoji
- type Entities
- type IP
- type Intent
- type Interval
- type Job
- type Language
- type List
- type ListButton
- type ListContent
- type ListElement
- type Location
- type Mass
- type Message
- type MessageData
- type MessageHandler
- type MessageHandlerFunc
- type MessageWriter
- type Money
- type Nationality
- type Number
- type Ordinal
- type Organization
- type Percent
- type Person
- type Phone
- type Pronoun
- type QuickReplies
- type QuickRepliesButton
- type QuickRepliesContent
- type ReqOpts
- type RequestClient
- func (c *RequestClient) AnalyzeFile(filename string, opts *ReqOpts) (Response, error)
- func (c *RequestClient) AnalyzeText(text string, opts *ReqOpts) (Response, error)
- func (c *RequestClient) ConverseText(text string, opts *ConverseOpts) (Conversation, error)
- func (c *RequestClient) DialogText(text string, opts *DialogOpts) (Dialog, error)
- type Response
- func (r Response) Intent() (Intent, error)
- func (r Response) IsAbbreviation() bool
- func (r Response) IsAssert() bool
- func (r Response) IsCommand() bool
- func (r Response) IsDescription() bool
- func (r Response) IsEntity() bool
- func (r Response) IsHuman() bool
- func (r Response) IsLocation() bool
- func (r Response) IsNegative() bool
- func (r Response) IsNeutral() bool
- func (r Response) IsNumber() bool
- func (r Response) IsPositive() bool
- func (r Response) IsVeryNegative() bool
- func (r Response) IsVeryPositive() bool
- func (r Response) IsWhQuery() bool
- func (r Response) IsYnQuery() bool
- type Set
- type Sort
- type Speed
- type Temperature
- type URL
- type Volume
Constants ¶
const ( //ActAssert used in Response.IsAssert() ActAssert = "assert" //ActCommand used in Response.IsCommand() ActCommand = "command" //ActWhQuery used in Response.IsWhQuery() ActWhQuery = "wh-query" //ActYnQuery used in Response.IsYhQuery() ActYnQuery = "yn-query" //TypeAbbreviation used in Response.IsAbbreviation() TypeAbbreviation = "abbr:" //TypeEntity used in Response.IsEntity() TypeEntity = "enty:" //TypeDescription used in Response.IsDescription() TypeDescription = "desc:" //TypeHuman used in Response.IsHuman() TypeHuman = "hum:" //TypeLocation used in Response.IsLocation() TypeLocation = "loc:" //TypeNumber used in Response.IsNumber() TypeNumber = "num:" //SentimentPositive used in Response.IsPositive() and Conversation.IsPositive() SentimentPositive = "positive" //SentimentVeryPositive used in Response.IsVeryPositive() and Conversation.IsVeryPositive() SentimentVeryPositive = "vpositive" //SentimentNegative used in Response.IsNegative() and Conversation.IsNegative() SentimentNegative = "negative" //SentimentVeryNegative used in Response.IsVeryNegative() and Conversation.IsVeryNegative() SentimentVeryNegative = "vnegative" //SentimentNeutral used in Response.IsNeutral() and Conversation.IsNeutral() SentimentNeutral = "neutral" )
Variables ¶
var ( //ErrNoMessageToSend return when you try send empty Component list ErrNoMessageToSend = errors.New("No message to send") //ErrNoRequestBody return when you try parse empty request body ErrNoRequestBody = errors.New("The request's body is empty") //ErrNoRequestConversationID return when you try send empty conversationID ErrNoRequestConversationID = errors.New("The request's conversationID 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") )
Functions ¶
This section is empty.
Types ¶
type Action ¶
type Action struct { Slug string `json:"slug"` Done bool `json:"done"` Reply string `json:"reply"` }
Action represents a conversation action
type Attachment ¶
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 ¶
func NewTextMessage(text string) Attachment
NewTextMessage returns a new text attachment
func (Attachment) IsComponent ¶
func (c Attachment) IsComponent() bool
IsComponent marks Attachment as a valid messaging content
type Card ¶
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 ¶
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) IsComponent ¶
IsComponent marks Card as a valid messaging content
type CardButton ¶
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 ¶
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 ¶
type Cardinal struct { Bearing float64 `json:"bearing"` Raw string `json:"raw"` Confidence float64 `json:"confidence"` }
Cardinal Recast.AI entity
type Carousel ¶
type Carousel struct { Type string `json:"type"` Content []*CarouselCard `json:"content"` }
Carousel complex type see https://recast.ai/docs/structured-messages for details
func NewCarousel ¶
func NewCarousel() *Carousel
NewCarousel create new Carousel see https://recast.ai/docs/structured-messages for details
func (*Carousel) AddCard ¶
func (c *Carousel) AddCard(card *CarouselCard) *Carousel
AddCard append card component into Carousel
func (*Carousel) IsComponent ¶
IsComponent CarouselCard is Component
type CarouselCard ¶
type CarouselCard struct { Title string `json:"title"` Subtitle string `json:"subtitle"` ImageURL string `json:"imageUrl"` Buttons []CardButton `json:"buttons"` }
CarouselCard item of Carousel see https://recast.ai/docs/structured-messages for details
func NewCarouselCard ¶
func NewCarouselCard(title, subtitle string) *CarouselCard
NewCarouselCard create of CarouselCard see https://recast.ai/docs/structured-messages for details
func (*CarouselCard) AddButton ¶
func (c *CarouselCard) AddButton(title, typ, value string) *CarouselCard
AddButton add button to CarouselCard.Buttons
func (*CarouselCard) AddImage ¶
func (c *CarouselCard) AddImage(image string) *CarouselCard
AddImage add image_url
type Color ¶
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 ¶
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 ¶
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 ¶
func NewConnectClient(token string) *ConnectClient
NewConnectClient creates a new client with the provided API token.
func (*ConnectClient) BroadcastMessage ¶
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 ¶
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 ¶
func (client *ConnectClient) ServeHTTP(w http.ResponseWriter, r *http.Request)
func (*ConnectClient) UseHandler ¶
func (client *ConnectClient) UseHandler(h MessageHandler)
UseHandler specify the handler when message are received. By default, the message are printed to stdout.
type Conversation ¶
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 ¶
func (conv Conversation) IsNegative() bool
IsNegative returns whether or not the sentiment is negative
func (Conversation) IsNeutral ¶
func (conv Conversation) IsNeutral() bool
IsNeutral returns whether or not the sentiment is neutral
func (Conversation) IsPositive ¶
func (conv Conversation) IsPositive() bool
IsPositive returns whether or not the sentiment is positive
func (Conversation) IsVeryNegative ¶
func (conv Conversation) IsVeryNegative() bool
IsVeryNegative returns whether or not the sentiment is very negative
func (Conversation) IsVeryPositive ¶
func (conv Conversation) IsVeryPositive() bool
IsVeryPositive returns whether or not the sentiment is very positive
func (*Conversation) Reset ¶
func (conv *Conversation) Reset() error
Reset resets all the conversation (actions and variables)
func (*Conversation) ResetMemory ¶
func (conv *Conversation) ResetMemory() error
ResetMemory empties all variables in the conversation
type ConverseOpts ¶
type ConverseOpts struct { ConversationToken string Memory map[string]map[string]interface{} Language string Token string }
ConverseOpts contains options for ConverseText method
type CustomEntity ¶
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 ¶
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 Dialog ¶
type Dialog struct { Messages []Component `json:"-"` DialogConversation DialogConversation `json:"conversation"` Nlp Response `json:"nlp"` }
Dialog contains the response from the /dialog endpoint of the API
type DialogConversation ¶
type DialogConversation struct { ID string `json:"id"` Language string `json:"language"` Skill string `json:"skill"` SkillOccurences int `json:"skill_occurences"` SkillStack []string `json:"skill_stack"` Memory map[string]interface{} `json:"memory"` }
DialogConversation see https://recast.ai/docs/api-reference/#dialog-text
type DialogOpts ¶
DialogOpts contains options for DialogText method
type Distance ¶
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 ¶
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 ¶
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 ¶
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 ¶
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 IP ¶
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 Interval ¶
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 Language ¶
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 ¶
type List struct { Type string `json:"type"` Content ListContent `json:"content"` }
List hold formats for a list of the Recast.AI botconnector
func NewList ¶
func NewList() *List
NewList initializes an empty list with the given title and subtitle
func (*List) AddElement ¶
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 ¶
IsComponent marks Card as a valid messaging content
type ListContent ¶
type ListContent struct { Elements []*ListElement `json:"elements"` Buttons []ListButton `json:"buttons"` }
ListContent holds data for the list content
type ListElement ¶
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 ¶
func NewListElement(title, subtitle string) *ListElement
NewListElement initializes an empty list element with the given title and subtitle
func (*ListElement) AddButton ¶
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 ¶
func (e *ListElement) AddImage(image string) *ListElement
AddImage adds an image to a list element
type Location ¶
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 ¶
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 ¶
type Message struct { ConversationID string `json:"conversation"` Attachment Attachment `json:"attachment"` SenderID uint64 ChatID uint64 }
Message contains data sent by Recast.AI connector.
type MessageData ¶
type MessageData struct { Message Message `json:"message"` SenderID uint64 `json:"senderId"` ChatID uint64 `json:"chatId"` }
MessageData contains the Message and messaging informations about the message
type MessageHandler ¶
type MessageHandler interface {
ServeMessage(w MessageWriter, m Message)
}
MessageHandler is implemented by any element that would like to receive a message.
type MessageHandlerFunc ¶
type MessageHandlerFunc func(w MessageWriter, m Message)
MessageHandlerFunc simpler wrapper for function.
func (MessageHandlerFunc) ServeMessage ¶
func (f MessageHandlerFunc) ServeMessage(w MessageWriter, m Message)
ServeMessage implements the MessageHandler interface.
type MessageWriter ¶
type MessageWriter interface { Reply(messages ...Component) error Broadcast(messages ...Component) error }
MessageWriter is the structure allowing you to respond.
type Money ¶
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 ¶
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 ¶
type Number struct { Scalar float64 `json:"scalar"` Raw string `json:"raw"` Confidence float64 `json:"confidence"` }
Number Recast.AI entity
type Ordinal ¶
type Ordinal struct { Rank int32 `json:"rank"` Raw string `json:"raw"` Confidence float64 `json:"confidence"` }
Ordinal Recast.AI entity
type Organization ¶
Organization Recast.AI entity
type Percent ¶
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 ¶
type Person struct { Fullname string `json:"fullname"` Raw string `json:"raw"` Confidence float64 `json:"confidence"` }
Person Recast.AI entity
type Phone ¶
type Phone struct { Number string `json:"number"` Raw string `json:"raw"` Confidence float64 `json:"confidence"` }
Phone Recast.AI entity
type Pronoun ¶
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 ¶
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 ¶
func NewQuickReplies(title string) *QuickReplies
NewQuickReplies initializes a new QuickReply structure with the specified title
func (*QuickReplies) AddButton ¶
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 ¶
func (q *QuickReplies) IsComponent() bool
IsComponent marks QuickReplies as a valid messaging content
type QuickRepliesButton ¶
QuickRepliesButton holds format for a generic quickreply
type QuickRepliesContent ¶
type QuickRepliesContent struct { Title string `json:"title"` Buttons []QuickRepliesButton `json:"buttons"` }
QuickRepliesContent holds data for QuickReplies
type ReqOpts ¶
ReqOpts are used to overwrite the client token and language on a per request baises if a user wises to do so
type RequestClient ¶
RequestClient provides an interface to interact with Recast.AI Natural Language Processing API
func (*RequestClient) AnalyzeFile ¶
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 ¶
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 ¶
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)
func (*RequestClient) DialogText ¶
func (c *RequestClient) DialogText(text string, opts *DialogOpts) (Dialog, error)
DialogText retrieve all metadata, intents and replies from a sentence
type Response ¶
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 ¶
Intent returns the first matched intent, or an error if no intent where matched
func (Response) IsAbbreviation ¶
IsAbbreviation returns whether or not the sentence is asking for an abbreviation
func (Response) IsDescription ¶
IsDescription returns whether or not the sentence is asking for an description
func (Response) IsLocation ¶
IsLocation returns whether or not the sentence is asking for an location
func (Response) IsNegative ¶
IsNegative returns whether or not the sentiment is negative
func (Response) IsPositive ¶
IsPositive returns whether or not the sentiment is positive
func (Response) IsVeryNegative ¶
IsVeryNegative returns whether or not the sentiment is very negative
func (Response) IsVeryPositive ¶
IsVeryPositive returns whether or not the sentiment is very positive
type Set ¶
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 ¶
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 ¶
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 ¶
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