v20190311

package
v1.0.941 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 12, 2024 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (

	// 内部错误。
	INTERNALERROR = "InternalError"

	// 调用元数据服务失败。
	INTERNALERROR_CALLMMSFAILED = "InternalError.CallMMSFailed"

	// 请求ASR服务失败。
	INTERNALERROR_ERRORASR = "InternalError.ErrorAsr"

	// 查询数据库失败,没有对应数据。
	INTERNALERROR_ERRORMMS = "InternalError.ErrorMms"

	// nlu处理失败。
	INTERNALERROR_ERRORNLU = "InternalError.ErrorNlu"

	// rpc调用失败。
	INTERNALERROR_ERRORRPC = "InternalError.ErrorRpc"

	// 请求TTS服务失败。
	INTERNALERROR_ERRORTTS = "InternalError.ErrorTts"

	// webHook处理失败。
	INTERNALERROR_ERRORWEBHOOK = "InternalError.ErrorWebHook"

	// 查询元数据失败,没有对应数据。
	INTERNALERROR_MMSINTERNALERROR = "InternalError.MMSInternalError"

	// 未开通相关应用访问权限。
	INTERNALERROR_NOAPPPRIVILEGE = "InternalError.NoAppPrivilege"

	// 参数错误。
	INVALIDPARAMETER = "InvalidParameter"
)
View Source
const APIVersion = "2019-03-11"

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	common.Client
}

func NewClient

func NewClient(credential common.CredentialIface, region string, clientProfile *profile.ClientProfile) (client *Client, err error)

func NewClientWithSecretId

func NewClientWithSecretId(secretId, secretKey, region string) (client *Client, err error)

Deprecated

func (*Client) CreateBot

func (c *Client) CreateBot(request *CreateBotRequest) (response *CreateBotResponse, err error)

CreateBot 创建机器人

可能返回的错误码:

INTERNALERROR_CALLMMSFAILED = "InternalError.CallMMSFailed"
INTERNALERROR_MMSINTERNALERROR = "InternalError.MMSInternalError"
INVALIDPARAMETER = "InvalidParameter"

func (*Client) CreateBotWithContext added in v1.0.324

func (c *Client) CreateBotWithContext(ctx context.Context, request *CreateBotRequest) (response *CreateBotResponse, err error)

CreateBot 创建机器人

可能返回的错误码:

INTERNALERROR_CALLMMSFAILED = "InternalError.CallMMSFailed"
INTERNALERROR_MMSINTERNALERROR = "InternalError.MMSInternalError"
INVALIDPARAMETER = "InvalidParameter"

func (*Client) Reset

func (c *Client) Reset(request *ResetRequest) (response *ResetResponse, err error)

Reset 对当前机器人的会话状态进行复位

可能返回的错误码:

INTERNALERROR_ERRORASR = "InternalError.ErrorAsr"
INTERNALERROR_ERRORMMS = "InternalError.ErrorMms"
INTERNALERROR_ERRORRPC = "InternalError.ErrorRpc"
INTERNALERROR_ERRORTTS = "InternalError.ErrorTts"
INTERNALERROR_NOAPPPRIVILEGE = "InternalError.NoAppPrivilege"
INVALIDPARAMETER = "InvalidParameter"

func (*Client) ResetWithContext added in v1.0.324

func (c *Client) ResetWithContext(ctx context.Context, request *ResetRequest) (response *ResetResponse, err error)

Reset 对当前机器人的会话状态进行复位

可能返回的错误码:

INTERNALERROR_ERRORASR = "InternalError.ErrorAsr"
INTERNALERROR_ERRORMMS = "InternalError.ErrorMms"
INTERNALERROR_ERRORRPC = "InternalError.ErrorRpc"
INTERNALERROR_ERRORTTS = "InternalError.ErrorTts"
INTERNALERROR_NOAPPPRIVILEGE = "InternalError.NoAppPrivilege"
INVALIDPARAMETER = "InvalidParameter"

func (*Client) TextProcess

func (c *Client) TextProcess(request *TextProcessRequest) (response *TextProcessResponse, err error)

TextProcess 接收调用侧的文本输入,返回应答文本。已废弃,推荐使用最新版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 接收调用侧的文本输入,返回应答文本。已废弃,推荐使用最新版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 会话重置接口。已废弃,推荐使用最新版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 会话重置接口。已废弃,推荐使用最新版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 CreateBotRequest

type CreateBotRequest struct {
	*tchttp.BaseRequest

	// 机器人名称
	BotName *string `json:"BotName,omitnil,omitempty" name:"BotName"`

	// 机器人中文名称
	BotCnName *string `json:"BotCnName,omitnil,omitempty" name:"BotCnName"`
}

func NewCreateBotRequest

func NewCreateBotRequest() (request *CreateBotRequest)

func (*CreateBotRequest) FromJsonString

func (r *CreateBotRequest) 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 (*CreateBotRequest) ToJsonString

func (r *CreateBotRequest) ToJsonString() string

type CreateBotRequestParams added in v1.0.426

type CreateBotRequestParams struct {
	// 机器人名称
	BotName *string `json:"BotName,omitnil,omitempty" name:"BotName"`

	// 机器人中文名称
	BotCnName *string `json:"BotCnName,omitnil,omitempty" name:"BotCnName"`
}

Predefined struct for user

type CreateBotResponse

type CreateBotResponse struct {
	*tchttp.BaseResponse
	Response *CreateBotResponseParams `json:"Response"`
}

func NewCreateBotResponse

func NewCreateBotResponse() (response *CreateBotResponse)

func (*CreateBotResponse) FromJsonString

func (r *CreateBotResponse) 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 (*CreateBotResponse) ToJsonString

func (r *CreateBotResponse) ToJsonString() string

type CreateBotResponseParams added in v1.0.426

type CreateBotResponseParams struct {
	// 任务ID
	TaskRequestId *string `json:"TaskRequestId,omitnil,omitempty" name:"TaskRequestId"`

	// 任务信息
	Msg *string `json:"Msg,omitnil,omitempty" name:"Msg"`

	// 唯一请求 ID,由服务端生成,每次请求都会返回(若请求因其他原因未能抵达服务端,则该次请求不会获得 RequestId)。定位问题时需要提供该次请求的 RequestId。
	RequestId *string `json:"RequestId,omitnil,omitempty" name:"RequestId"`
}

Predefined struct for user

type Group added in v1.0.672

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 ResetRequest

type ResetRequest struct {
	*tchttp.BaseRequest

	// 机器人标识
	BotId *string `json:"BotId,omitnil,omitempty" name:"BotId"`

	// 子账户id,每个终端对应一个
	UserId *string `json:"UserId,omitnil,omitempty" name:"UserId"`

	// 机器人版本号。BotVersion/BotEnv二选一:二者均填,仅BotVersion有效;二者均不填,默认BotEnv=dev
	BotVersion *string `json:"BotVersion,omitnil,omitempty" name:"BotVersion"`

	// 机器人环境{dev:测试;release:线上}。BotVersion/BotEnv二选一:二者均填,仅BotVersion有效;二者均不填,默认BotEnv=dev
	BotEnv *string `json:"BotEnv,omitnil,omitempty" name:"BotEnv"`
}

func NewResetRequest

func NewResetRequest() (request *ResetRequest)

func (*ResetRequest) FromJsonString

func (r *ResetRequest) 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 (*ResetRequest) ToJsonString

func (r *ResetRequest) ToJsonString() string

type ResetRequestParams added in v1.0.426

type ResetRequestParams struct {
	// 机器人标识
	BotId *string `json:"BotId,omitnil,omitempty" name:"BotId"`

	// 子账户id,每个终端对应一个
	UserId *string `json:"UserId,omitnil,omitempty" name:"UserId"`

	// 机器人版本号。BotVersion/BotEnv二选一:二者均填,仅BotVersion有效;二者均不填,默认BotEnv=dev
	BotVersion *string `json:"BotVersion,omitnil,omitempty" name:"BotVersion"`

	// 机器人环境{dev:测试;release:线上}。BotVersion/BotEnv二选一:二者均填,仅BotVersion有效;二者均不填,默认BotEnv=dev
	BotEnv *string `json:"BotEnv,omitnil,omitempty" name:"BotEnv"`
}

Predefined struct for user

type ResetResponse

type ResetResponse struct {
	*tchttp.BaseResponse
	Response *ResetResponseParams `json:"Response"`
}

func NewResetResponse

func NewResetResponse() (response *ResetResponse)

func (*ResetResponse) FromJsonString

func (r *ResetResponse) 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 (*ResetResponse) ToJsonString

func (r *ResetResponse) ToJsonString() string

type ResetResponseParams added in v1.0.426

type ResetResponseParams struct {
	// 当前会话状态。取值:"start"/"continue"/"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"`

	// 机器人回答
	ResponseText *string `json:"ResponseText,omitnil,omitempty" name:"ResponseText"`

	// 语义解析的槽位结果列表
	// 注意:此字段可能返回 null,表示取不到有效值。
	SlotInfoList []*SlotInfo `json:"SlotInfoList,omitnil,omitempty" name:"SlotInfoList"`

	// 透传字段
	// 注意:此字段可能返回 null,表示取不到有效值。
	SessionAttributes *string `json:"SessionAttributes,omitnil,omitempty" name:"SessionAttributes"`

	// 用户说法。该说法是用户原生说法或ASR识别结果,未经过语义优化
	// 注意:此字段可能返回 null,表示取不到有效值。
	Question *string `json:"Question,omitnil,omitempty" name:"Question"`

	// tts合成pcm音频存储链接。仅当请求参数NeedTts=true时返回
	// 注意:此字段可能返回 null,表示取不到有效值。
	WaveUrl *string `json:"WaveUrl,omitnil,omitempty" name:"WaveUrl"`

	// tts合成的pcm音频。二进制数组经过base64编码(暂时不返回)
	// 注意:此字段可能返回 null,表示取不到有效值。
	WaveData *string `json:"WaveData,omitnil,omitempty" name:"WaveData"`

	// 唯一请求 ID,由服务端生成,每次请求都会返回(若请求因其他原因未能抵达服务端,则该次请求不会获得 RequestId)。定位问题时需要提供该次请求的 RequestId。
	RequestId *string `json:"RequestId,omitnil,omitempty" name:"RequestId"`
}

Predefined struct for user

type ResponseMessage added in v1.0.672

type ResponseMessage struct {
	// 消息组列表。
	// 注意:此字段可能返回 null,表示取不到有效值。
	GroupList []*Group `json:"GroupList,omitnil,omitempty" name:"GroupList"`
}

type SlotInfo

type SlotInfo struct {
	// 槽位名称
	// 注意:此字段可能返回 null,表示取不到有效值。
	SlotName *string `json:"SlotName,omitnil,omitempty" name:"SlotName"`

	// 槽位值
	// 注意:此字段可能返回 null,表示取不到有效值。
	SlotValue *string `json:"SlotValue,omitnil,omitempty" name:"SlotValue"`
}

type TextProcessRequest

type TextProcessRequest struct {
	*tchttp.BaseRequest

	// 机器人标识,用于定义抽象机器人。
	BotId *string `json:"BotId,omitnil,omitempty" name:"BotId"`

	// 终端标识,每个终端(或线程)对应一个,区分并发多用户。
	TerminalId *string `json:"TerminalId,omitnil,omitempty" name:"TerminalId"`

	// 请求的文本。
	InputText *string `json:"InputText,omitnil,omitempty" name:"InputText"`

	// 机器人版本,取值"dev"或"release",{调试版本:dev;线上版本:release}。
	BotEnv *string `json:"BotEnv,omitnil,omitempty" name:"BotEnv"`

	// 透传字段,透传给用户自定义的WebService服务。
	SessionAttributes *string `json:"SessionAttributes,omitnil,omitempty" name:"SessionAttributes"`
}

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"`

	// 终端标识,每个终端(或线程)对应一个,区分并发多用户。
	TerminalId *string `json:"TerminalId,omitnil,omitempty" name:"TerminalId"`

	// 请求的文本。
	InputText *string `json:"InputText,omitnil,omitempty" name:"InputText"`

	// 机器人版本,取值"dev"或"release",{调试版本:dev;线上版本:release}。
	BotEnv *string `json:"BotEnv,omitnil,omitempty" name:"BotEnv"`

	// 透传字段,透传给用户自定义的WebService服务。
	SessionAttributes *string `json:"SessionAttributes,omitnil,omitempty" name:"SessionAttributes"`
}

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"`

	// 透传字段,由用户自定义的WebService服务返回。
	// 注意:此字段可能返回 null,表示取不到有效值。
	SessionAttributes *string `json:"SessionAttributes,omitnil,omitempty" name:"SessionAttributes"`

	// 机器人对话的应答文本。
	// 注意:此字段可能返回 null,表示取不到有效值。
	ResponseText *string `json:"ResponseText,omitnil,omitempty" name:"ResponseText"`

	// 结果类型 {中间逻辑出错:0; 任务型机器人:1; 问答型机器人:2; 闲聊型机器人:3; 未匹配上,返回预设兜底话术:5; 未匹配上,返回相似问题列表:6}。
	// 注意:此字段可能返回 null,表示取不到有效值。
	ResultType *string `json:"ResultType,omitnil,omitempty" name:"ResultType"`

	// 机器人应答。
	// 注意:此字段可能返回 null,表示取不到有效值。
	ResponseMessage *ResponseMessage `json:"ResponseMessage,omitnil,omitempty" name:"ResponseMessage"`

	// 唯一请求 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"`

	// 终端标识,每个终端(或线程)对应一个,区分并发多用户。
	TerminalId *string `json:"TerminalId,omitnil,omitempty" name:"TerminalId"`

	// 机器人版本,取值"dev"或"release",{调试版本:dev;线上版本:release}。
	BotEnv *string `json:"BotEnv,omitnil,omitempty" name:"BotEnv"`
}

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"`

	// 终端标识,每个终端(或线程)对应一个,区分并发多用户。
	TerminalId *string `json:"TerminalId,omitnil,omitempty" name:"TerminalId"`

	// 机器人版本,取值"dev"或"release",{调试版本:dev;线上版本:release}。
	BotEnv *string `json:"BotEnv,omitnil,omitempty" name:"BotEnv"`
}

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"`

	// 透传字段,由用户自定义的WebService服务返回。
	// 注意:此字段可能返回 null,表示取不到有效值。
	SessionAttributes *string `json:"SessionAttributes,omitnil,omitempty" name:"SessionAttributes"`

	// 机器人对话的应答文本。
	// 注意:此字段可能返回 null,表示取不到有效值。
	ResponseText *string `json:"ResponseText,omitnil,omitempty" name:"ResponseText"`

	// 唯一请求 ID,由服务端生成,每次请求都会返回(若请求因其他原因未能抵达服务端,则该次请求不会获得 RequestId)。定位问题时需要提供该次请求的 RequestId。
	RequestId *string `json:"RequestId,omitnil,omitempty" name:"RequestId"`
}

Predefined struct for user

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL