Documentation
¶
Index ¶
Constants ¶
View Source
const ( //HelpIntent is the Alexa built-in Help Intent HelpIntent = "AMAZON.HelpIntent" //CancelIntent is the Alexa built-in Cancel Intent CancelIntent = "AMAZON.CancelIntent" //StopIntent is the Alexa built-in Stop Intent StopIntent = "AMAZON.StopIntent" )
built in intents
View Source
const ( // LocaleItalian is the locale for Italian LocaleItalian = "it-IT" // LocaleGerman is the locale for standard dialect German LocaleGerman = "de-DE" // LocaleAustralianEnglish is the locale for Australian English LocaleAustralianEnglish = "en-AU" //LocaleCanadianEnglish is the locale for Canadian English LocaleCanadianEnglish = "en-CA" //LocaleBritishEnglish is the locale for UK English LocaleBritishEnglish = "en-GB" //LocaleIndianEnglish is the locale for Indian English LocaleIndianEnglish = "en-IN" //LocaleAmericanEnglish is the locale for American English LocaleAmericanEnglish = "en-US" // LocaleJapanese is the locale for Japanese LocaleJapanese = "ja-JP" )
locales
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Context ¶
type Context struct {
System struct {
APIAccessToken string `json:"apiAccessToken"`
Device struct {
DeviceID string `json:"deviceId,omitempty"`
} `json:"device,omitempty"`
Application struct {
ApplicationID string `json:"applicationId,omitempty"`
} `json:"application,omitempty"`
} `json:"System,omitempty"`
}
Context represents the Alexa skill request context
type Directives ¶
type Directives struct {
Type string `json:"type,omitempty"`
SlotToElicit string `json:"slotToElicit,omitempty"`
UpdatedIntent *UpdatedIntent `json:"UpdatedIntent,omitempty"`
PlayBehavior string `json:"playBehavior,omitempty"`
AudioItem struct {
Stream struct {
Token string `json:"token,omitempty"`
URL string `json:"url,omitempty"`
OffsetInMilliseconds int `json:"offsetInMilliseconds,omitempty"`
} `json:"stream,omitempty"`
} `json:"audioItem,omitempty"`
}
Directives is imformation
type Image ¶
type Image struct {
SmallImageURL string `json:"smallImageUrl,omitempty"`
LargeImageURL string `json:"largeImageUrl,omitempty"`
}
Image ...
type Payload ¶
type Payload struct {
Type string `json:"type,omitempty"`
Title string `json:"title,omitempty"`
Text string `json:"text,omitempty"`
SSML string `json:"ssml,omitempty"`
Content string `json:"content,omitempty"`
Image Image `json:"image,omitempty"`
}
Payload ...
type Reprompt ¶
type Reprompt struct {
OutputSpeech Payload `json:"outputSpeech,omitempty"`
}
Reprompt is imformation
type ReqBody ¶
type ReqBody struct {
Type string `json:"type"`
RequestID string `json:"requestId"`
Timestamp string `json:"timestamp"`
Locale string `json:"locale"`
Intent Intent `json:"intent,omitempty"`
Reason string `json:"reason,omitempty"`
DialogState string `json:"dialogState,omitempty"`
}
ReqBody is the actual request information
type Request ¶
type Request struct {
Version string `json:"version"`
Session Session `json:"session"`
Body ReqBody `json:"request"`
Context Context `json:"context"`
}
Request is an Alexa skill request see https://developer.amazon.com/docs/custom-skills/request-and-response-json-reference.html#request-format
type ResBody ¶
type ResBody struct {
OutputSpeech *Payload `json:"outputSpeech,omitempty"`
Card *Payload `json:"card,omitempty"`
Reprompt *Reprompt `json:"reprompt,omitempty"`
Directives []Directives `json:"directives,omitempty"`
ShouldEndSession bool `json:"shouldEndSession"`
}
ResBody is the actual body of the response
type Resolutions ¶
type Response ¶
type Response struct {
Version string `json:"version"`
SessionAttributes map[string]interface{} `json:"sessionAttributes,omitempty"`
Body ResBody `json:"response"`
}
Response is the response back to the Alexa speech service
func NewSimpleResponse ¶
NewSimpleResponse builds a session response
type Session ¶
type Session struct {
New bool `json:"new"`
SessionID string `json:"sessionId"`
Application struct {
ApplicationID string `json:"applicationId"`
} `json:"application"`
Attributes map[string]interface{} `json:"attributes"`
User struct {
UserID string `json:"userId"`
AccessToken string `json:"accessToken,omitempty"`
} `json:"user"`
}
Session represents the Alexa skill session
type Slot ¶
type Slot struct {
Name string `json:"name"`
Value string `json:"value"`
Resolutions Resolutions `json:"resolutions"`
}
Slot is an Alexa skill slot
type UpdatedIntent ¶
type UpdatedIntent struct {
Name string `json:"name,omitempty"`
ConfirmationStatus string `json:"confirmationStatus,omitempty"`
Slots map[string]interface{} `json:"slots,omitempty"`
}
UpdatedIntent is to update the Intent
Click to show internal directories.
Click to hide internal directories.