Documentation ¶
Index ¶
- Constants
- type Client
- func (c *Client) TextProcess(request *TextProcessRequest) (response *TextProcessResponse, err error)
- func (c *Client) TextProcessWithContext(ctx context.Context, request *TextProcessRequest) (response *TextProcessResponse, err error)
- func (c *Client) TextReset(request *TextResetRequest) (response *TextResetResponse, err error)
- func (c *Client) TextResetWithContext(ctx context.Context, request *TextResetRequest) (response *TextResetResponse, err error)
- type Group
- type ResponseMessage
- type SlotInfo
- type TextProcessRequest
- type TextProcessRequestParams
- type TextProcessResponse
- type TextProcessResponseParams
- type TextResetRequest
- type TextResetRequestParams
- type TextResetResponse
- type TextResetResponseParams
Constants ¶
const ( // 内部错误。 INTERNALERROR = "InternalError" // 查询数据库失败,没有对应数据。 INTERNALERROR_ERRORMMS = "InternalError.ErrorMms" // nlu处理失败。 INTERNALERROR_ERRORNLU = "InternalError.ErrorNlu" // rpc调用失败。 INTERNALERROR_ERRORRPC = "InternalError.ErrorRpc" // webHook处理失败。 INTERNALERROR_ERRORWEBHOOK = "InternalError.ErrorWebHook" // 未开通相关应用访问权限。 INTERNALERROR_NOAPPPRIVILEGE = "InternalError.NoAppPrivilege" // 参数错误。 INVALIDPARAMETER = "InvalidParameter" )
const APIVersion = "2019-06-27"
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
func NewClient ¶
func NewClient(credential common.CredentialIface, region string, clientProfile *profile.ClientProfile) (client *Client, err error)
func NewClientWithSecretId ¶
Deprecated
func (*Client) TextProcess ¶
func (c *Client) TextProcess(request *TextProcessRequest) (response *TextProcessResponse, err error)
TextProcess 接收调用侧的文本输入,返回应答文本。
可能返回的错误码:
INTERNALERROR = "InternalError" INTERNALERROR_ERRORMMS = "InternalError.ErrorMms" INTERNALERROR_ERRORNLU = "InternalError.ErrorNlu" INTERNALERROR_ERRORRPC = "InternalError.ErrorRpc" INTERNALERROR_ERRORWEBHOOK = "InternalError.ErrorWebHook" INTERNALERROR_NOAPPPRIVILEGE = "InternalError.NoAppPrivilege" INVALIDPARAMETER = "InvalidParameter"
func (*Client) TextProcessWithContext ¶ added in v1.0.324
func (c *Client) TextProcessWithContext(ctx context.Context, request *TextProcessRequest) (response *TextProcessResponse, err error)
TextProcess 接收调用侧的文本输入,返回应答文本。
可能返回的错误码:
INTERNALERROR = "InternalError" INTERNALERROR_ERRORMMS = "InternalError.ErrorMms" INTERNALERROR_ERRORNLU = "InternalError.ErrorNlu" INTERNALERROR_ERRORRPC = "InternalError.ErrorRpc" INTERNALERROR_ERRORWEBHOOK = "InternalError.ErrorWebHook" INTERNALERROR_NOAPPPRIVILEGE = "InternalError.NoAppPrivilege" INVALIDPARAMETER = "InvalidParameter"
func (*Client) TextReset ¶
func (c *Client) TextReset(request *TextResetRequest) (response *TextResetResponse, err error)
TextReset 会话重置接口。
可能返回的错误码:
INTERNALERROR = "InternalError" INTERNALERROR_ERRORMMS = "InternalError.ErrorMms" INTERNALERROR_ERRORNLU = "InternalError.ErrorNlu" INTERNALERROR_ERRORRPC = "InternalError.ErrorRpc" INTERNALERROR_ERRORWEBHOOK = "InternalError.ErrorWebHook" INTERNALERROR_NOAPPPRIVILEGE = "InternalError.NoAppPrivilege" INVALIDPARAMETER = "InvalidParameter"
func (*Client) TextResetWithContext ¶ added in v1.0.324
func (c *Client) TextResetWithContext(ctx context.Context, request *TextResetRequest) (response *TextResetResponse, err error)
TextReset 会话重置接口。
可能返回的错误码:
INTERNALERROR = "InternalError" INTERNALERROR_ERRORMMS = "InternalError.ErrorMms" INTERNALERROR_ERRORNLU = "InternalError.ErrorNlu" INTERNALERROR_ERRORRPC = "InternalError.ErrorRpc" INTERNALERROR_ERRORWEBHOOK = "InternalError.ErrorWebHook" INTERNALERROR_NOAPPPRIVILEGE = "InternalError.NoAppPrivilege" INVALIDPARAMETER = "InvalidParameter"
type Group ¶
type Group struct { // 消息类型参考互联网MIME类型标准,当前仅支持"text/plain"。 ContentType *string `json:"ContentType,omitnil,omitempty" name:"ContentType"` // 返回内容以链接形式提供。 // 注意:此字段可能返回 null,表示取不到有效值。 Url *string `json:"Url,omitnil,omitempty" name:"Url"` // 普通文本。 // 注意:此字段可能返回 null,表示取不到有效值。 Content *string `json:"Content,omitnil,omitempty" name:"Content"` }
type ResponseMessage ¶
type ResponseMessage struct { // 消息组列表。 // 注意:此字段可能返回 null,表示取不到有效值。 GroupList []*Group `json:"GroupList,omitnil,omitempty" name:"GroupList"` }
type TextProcessRequest ¶
type TextProcessRequest struct { *tchttp.BaseRequest // 机器人标识,用于定义抽象机器人。 BotId *string `json:"BotId,omitnil,omitempty" name:"BotId"` // 机器人版本,取值"dev"或"release",{调试版本:dev;线上版本:release}。 BotEnv *string `json:"BotEnv,omitnil,omitempty" name:"BotEnv"` // 终端标识,每个终端(或线程)对应一个,区分并发多用户。 TerminalId *string `json:"TerminalId,omitnil,omitempty" name:"TerminalId"` // 请求的文本。 InputText *string `json:"InputText,omitnil,omitempty" name:"InputText"` // 透传字段,透传给用户自定义的WebService服务。 SessionAttributes *string `json:"SessionAttributes,omitnil,omitempty" name:"SessionAttributes"` // 平台类型,{小程序:MiniProgram;小微:XiaoWei;公众号:OfficialAccount;企业微信: WXWork}。 PlatformType *string `json:"PlatformType,omitnil,omitempty" name:"PlatformType"` // 当PlatformType为微信公众号或企业微信时,传递对应微信公众号或企业微信的唯一标识 PlatformId *string `json:"PlatformId,omitnil,omitempty" name:"PlatformId"` }
func NewTextProcessRequest ¶
func NewTextProcessRequest() (request *TextProcessRequest)
func (*TextProcessRequest) FromJsonString ¶
func (r *TextProcessRequest) FromJsonString(s string) error
FromJsonString It is highly **NOT** recommended to use this function because it has no param check, nor strict type check
func (*TextProcessRequest) ToJsonString ¶
func (r *TextProcessRequest) ToJsonString() string
type TextProcessRequestParams ¶ added in v1.0.426
type TextProcessRequestParams struct { // 机器人标识,用于定义抽象机器人。 BotId *string `json:"BotId,omitnil,omitempty" name:"BotId"` // 机器人版本,取值"dev"或"release",{调试版本:dev;线上版本:release}。 BotEnv *string `json:"BotEnv,omitnil,omitempty" name:"BotEnv"` // 终端标识,每个终端(或线程)对应一个,区分并发多用户。 TerminalId *string `json:"TerminalId,omitnil,omitempty" name:"TerminalId"` // 请求的文本。 InputText *string `json:"InputText,omitnil,omitempty" name:"InputText"` // 透传字段,透传给用户自定义的WebService服务。 SessionAttributes *string `json:"SessionAttributes,omitnil,omitempty" name:"SessionAttributes"` // 平台类型,{小程序:MiniProgram;小微:XiaoWei;公众号:OfficialAccount;企业微信: WXWork}。 PlatformType *string `json:"PlatformType,omitnil,omitempty" name:"PlatformType"` // 当PlatformType为微信公众号或企业微信时,传递对应微信公众号或企业微信的唯一标识 PlatformId *string `json:"PlatformId,omitnil,omitempty" name:"PlatformId"` }
Predefined struct for user
type TextProcessResponse ¶
type TextProcessResponse struct { *tchttp.BaseResponse Response *TextProcessResponseParams `json:"Response"` }
func NewTextProcessResponse ¶
func NewTextProcessResponse() (response *TextProcessResponse)
func (*TextProcessResponse) FromJsonString ¶
func (r *TextProcessResponse) FromJsonString(s string) error
FromJsonString It is highly **NOT** recommended to use this function because it has no param check, nor strict type check
func (*TextProcessResponse) ToJsonString ¶
func (r *TextProcessResponse) ToJsonString() string
type TextProcessResponseParams ¶ added in v1.0.426
type TextProcessResponseParams struct { // 当前会话状态{会话开始: START; 会话中: COUTINUE; 会话结束: COMPLETE}。 // 注意:此字段可能返回 null,表示取不到有效值。 DialogStatus *string `json:"DialogStatus,omitnil,omitempty" name:"DialogStatus"` // 匹配到的机器人名称。 // 注意:此字段可能返回 null,表示取不到有效值。 BotName *string `json:"BotName,omitnil,omitempty" name:"BotName"` // 匹配到的意图名称。 // 注意:此字段可能返回 null,表示取不到有效值。 IntentName *string `json:"IntentName,omitnil,omitempty" name:"IntentName"` // 槽位信息。 // 注意:此字段可能返回 null,表示取不到有效值。 SlotInfoList []*SlotInfo `json:"SlotInfoList,omitnil,omitempty" name:"SlotInfoList"` // 原始的用户说法。 // 注意:此字段可能返回 null,表示取不到有效值。 InputText *string `json:"InputText,omitnil,omitempty" name:"InputText"` // 机器人应答。 // 注意:此字段可能返回 null,表示取不到有效值。 ResponseMessage *ResponseMessage `json:"ResponseMessage,omitnil,omitempty" name:"ResponseMessage"` // 透传字段,由用户自定义的WebService服务返回。 // 注意:此字段可能返回 null,表示取不到有效值。 SessionAttributes *string `json:"SessionAttributes,omitnil,omitempty" name:"SessionAttributes"` // 结果类型 {中间逻辑出错:0; 任务型机器人:1; 问答型机器人:2; 闲聊型机器人:3; 未匹配上,返回预设兜底话术:5; 未匹配上,返回相似问题列表:6}。 // 注意:此字段可能返回 null,表示取不到有效值。 ResultType *string `json:"ResultType,omitnil,omitempty" name:"ResultType"` // 机器人对话的应答文本。 ResponseText *string `json:"ResponseText,omitnil,omitempty" name:"ResponseText"` // 唯一请求 ID,由服务端生成,每次请求都会返回(若请求因其他原因未能抵达服务端,则该次请求不会获得 RequestId)。定位问题时需要提供该次请求的 RequestId。 RequestId *string `json:"RequestId,omitnil,omitempty" name:"RequestId"` }
Predefined struct for user
type TextResetRequest ¶
type TextResetRequest struct { *tchttp.BaseRequest // 机器人标识,用于定义抽象机器人。 BotId *string `json:"BotId,omitnil,omitempty" name:"BotId"` // 机器人版本,取值"dev"或"release",{调试版本:dev;线上版本:release}。 BotEnv *string `json:"BotEnv,omitnil,omitempty" name:"BotEnv"` // 终端标识,每个终端(或线程)对应一个,区分并发多用户。 TerminalId *string `json:"TerminalId,omitnil,omitempty" name:"TerminalId"` // 平台类型,{小程序:MiniProgram;小微:XiaoWei;公众号:OfficialAccount;企业微信: WXWork}。 PlatformType *string `json:"PlatformType,omitnil,omitempty" name:"PlatformType"` // 当PlatformType为微信公众号或企业微信时,传递对应微信公众号或企业微信的唯一标识 PlatformId *string `json:"PlatformId,omitnil,omitempty" name:"PlatformId"` }
func NewTextResetRequest ¶
func NewTextResetRequest() (request *TextResetRequest)
func (*TextResetRequest) FromJsonString ¶
func (r *TextResetRequest) FromJsonString(s string) error
FromJsonString It is highly **NOT** recommended to use this function because it has no param check, nor strict type check
func (*TextResetRequest) ToJsonString ¶
func (r *TextResetRequest) ToJsonString() string
type TextResetRequestParams ¶ added in v1.0.426
type TextResetRequestParams struct { // 机器人标识,用于定义抽象机器人。 BotId *string `json:"BotId,omitnil,omitempty" name:"BotId"` // 机器人版本,取值"dev"或"release",{调试版本:dev;线上版本:release}。 BotEnv *string `json:"BotEnv,omitnil,omitempty" name:"BotEnv"` // 终端标识,每个终端(或线程)对应一个,区分并发多用户。 TerminalId *string `json:"TerminalId,omitnil,omitempty" name:"TerminalId"` // 平台类型,{小程序:MiniProgram;小微:XiaoWei;公众号:OfficialAccount;企业微信: WXWork}。 PlatformType *string `json:"PlatformType,omitnil,omitempty" name:"PlatformType"` // 当PlatformType为微信公众号或企业微信时,传递对应微信公众号或企业微信的唯一标识 PlatformId *string `json:"PlatformId,omitnil,omitempty" name:"PlatformId"` }
Predefined struct for user
type TextResetResponse ¶
type TextResetResponse struct { *tchttp.BaseResponse Response *TextResetResponseParams `json:"Response"` }
func NewTextResetResponse ¶
func NewTextResetResponse() (response *TextResetResponse)
func (*TextResetResponse) FromJsonString ¶
func (r *TextResetResponse) FromJsonString(s string) error
FromJsonString It is highly **NOT** recommended to use this function because it has no param check, nor strict type check
func (*TextResetResponse) ToJsonString ¶
func (r *TextResetResponse) ToJsonString() string
type TextResetResponseParams ¶ added in v1.0.426
type TextResetResponseParams struct { // 当前会话状态{会话开始: START; 会话中: COUTINUE; 会话结束: COMPLETE}。 // 注意:此字段可能返回 null,表示取不到有效值。 DialogStatus *string `json:"DialogStatus,omitnil,omitempty" name:"DialogStatus"` // 匹配到的机器人名称。 // 注意:此字段可能返回 null,表示取不到有效值。 BotName *string `json:"BotName,omitnil,omitempty" name:"BotName"` // 匹配到的意图名称。 // 注意:此字段可能返回 null,表示取不到有效值。 IntentName *string `json:"IntentName,omitnil,omitempty" name:"IntentName"` // 槽位信息。 // 注意:此字段可能返回 null,表示取不到有效值。 SlotInfoList []*SlotInfo `json:"SlotInfoList,omitnil,omitempty" name:"SlotInfoList"` // 原始的用户说法。 // 注意:此字段可能返回 null,表示取不到有效值。 InputText *string `json:"InputText,omitnil,omitempty" name:"InputText"` // 机器人应答。 // 注意:此字段可能返回 null,表示取不到有效值。 ResponseMessage *ResponseMessage `json:"ResponseMessage,omitnil,omitempty" name:"ResponseMessage"` // 透传字段,由用户自定义的WebService服务返回。 // 注意:此字段可能返回 null,表示取不到有效值。 SessionAttributes *string `json:"SessionAttributes,omitnil,omitempty" name:"SessionAttributes"` // 结果类型 {中间逻辑出错:0; 任务型机器人:1; 问答型机器人:2; 闲聊型机器人:3; 未匹配上,返回预设兜底话术:5; 未匹配上,返回相似问题列表:6}。 // 注意:此字段可能返回 null,表示取不到有效值。 ResultType *string `json:"ResultType,omitnil,omitempty" name:"ResultType"` // 机器人对话的应答文本。 // 注意:此字段可能返回 null,表示取不到有效值。 ResponseText *string `json:"ResponseText,omitnil,omitempty" name:"ResponseText"` // 唯一请求 ID,由服务端生成,每次请求都会返回(若请求因其他原因未能抵达服务端,则该次请求不会获得 RequestId)。定位问题时需要提供该次请求的 RequestId。 RequestId *string `json:"RequestId,omitnil,omitempty" name:"RequestId"` }
Predefined struct for user