Documentation ¶
Index ¶
Constants ¶
View Source
const (
TianURL = "https://api.tianapi.com/txapi/robot/index" // 天行机器人接口
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type NewsList ¶
type NewsList struct { Reply string `json:"reply"` // 回复内容 Datatype string `json:"datatype"` // 回复内容类型,text文本;view图文;image图片 }
天行机器人的回复
type Response ¶
type Response struct { Code Code `json:"code"` // 返回码 Msg string `json:"msg"` // 返回信息 NewsList []NewsList `json:"newslist"` // 天行机器人的回复 }
天行机器人的响应
type Tian ¶
type Tian struct { Key string `json:"key"` // API密钥,需自行注册获得 Question string `json:"question"` // 聊天文本内容 UniqueID string `json:"uniqueid"` // 用户唯一身份ID,方便上下文关联 Mode uint `json:"mode"` // 工作模式,宽松模式0(回答率高)、精确模式1(相关性高)、私有模式2(只从私有词库中回答) Priv uint `json:"priv"` // 私有词库匹配模式,完整匹配0[默认]、智能匹配1,模糊匹配2,结尾匹配3,开头匹配4 Restype uint `json:"restype"` // 输入类型,文本0、语音1、人脸图片2 }
天行机器人
Click to show internal directories.
Click to hide internal directories.