Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ( // DirectiveNameReply provides the reply directive name DirectiveNameReply = DirectiveName{"reply"} // DirectiveNameLongReply provides the long-reply directive name DirectiveNameLongReply = DirectiveName{"long-reply"} // DirectiveNameSpeak provides the speak directive name DirectiveNameSpeak = DirectiveName{"speak"} // DirectiveNameListen provides the listen directive name DirectiveNameListen = DirectiveName{"listen"} // DirectiveNameSleep provides the sleep directive name DirectiveNameSleep = DirectiveName{"sleep"} // DirectiveNameUIHint provides the ui-hint directive name DirectiveNameUIHint = DirectiveName{"ui-hint"} // DirectiveNameASRHint provides the asr-hint directive name DirectiveNameASRHint = DirectiveName{"asr-hint"} // DirectiveNameDisplay provides the display directive name DirectiveNameDisplay = DirectiveName{"display"} // DirectiveNameDisplayWebView provides the display-web-view directive name DirectiveNameDisplayWebView = DirectiveName{"display-web-view"} // DirectiveNameClearWebView provides the clear-web-view directive name DirectiveNameClearWebView = DirectiveName{"clear-web-view"} // DirectiveNameAssistantEvent provides the assistant-event directive name DirectiveNameAssistantEvent = DirectiveName{"assistant-event"} // DirectiveTypeView provides the view directive name DirectiveTypeView = DirectiveType{"view"} // DirectiveTypeAction provides the action directive name DirectiveTypeAction = DirectiveType{"action"} )
Functions ¶
This section is empty.
Types ¶
type Context ¶
type Context struct { OrgID *string `json:"orgId,omitempty"` // The org id of the user making the request UserID *string `json:"userId,omitempty"` // The id of the user making the request UserType *string `json:"userType,omitempty"` // "user", # The user type SupportedDirectives []string `json:"supportedDirectives,omitempty"` // The list of directives supported by the client making the request, e.g. sleep, listen, reply, speak DeveloperDeviceID *string `json:"developerDeviceId,omitempty"` }
Context contains some information about how the user is making the request.
type DirectiveName ¶
type DirectiveName struct {
// contains filtered or unexported fields
}
DirectiveName provides a strongly typed enum for directive names
func (DirectiveName) MarshalJSON ¶
func (n DirectiveName) MarshalJSON() ([]byte, error)
MarshalJSON implements the Marshaler interface
func (DirectiveName) String ¶
func (n DirectiveName) String() string
String implements the stringer interface
func (*DirectiveName) UnmarshalJSON ¶
func (n *DirectiveName) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the Unmarshaler interface
type DirectiveType ¶
type DirectiveType struct {
// contains filtered or unexported fields
}
DirectiveType provides a strongly typed enum for directive types
func (DirectiveType) MarshalJSON ¶
func (t DirectiveType) MarshalJSON() ([]byte, error)
MarshalJSON implements the Marshaler interface
func (DirectiveType) String ¶
func (t DirectiveType) String() string
String implements the stringer interface
func (*DirectiveType) UnmarshalJSON ¶
func (t *DirectiveType) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the Unmarshaler interface
type Frame ¶
type Frame struct { }
Frame contains information that needs to be preserved during multiple continuous interactions with the skill.
type History ¶
type History struct { }
History contains the history of the conversation in a multi-turn interaction.
type Params ¶
type Params struct { TargetDialogueState string `json:"target_dialogue_state,omitempty"` // Possible values: "skill_intro", "TODO:?what else?" TimeZone string `json:"time_zone,omitempty"` Timestamp int64 `json:"timestamp,omitempty"` Language string `json:"language,omitempty"` Locale string `json:"locale,omitempty"` DynamicResource interface{} `json:"dynamic_resource,omitempty"` AllowedIntents interface{} `json:"allowed_intents,omitempty"` }
Params Contains information like time_zone, timestamp of the query, language, etc... One particular field here is target_dialogue_state this can be used to tell us what the user intended to do. In this particular case, if the field is equal to skill_intro, we need to return an introductory message from the skill. TODO:Add missing fields.
type Payload ¶
type Payload struct { Text interface{} `json:"text,omitempty"` // may be string or []string for e.g. ui-hints Delay *int `json:"delay,omitempty"` Prompt *string `json:"prompt,omitempty"` DisplayImmediately *bool `json:"displayImmediately,omitempty"` Title *string `json:"title,omitempty"` URL *string `json:"url,omitempty"` Payload map[string]string `json:"payload,omitempty"` }
Payload is the payload for the WebexAssistantDirective
type WebexAssistantDirective ¶
type WebexAssistantDirective struct { Name DirectiveName `json:"name"` // reply, speak, listen, ui-hint, display-web-view, clear-web-view, assistant-event Type DirectiveType `json:"type"` // view, action Payload Payload `json:"payload"` }
WebexAssistantDirective is the response we need to sent back to Webex Assistant
type WebexAssistantHealthResponse ¶
type WebexAssistantHealthResponse struct { Challenge string `json:"challenge,omitempty"` Status string `json:"status,omitempty"` }
WebexAssistantHealthResponse is the response required for Webex Assistant Health Checks on our skill.
type WebexAssistantMessage ¶
type WebexAssistantMessage struct { // Text []string `json:"text"` Text string `json:"text"` Context Context `json:"context"` Params Params `json:"params"` Frame Frame `json:"frame"` History History `json:"history"` Challenge string `json:"challenge"` }
WebexAssistantMessage is the message we receive in the encrypted request from Webex Assistant.
type WebexAssistantRequest ¶
WebexAssistantRequest is the encrypted request we receive from Webex Assistant.
type WebexAssistantResponse ¶
type WebexAssistantResponse struct { Directives []WebexAssistantDirective `json:"directives"` Challenge string `json:"challenge"` }
WebexAssistantResponse is what we can send back to webex assistant.