Documentation
¶
Index ¶
- Constants
- func GetSessionData(rawData string) data.Session
- func NewRequest(rawData string) interface{}
- type AudioPlayerEventRequest
- type Dialog
- func (this *Dialog) ConfirmIntent() *Dialog
- func (this *Dialog) ConfirmSlot(name string) *Dialog
- func (this *Dialog) Delegate() *Dialog
- func (this *Dialog) ElicitSlot(name string) *Dialog
- func (this *Dialog) GetDirective() *data.DialogDirective
- func (this *Dialog) GetIntentConfirmationStatus(index ...int) string
- func (this *Dialog) GetIntentName() (string, bool)
- func (this *Dialog) GetQuery() (string, bool)
- func (this *Dialog) GetSlotConfirmationStatus(name string, index ...int) string
- func (this *Dialog) GetSlotValue(name string, index ...int) string
- type EventRequest
- type Intent
- type IntentRequest
- type LaunchRequest
- type Request
- func (this *Request) GetAccessToken() string
- func (this *Request) GetAudioPlayerContext() data.AudioPlayerContext
- func (this *Request) GetBotId() string
- func (this *Request) GetDeviceId() string
- func (this *Request) GetRequestId() string
- func (this *Request) GetSupportedInterfaces() map[string]interface{}
- func (this *Request) GetTimestamp() int
- func (this *Request) GetUserId() string
- func (this *Request) GetVideoPlayerContext() data.VideoPlayerContext
- func (this *Request) IsSupportAudio() bool
- func (this *Request) IsSupportDisplay() bool
- func (this *Request) IsSupportVideo() bool
- func (this *Request) VerifyBotID(myBotID string) bool
- func (this *Request) VerifyTimestamp() bool
- type Response
- func (this *Response) Ask(speech string) *Response
- func (this *Response) AskSlot(speech string, slot string) *Response
- func (this *Response) Build() string
- func (this *Response) CloseMicrophone() *Response
- func (this *Response) Command(directive interface{}) *Response
- func (this *Response) DisplayCard(card interface{}) *Response
- func (this *Response) GetData() map[string]interface{}
- func (this *Response) HoldOn() *Response
- func (this *Response) Reprompt(speech string) *Response
- func (this *Response) Tell(speech string) *Response
- type SSMLTextBuilder
- func (this *SSMLTextBuilder) AppendAudio(src string) *SSMLTextBuilder
- func (this *SSMLTextBuilder) AppendBackground(text string, src string, repeat bool) *SSMLTextBuilder
- func (this *SSMLTextBuilder) AppendPlainSpeech(text string) *SSMLTextBuilder
- func (this *SSMLTextBuilder) AppendSilence(time int) *SSMLTextBuilder
- func (this *SSMLTextBuilder) AppendSubstitution(text, alias string) *SSMLTextBuilder
- func (this *SSMLTextBuilder) ApplyBackground(src string, repeat bool) *SSMLTextBuilder
- func (this *SSMLTextBuilder) Build() string
- type Session
- type SessionEndedRequest
- type VideoPlayerEventRequest
Constants ¶
View Source
const ( INENT_REQUEST = "IntentRequest" LAUNCH_REQUEST = "LaunchRequest" SESSION_ENDED_REQUEST = "SessionEndedRequest" AUDIO_PLAYER_PLAYBACK_STARTED = "AudioPlayer.PlaybackStarted" AUDIO_PLAYER_PLAYBACK_STOPPED = "AudioPlayer.PlaybackStopped" AUDIO_PLAYER_PLAYBACK_FINISHED = "AudioPlayer.PlaybackFinished" AUDIO_PLAYER_PLAYBACK_NEARLY_FINISHED = "AudioPlayer.PlaybackNearlyFinished" AUDIO_PLAYER_PROGRESS_REPORT_INTERVAL_ELAPSED = "AudioPlayer.ProgressReportIntervalElapsed" VIDEO_PLAYER_PLAYBACK_STARTED = "VideoPlayer.PlaybackStarted" VIDEO_PLAYER_PLAYBACK_STOPPED = "VideoPlayer.PlaybackStopped" VIDEO_PLAYER_PLAYBACK_FINISHED = "VideoPlayer.PlaybackFinished" VIDEO_PLAYER_PLAYBACK_NEARLY_FINISHED = "VideoPlayer.PlaybackNearlyFinished" VIDEO_PLAYER_PLAYBACK_SCHEDULED_STOP_REACHED = "VideoPlayer.PlaybackScheduledStopReached" VIDEO_PLAYER_PROGRESS_REPORT_INTERVAL_ELAPSED = "VideoPlayer.ProgressReportIntervalElapsed" )
Variables ¶
This section is empty.
Functions ¶
func GetSessionData ¶
func NewRequest ¶
func NewRequest(rawData string) interface{}
Types ¶
type AudioPlayerEventRequest ¶
type AudioPlayerEventRequest struct { Data data.AudioPlayerEventRequest EventRequest }
func (*AudioPlayerEventRequest) GetOffsetInMilliseconds ¶
func (this *AudioPlayerEventRequest) GetOffsetInMilliseconds() int32
type Dialog ¶
type Dialog struct { Intents []*Intent DialogState string // contains filtered or unexported fields }
func NewDialog ¶
func NewDialog(request data.IntentRequestBody) *Dialog
func (*Dialog) GetDirective ¶
func (this *Dialog) GetDirective() *data.DialogDirective
func (*Dialog) GetIntentConfirmationStatus ¶
获取意图的确认状态
func (*Dialog) GetSlotConfirmationStatus ¶
获取槽位的确认状态,默认取第一组槽位
type EventRequest ¶
type EventRequest struct { Data data.EventRequest Request }
func (*EventRequest) GetName ¶
func (this *EventRequest) GetName() string
func (*EventRequest) GetUrl ¶
func (this *EventRequest) GetUrl() string
type Intent ¶
type IntentRequest ¶
type IntentRequest struct { Data data.IntentRequest Dialog *Dialog Request }
func (*IntentRequest) GetIntentName ¶
func (this *IntentRequest) GetIntentName() (string, bool)
获取意图名
func (*IntentRequest) IsDialogStateCompleted ¶
func (this *IntentRequest) IsDialogStateCompleted() bool
槽位填充是否完成
type LaunchRequest ¶
type LaunchRequest struct { Data data.LaunchRequest Request }
type Request ¶
type Request struct { Type string Common data.RequestPart }
func (*Request) GetAudioPlayerContext ¶
func (this *Request) GetAudioPlayerContext() data.AudioPlayerContext
获取音频播放上下文
func (*Request) GetSupportedInterfaces ¶
获取设备支持的接口类型
func (*Request) GetVideoPlayerContext ¶
func (this *Request) GetVideoPlayerContext() data.VideoPlayerContext
获取视频播放上下文
type Response ¶
type Response struct {
// contains filtered or unexported fields
}
func NewResponse ¶
func (*Response) Ask ¶
*
- 询问用户时,返回的speech.
- 此时设备的麦克风会进入收音状态,比如设备灯光亮起
- TIP: 一般技能要完成一项任务,还缺少一些信息,主动发起对用户的询问的时候使用
type SSMLTextBuilder ¶
type SSMLTextBuilder struct {
// contains filtered or unexported fields
}
func NewSSMLTextBuilder ¶
func NewSSMLTextBuilder() *SSMLTextBuilder
func (*SSMLTextBuilder) AppendAudio ¶
func (this *SSMLTextBuilder) AppendAudio(src string) *SSMLTextBuilder
func (*SSMLTextBuilder) AppendBackground ¶
func (this *SSMLTextBuilder) AppendBackground(text string, src string, repeat bool) *SSMLTextBuilder
func (*SSMLTextBuilder) AppendPlainSpeech ¶
func (this *SSMLTextBuilder) AppendPlainSpeech(text string) *SSMLTextBuilder
func (*SSMLTextBuilder) AppendSilence ¶
func (this *SSMLTextBuilder) AppendSilence(time int) *SSMLTextBuilder
func (*SSMLTextBuilder) AppendSubstitution ¶
func (this *SSMLTextBuilder) AppendSubstitution(text, alias string) *SSMLTextBuilder
func (*SSMLTextBuilder) ApplyBackground ¶
func (this *SSMLTextBuilder) ApplyBackground(src string, repeat bool) *SSMLTextBuilder
func (*SSMLTextBuilder) Build ¶
func (this *SSMLTextBuilder) Build() string
type Session ¶
type Session struct {
// contains filtered or unexported fields
}
func NewSession ¶
func (*Session) GetAttribute ¶
获取session中对应字段的值
func (*Session) SetAttribute ¶
设置session中对应字段的值
type SessionEndedRequest ¶
type SessionEndedRequest struct { Data data.SessionEndedRequest Request }
type VideoPlayerEventRequest ¶
type VideoPlayerEventRequest struct { Data data.VideoPlayerEventRequest EventRequest }
func (*VideoPlayerEventRequest) GetOffsetInMilliseconds ¶
func (this *VideoPlayerEventRequest) GetOffsetInMilliseconds() int32
Click to show internal directories.
Click to hide internal directories.