Skip to content

Latest commit

 

History

History
173 lines (93 loc) · 4.37 KB

response.md

File metadata and controls

173 lines (93 loc) · 4.37 KB

model

import "github.com/dueros/bot-sdk-go/bot/model"

dialog.go intent.go request.go response.go session.go ssml_builder.go

type Response struct {
    // contains filtered or unexported fields
}
func NewResponse(session *Session, request interface{}) *Response

func (*Response) Ask

func (this *Response) Ask(speech string) *Response
* 询问用户时,返回的speech.
* 此时设备的麦克风会进入收音状态,比如设备灯光亮起
* TIP: 一般技能要完成一项任务,还缺少一些信息,主动发起对用户的询问的时候使用

func (*Response) AskSlot

func (this *Response) AskSlot(speech string, slot string) *Response

func (*Response) Build

func (this *Response) Build() string

func (*Response) CloseMicrophone

func (this *Response) CloseMicrophone() *Response
* 保持会话.
* 关闭麦克风

func (*Response) Command

func (this *Response) Command(directive interface{}) *Response
* 返回指令. 比如,返回音频播放指令,使设备开始播放音频
* TIP: 可以同时返回多个指令,设备按返回顺序执行这些指令,指令协议参考TODO

func (*Response) DisplayCard

func (this *Response) DisplayCard(card interface{}) *Response
* 返回卡片.
* 针对有屏幕的设备,比如: 电视、show,可以呈现更多丰富的信息给用户
* 卡片协议参考:TODO

func (*Response) GetData

func (this *Response) GetData() map[string]interface{}

func (*Response) HoldOn

func (this *Response) HoldOn() *Response
* 保持会话.
* 此时设备的麦克风会自动开启监听用户说话

func (*Response) Reprompt

func (this *Response) Reprompt(speech string) *Response
* 回复用户,返回的speech

func (*Response) Tell

func (this *Response) Tell(speech string) *Response
* 回复用户,返回的speech

Generated by godoc2md