Documentation ¶
Overview ¶
The basic API for interacting with a google home/google assistant with structures to convert the request/response to and from json
Index ¶
- Constants
- type ActionConfig
- type Argument
- type Conversation
- type Coordinates
- type Device
- type ExpectedInput
- type ExpectedIntent
- type FinalResponse
- type Input
- type InputPrompt
- type InputValueSpec
- type Location
- type PermissionValueSpec
- type RawInput
- type RootRequest
- type RootResponse
- type SpeechResponse
- type Time
- type User
- type UserProfile
Constants ¶
const MAIN_INTENT = "assistant.intent.action.MAIN"
The assistant fires the main intent for the root level call (for example "Ok Google, Talk To <Action>").
const PERMISSION_INTENT = "assistant.intent.action.PERMISSION"
The assistant fires the permission intent when an action invokes askForPermission
const TEXT_INTENT = "assistant.intent.action.TEXT"
The assistant fires the text intent when you the action ask for a response.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ActionConfig ¶
type ActionConfig struct { ErrorMessage string ConversationAPIVersionHeader string ConversationAPIVersion string ResponseHeaders map[string]string }
func NewDefaultActionConfig ¶
func NewDefaultActionConfig() ActionConfig
NewDefaultActionConfig generates an ActionConfig with the default values and returns it
type Argument ¶
type Argument struct { Name *string `json:"name"` RawText *string `json:"raw_text"` IntValue *string `json:"int_value"` BoolValue *string `json:"bool_value"` TextValue *string `json:"text_value"` DateValue *string `json:"date_value"` TimeValue *string `json:"time_value"` LocationValue *Location `json:"location_value"` FormattedAddress *string `json:"formatted_address"` }
type Conversation ¶
type Coordinates ¶
type ExpectedInput ¶
type ExpectedInput struct { PossibleIntents []ExpectedIntent `json:"possible_intents"` InputPrompt_ InputPrompt `json:"input_prompt"` }
type ExpectedIntent ¶
type ExpectedIntent struct { Intent string `json:"intent"` InputValueSpec_ *InputValueSpec `json:"input_value_spec,omitempty"` }
type FinalResponse ¶
type FinalResponse struct {
SpeechResponse_ SpeechResponse `json:"speech_response"`
}
type InputPrompt ¶
type InputPrompt struct { InitialPrompts []SpeechResponse `json:"initial_prompts"` NoInputPrompts []SpeechResponse `json:"no_input_prompts,omitempty"` }
type InputValueSpec ¶
type InputValueSpec struct {
PermissionValueSpec_ PermissionValueSpec `json:"permission_value_spec"`
}
type Location ¶
type Location struct { City *string `json:"city"` ZipCode *string `json:"zip_code"` FormattedAddress *string `json:"formatted_address"` Coordinates_ *Coordinates `json:"coordinates"` }
type PermissionValueSpec ¶
type RootRequest ¶
type RootRequest struct { User_ *User `json:"user"` Device_ *Device `json:"device"` Conversation_ *Conversation `json:"conversation"` Inputs []Input `json:"inputs"` }
RootRequest object which should contain all the request data sent via google
type RootResponse ¶
type RootResponse struct { ConversationToken *string `json:"conversation_token,omitempty"` ExpectUserResponse bool `json:"expect_user_response"` ExpectedInputs []ExpectedInput `json:"expected_inputs,omitempty"` FinalResponse_ *FinalResponse `json:"final_response,omitempty"` }
RootResponse object which will be formatted to json and sent back to google and onto the user.
type SpeechResponse ¶
type User ¶
type User struct { UserId *string `json:"user_id"` AccessToken *string `json:"access_token"` Profile *UserProfile `json:"profile"` }