v20201229

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: 1

Documentation

Index

Constants

View Source
const (

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

	// 请求超时。
	INTERNALERROR_ERRTEXTTIMEOUT = "InternalError.ErrTextTimeOut"

	// 错误的action。
	INVALIDPARAMETER_ERRACTION = "InvalidParameter.ErrAction"

	// 请求的文本长度过长。
	INVALIDPARAMETER_ERRTEXTCONTENTLEN = "InvalidParameter.ErrTextContentLen"

	// 文本类型错误,需要base64的文本。
	INVALIDPARAMETER_ERRTEXTCONTENTTYPE = "InvalidParameter.ErrTextContentType"

	// Question参数错误
	INVALIDPARAMETER_INVALIDQUESTION = "InvalidParameter.InvalidQuestion"

	// InvalidParameter.ParameterError
	INVALIDPARAMETER_PARAMETERERROR = "InvalidParameter.ParameterError"

	// FileContent不可用,传入的Base64编码无法转换成标准utf8内容。
	INVALIDPARAMETERVALUE_ERRFILECONTENT = "InvalidParameterValue.ErrFileContent"

	// 请求的文本长度超过限制。
	INVALIDPARAMETERVALUE_ERRTEXTCONTENTLEN = "InvalidParameterValue.ErrTextContentLen"

	// 请求的文本格式错误(需要base64编码格式的文本)。
	INVALIDPARAMETERVALUE_ERRTEXTCONTENTTYPE = "InvalidParameterValue.ErrTextContentType"

	// 未开通权限/无有效套餐包/账号已欠费。
	UNAUTHORIZEDOPERATION_UNAUTHORIZED = "UnauthorizedOperation.Unauthorized"
)
View Source
const APIVersion = "2020-12-29"

Variables

This section is empty.

Functions

This section is empty.

Types

type AnswerQuestionRequest added in v1.0.912

type AnswerQuestionRequest struct {
	*tchttp.BaseRequest

	// 用户问题
	Question *string `json:"Question,omitnil,omitempty" name:"Question"`
}

func NewAnswerQuestionRequest added in v1.0.912

func NewAnswerQuestionRequest() (request *AnswerQuestionRequest)

func (*AnswerQuestionRequest) FromJsonString added in v1.0.912

func (r *AnswerQuestionRequest) 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 (*AnswerQuestionRequest) ToJsonString added in v1.0.912

func (r *AnswerQuestionRequest) ToJsonString() string

type AnswerQuestionRequestParams added in v1.0.912

type AnswerQuestionRequestParams struct {
	// 用户问题
	Question *string `json:"Question,omitnil,omitempty" name:"Question"`
}

Predefined struct for user

type AnswerQuestionResponse added in v1.0.912

type AnswerQuestionResponse struct {
	*tchttp.BaseResponse
	Response *AnswerQuestionResponseParams `json:"Response"`
}

func NewAnswerQuestionResponse added in v1.0.912

func NewAnswerQuestionResponse() (response *AnswerQuestionResponse)

func (*AnswerQuestionResponse) FromJsonString added in v1.0.912

func (r *AnswerQuestionResponse) 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 (*AnswerQuestionResponse) ToJsonString added in v1.0.912

func (r *AnswerQuestionResponse) ToJsonString() string

type AnswerQuestionResponseParams added in v1.0.912

type AnswerQuestionResponseParams struct {
	// 匹配到的答案
	Answer *string `json:"Answer,omitnil,omitempty" name:"Answer"`

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

Predefined struct for user

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) AnswerQuestion added in v1.0.912

func (c *Client) AnswerQuestion(request *AnswerQuestionRequest) (response *AnswerQuestionResponse, err error)

AnswerQuestion "AIGC代答"产品帮助客户在其AIGC场景下,对于敏感类的问题,不是由客户的大模型机器人来回答,而是我们来进行代答,尽最大可能帮助客户规避风险。

可能返回的错误码:

INTERNALERROR = "InternalError"
INVALIDPARAMETER_INVALIDQUESTION = "InvalidParameter.InvalidQuestion"
UNAUTHORIZEDOPERATION_UNAUTHORIZED = "UnauthorizedOperation.Unauthorized"

func (*Client) AnswerQuestionWithContext added in v1.0.912

func (c *Client) AnswerQuestionWithContext(ctx context.Context, request *AnswerQuestionRequest) (response *AnswerQuestionResponse, err error)

AnswerQuestion "AIGC代答"产品帮助客户在其AIGC场景下,对于敏感类的问题,不是由客户的大模型机器人来回答,而是我们来进行代答,尽最大可能帮助客户规避风险。

可能返回的错误码:

INTERNALERROR = "InternalError"
INVALIDPARAMETER_INVALIDQUESTION = "InvalidParameter.InvalidQuestion"
UNAUTHORIZEDOPERATION_UNAUTHORIZED = "UnauthorizedOperation.Unauthorized"

func (*Client) ModerateText added in v1.0.830

func (c *Client) ModerateText(request *ModerateTextRequest) (response *ModerateTextResponse, err error)

ModerateText 天御文本内容安全定制标签文本审核接口为定制接口,会按照客户定制标签输出审核结果,如需使用请联系商务经理或[在线客服](https://cloud.tencent.com/online-service?from=doc_1125)咨询。

可能返回的错误码:

INTERNALERROR = "InternalError"
INVALIDPARAMETER_INVALIDQUESTION = "InvalidParameter.InvalidQuestion"
UNAUTHORIZEDOPERATION_UNAUTHORIZED = "UnauthorizedOperation.Unauthorized"

func (*Client) ModerateTextWithContext added in v1.0.830

func (c *Client) ModerateTextWithContext(ctx context.Context, request *ModerateTextRequest) (response *ModerateTextResponse, err error)

ModerateText 天御文本内容安全定制标签文本审核接口为定制接口,会按照客户定制标签输出审核结果,如需使用请联系商务经理或[在线客服](https://cloud.tencent.com/online-service?from=doc_1125)咨询。

可能返回的错误码:

INTERNALERROR = "InternalError"
INVALIDPARAMETER_INVALIDQUESTION = "InvalidParameter.InvalidQuestion"
UNAUTHORIZEDOPERATION_UNAUTHORIZED = "UnauthorizedOperation.Unauthorized"

func (*Client) TextModeration

func (c *Client) TextModeration(request *TextModerationRequest) (response *TextModerationResponse, err error)

TextModeration 本接口(Text Moderation)用于提交文本内容进行智能审核任务。使用前请您使用腾讯云主账号登录控制台 [开通文本内容安全服务](https://console.cloud.tencent.com/cms) 并调整好对应的业务配置。

### 接口使用说明

- 前往“[内容安全控制台-文本内容安全](https://console.cloud.tencent.com/cms)”开启使用文本内容安全服务,首次开通服务的用户可免费领用试用套餐包,包含**3000条**文本识别额度,有效期为15天。

- 该接口为收费接口,计费方式敬请参见 [腾讯云文本内容安全定价](https://cloud.tencent.com/product/tms/pricing)。

### 接口功能说明:

- 支持对文本文件进行检测,通过深度学习技术,识别可能令人反感、不安全或不适宜的违规文本内容;

- 支持识别多种违规场景,包括:低俗、谩骂、色情、广告等场景;

- 支持根据不同的业务场景配置自定义的审核策略,可在控制台文本内容安全-策略管理中配置;

- 支持用户自定义配置词库黑白名单,打击自定义识别类型的违规文本(目前仅支持黑名单配置);

- 支持在审核文本内容时同时关联账号或设备信息,可识别违规风险账号或设备。

### 接口调用说明:

- 文本内容大小支持:文本原文长度不能超过unicode编码长度10000个字符;

- 文本审核语言支持:目前支持中文、英文、阿拉伯数字的检测;

- 默认接口请求频率限制:**1000次/秒**,超过该频率限制则接口会报错。

可能返回的错误码:

INTERNALERROR_ERRTEXTTIMEOUT = "InternalError.ErrTextTimeOut"
INVALIDPARAMETER_ERRACTION = "InvalidParameter.ErrAction"
INVALIDPARAMETER_ERRTEXTCONTENTLEN = "InvalidParameter.ErrTextContentLen"
INVALIDPARAMETER_ERRTEXTCONTENTTYPE = "InvalidParameter.ErrTextContentType"
INVALIDPARAMETER_PARAMETERERROR = "InvalidParameter.ParameterError"
INVALIDPARAMETERVALUE_ERRFILECONTENT = "InvalidParameterValue.ErrFileContent"
INVALIDPARAMETERVALUE_ERRTEXTCONTENTLEN = "InvalidParameterValue.ErrTextContentLen"
INVALIDPARAMETERVALUE_ERRTEXTCONTENTTYPE = "InvalidParameterValue.ErrTextContentType"
UNAUTHORIZEDOPERATION_UNAUTHORIZED = "UnauthorizedOperation.Unauthorized"

func (*Client) TextModerationWithContext added in v1.0.324

func (c *Client) TextModerationWithContext(ctx context.Context, request *TextModerationRequest) (response *TextModerationResponse, err error)

TextModeration 本接口(Text Moderation)用于提交文本内容进行智能审核任务。使用前请您使用腾讯云主账号登录控制台 [开通文本内容安全服务](https://console.cloud.tencent.com/cms) 并调整好对应的业务配置。

### 接口使用说明

- 前往“[内容安全控制台-文本内容安全](https://console.cloud.tencent.com/cms)”开启使用文本内容安全服务,首次开通服务的用户可免费领用试用套餐包,包含**3000条**文本识别额度,有效期为15天。

- 该接口为收费接口,计费方式敬请参见 [腾讯云文本内容安全定价](https://cloud.tencent.com/product/tms/pricing)。

### 接口功能说明:

- 支持对文本文件进行检测,通过深度学习技术,识别可能令人反感、不安全或不适宜的违规文本内容;

- 支持识别多种违规场景,包括:低俗、谩骂、色情、广告等场景;

- 支持根据不同的业务场景配置自定义的审核策略,可在控制台文本内容安全-策略管理中配置;

- 支持用户自定义配置词库黑白名单,打击自定义识别类型的违规文本(目前仅支持黑名单配置);

- 支持在审核文本内容时同时关联账号或设备信息,可识别违规风险账号或设备。

### 接口调用说明:

- 文本内容大小支持:文本原文长度不能超过unicode编码长度10000个字符;

- 文本审核语言支持:目前支持中文、英文、阿拉伯数字的检测;

- 默认接口请求频率限制:**1000次/秒**,超过该频率限制则接口会报错。

可能返回的错误码:

INTERNALERROR_ERRTEXTTIMEOUT = "InternalError.ErrTextTimeOut"
INVALIDPARAMETER_ERRACTION = "InvalidParameter.ErrAction"
INVALIDPARAMETER_ERRTEXTCONTENTLEN = "InvalidParameter.ErrTextContentLen"
INVALIDPARAMETER_ERRTEXTCONTENTTYPE = "InvalidParameter.ErrTextContentType"
INVALIDPARAMETER_PARAMETERERROR = "InvalidParameter.ParameterError"
INVALIDPARAMETERVALUE_ERRFILECONTENT = "InvalidParameterValue.ErrFileContent"
INVALIDPARAMETERVALUE_ERRTEXTCONTENTLEN = "InvalidParameterValue.ErrTextContentLen"
INVALIDPARAMETERVALUE_ERRTEXTCONTENTTYPE = "InvalidParameterValue.ErrTextContentType"
UNAUTHORIZEDOPERATION_UNAUTHORIZED = "UnauthorizedOperation.Unauthorized"

type DetailResults

type DetailResults struct {
	// 该字段用于返回检测结果所对应的全部恶意标签。<br>返回值:**Normal**:正常,**Porn**:色情,**Abuse**:谩骂,**Ad**:广告;以及其他令人反感、不安全或不适宜的内容类型。
	Label *string `json:"Label,omitnil,omitempty" name:"Label"`

	// 该字段用于返回对应当前标签的后续操作建议。当您获取到判定结果后,返回值表示系统推荐的后续操作;建议您按照业务所需,对不同违规类型与建议值进行处理。<br>返回值:**Block**:建议屏蔽,**Review** :建议人工复审,**Pass**:建议通过
	// 注意:此字段可能返回 null,表示取不到有效值。
	Suggestion *string `json:"Suggestion,omitnil,omitempty" name:"Suggestion"`

	// 该字段用于返回检测文本命中的关键词信息,用于标注文本违规的具体原因(如:*加我微信*)。该参数可能会有多个返回值,代表命中的多个关键词;如返回值为空且Score不为空,则代表识别结果所对应的恶意标签(Label)是来自于语义模型判断的返回值。
	// 注意:此字段可能返回 null,表示取不到有效值。
	Keywords []*string `json:"Keywords,omitnil,omitempty" name:"Keywords"`

	// 该字段用于返回当前标签(Label)下的置信度,取值范围:0(**置信度最低**)-100(**置信度最高** ),越高代表文本越有可能属于当前返回的标签;如:*色情 99*,则表明该文本非常有可能属于色情内容;*色情 0*,则表明该文本不属于色情内容。
	// 注意:此字段可能返回 null,表示取不到有效值。
	Score *int64 `json:"Score,omitnil,omitempty" name:"Score"`

	// 该字段用于返回自定义关键词对应的词库类型,取值为**1**(黑白库)和**2**(自定义关键词库),若未配置自定义关键词库,则默认值为1(黑白库匹配)。
	// 注意:此字段可能返回 null,表示取不到有效值。
	LibType *int64 `json:"LibType,omitnil,omitempty" name:"LibType"`

	// 该字段用于返回自定义库的ID,以方便自定义库管理和配置。
	// 注意:此字段可能返回 null,表示取不到有效值。
	LibId *string `json:"LibId,omitnil,omitempty" name:"LibId"`

	// 该字段用于返回自定义库的名称,以方便自定义库管理和配置。
	// 注意:此字段可能返回 null,表示取不到有效值。
	LibName *string `json:"LibName,omitnil,omitempty" name:"LibName"`

	// 该字段用于返回当前标签(Label)下的二级标签。
	// 注意:此字段可能返回 null,表示取不到有效值。
	SubLabel *string `json:"SubLabel,omitnil,omitempty" name:"SubLabel"`

	// 该字段用于返回当前一级标签(Label)下的关键词、子标签及分数。
	// 注意:此字段可能返回 null,表示取不到有效值。
	Tags []*Tag `json:"Tags,omitnil,omitempty" name:"Tags"`

	// 该字段用于返回违规文本命中信息
	// 注意:此字段可能返回 null,表示取不到有效值。
	HitInfos []*HitInfo `json:"HitInfos,omitnil,omitempty" name:"HitInfos"`
}

type Device

type Device struct {
	// 该字段表示业务用户对应设备的IP地址。<br>
	// 备注:目前仅支持IPv4地址记录,不支持IPv6地址记录。
	IP *string `json:"IP,omitnil,omitempty" name:"IP"`

	// 该字段表示业务用户对应的MAC地址,以方便设备识别与管理;其格式与取值与标准MAC地址一致。
	Mac *string `json:"Mac,omitnil,omitempty" name:"Mac"`

	// *内测中,敬请期待。*
	TokenId *string `json:"TokenId,omitnil,omitempty" name:"TokenId"`

	// *内测中,敬请期待。*
	DeviceId *string `json:"DeviceId,omitnil,omitempty" name:"DeviceId"`

	// 该字段表示业务用户对应设备的**IMEI码**(国际移动设备识别码),该识别码可用于识别每一部独立的手机等移动通信设备,方便设备识别与管理。<br>备注:格式为**15-17位纯数字**。
	IMEI *string `json:"IMEI,omitnil,omitempty" name:"IMEI"`

	// **iOS设备专用**,该字段表示业务用户对应的**IDFA**(广告标识符),这是由苹果公司提供的用于标识用户的广告标识符,由一串16进制的32位数字和字母组成。<br>
	// 备注:苹果公司自2021年iOS14更新后允许用户手动关闭或者开启IDFA,故此字符串标记有效性可能有所降低。
	IDFA *string `json:"IDFA,omitnil,omitempty" name:"IDFA"`

	// **iOS设备专用**,该字段表示业务用户对应的**IDFV**(应用开发商标识符),这是由苹果公司提供的用于标注应用开发商的标识符,由一串16进制的32位数字和字母组成,可被用于唯一标识设备。
	IDFV *string `json:"IDFV,omitnil,omitempty" name:"IDFV"`
}

type HitInfo added in v1.0.773

type HitInfo struct {
	// 标识模型命中还是关键词命中
	// 注意:此字段可能返回 null,表示取不到有效值。
	Type *string `json:"Type,omitnil,omitempty" name:"Type"`

	// 命中关键词
	// 注意:此字段可能返回 null,表示取不到有效值。
	Keyword *string `json:"Keyword,omitnil,omitempty" name:"Keyword"`

	// 自定义词库名称
	// 注意:此字段可能返回 null,表示取不到有效值。
	LibName *string `json:"LibName,omitnil,omitempty" name:"LibName"`

	// 位置信息
	// 注意:此字段可能返回 null,表示取不到有效值。
	Positions []*Positions `json:"Positions,omitnil,omitempty" name:"Positions"`
}

type LabelGrade added in v1.0.830

type LabelGrade struct {
	// 内容审核结果客户定制标签码
	// 注意:此字段可能返回 null,表示取不到有效值。
	Code *string `json:"Code,omitnil,omitempty" name:"Code"`

	// 内容审核结果客户定制一级标签
	// 注意:此字段可能返回 null,表示取不到有效值。
	Grade1 *string `json:"Grade1,omitnil,omitempty" name:"Grade1"`

	// 内容审核结果客户定制二级标签
	// 注意:此字段可能返回 null,表示取不到有效值。
	Grade2 *string `json:"Grade2,omitnil,omitempty" name:"Grade2"`

	// 内容审核结果客户定制三级标签
	// 注意:此字段可能返回 null,表示取不到有效值。
	Grade3 *string `json:"Grade3,omitnil,omitempty" name:"Grade3"`
}

type LibCheckResult added in v1.0.830

type LibCheckResult struct {
	// 库ID
	// 注意:此字段可能返回 null,表示取不到有效值。
	LibId *string `json:"LibId,omitnil,omitempty" name:"LibId"`

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

	// 库类型
	// 注意:此字段可能返回 null,表示取不到有效值。
	LibType *uint64 `json:"LibType,omitnil,omitempty" name:"LibType"`

	// 命中的关键词
	// 注意:此字段可能返回 null,表示取不到有效值。
	Keyword *string `json:"Keyword,omitnil,omitempty" name:"Keyword"`

	// 命中的关键词在送审文本的位置,可能存在多个位置,每个位置显示开始位置和结束位置
	// 注意:此字段可能返回 null,表示取不到有效值。
	Positions []*Positions `json:"Positions,omitnil,omitempty" name:"Positions"`
}

type ModelResult added in v1.0.830

type ModelResult struct {
	// 模型检测出的违规内容
	// 注意:此字段可能返回 null,表示取不到有效值。
	Content *string `json:"Content,omitnil,omitempty" name:"Content"`

	// 模型检测出的违规内容的位置
	// 注意:此字段可能返回 null,表示取不到有效值。
	Positions []*Positions `json:"Positions,omitnil,omitempty" name:"Positions"`
}

type ModerateTextRequest added in v1.0.830

type ModerateTextRequest struct {
	*tchttp.BaseRequest

	// 该字段表示待检测对象的文本内容,文本需要按utf-8格式编码,长度不能超过10000个字符(按unicode编码计算),并进行 Base64加密
	Content *string `json:"Content,omitnil,omitempty" name:"Content"`

	// 该字段表示策略的具体编号,用于接口调度,在内容安全控制台中可配置。若不传入Biztype参数(留空),则代表采用默认的识别策略;传入则会在审核时根据业务场景采取不同的审核策略。
	// 备注:Biztype仅为数字、字母与下划线的组合,长度为3-32个字符;不同Biztype关联不同的业务场景与识别能力策略,调用前请确认正确的Biztype
	BizType *string `json:"BizType,omitnil,omitempty" name:"BizType"`

	// 该字段表示您为待检测对象分配的数据ID,传入后可方便您对文件进行标识和管理。
	// 取值:由英文字母(大小写均可)、数字及四个特殊符号(_,-,@,#)组成,长度不超过64个字符
	DataId *string `json:"DataId,omitnil,omitempty" name:"DataId"`

	// 该字段表示待检测对象对应的用户相关信息,传入后可便于甄别相应违规风险用户
	User *User `json:"User,omitnil,omitempty" name:"User"`

	// 该字段表示待检测对象对应的设备相关信息,传入后可便于甄别相应违规风险设备
	Device *Device `json:"Device,omitnil,omitempty" name:"Device"`
}

func NewModerateTextRequest added in v1.0.830

func NewModerateTextRequest() (request *ModerateTextRequest)

func (*ModerateTextRequest) FromJsonString added in v1.0.830

func (r *ModerateTextRequest) 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 (*ModerateTextRequest) ToJsonString added in v1.0.830

func (r *ModerateTextRequest) ToJsonString() string

type ModerateTextRequestParams added in v1.0.830

type ModerateTextRequestParams struct {
	// 该字段表示待检测对象的文本内容,文本需要按utf-8格式编码,长度不能超过10000个字符(按unicode编码计算),并进行 Base64加密
	Content *string `json:"Content,omitnil,omitempty" name:"Content"`

	// 该字段表示策略的具体编号,用于接口调度,在内容安全控制台中可配置。若不传入Biztype参数(留空),则代表采用默认的识别策略;传入则会在审核时根据业务场景采取不同的审核策略。
	// 备注:Biztype仅为数字、字母与下划线的组合,长度为3-32个字符;不同Biztype关联不同的业务场景与识别能力策略,调用前请确认正确的Biztype
	BizType *string `json:"BizType,omitnil,omitempty" name:"BizType"`

	// 该字段表示您为待检测对象分配的数据ID,传入后可方便您对文件进行标识和管理。
	// 取值:由英文字母(大小写均可)、数字及四个特殊符号(_,-,@,#)组成,长度不超过64个字符
	DataId *string `json:"DataId,omitnil,omitempty" name:"DataId"`

	// 该字段表示待检测对象对应的用户相关信息,传入后可便于甄别相应违规风险用户
	User *User `json:"User,omitnil,omitempty" name:"User"`

	// 该字段表示待检测对象对应的设备相关信息,传入后可便于甄别相应违规风险设备
	Device *Device `json:"Device,omitnil,omitempty" name:"Device"`
}

Predefined struct for user

type ModerateTextResponse added in v1.0.830

type ModerateTextResponse struct {
	*tchttp.BaseResponse
	Response *ModerateTextResponseParams `json:"Response"`
}

func NewModerateTextResponse added in v1.0.830

func NewModerateTextResponse() (response *ModerateTextResponse)

func (*ModerateTextResponse) FromJsonString added in v1.0.830

func (r *ModerateTextResponse) 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 (*ModerateTextResponse) ToJsonString added in v1.0.830

func (r *ModerateTextResponse) ToJsonString() string

type ModerateTextResponseParams added in v1.0.830

type ModerateTextResponseParams struct {
	// 该字段用于返回检测对象对应请求参数中的DataId,与输入的DataId字段中的内容对应
	DataId *string `json:"DataId,omitnil,omitempty" name:"DataId"`

	// 该字段用于返回请求参数中的BizType参数
	BizType *string `json:"BizType,omitnil,omitempty" name:"BizType"`

	// 该字段用于返回后续操作建议。当您获取到判定结果后,返回值表示系统推荐的后续操作;建议您按照业务所需,对不同违规类型与建议值进行处理。
	// 返回值:Block:建议屏蔽,Review :建议人工复审,Pass:建议通过
	Suggestion *string `json:"Suggestion,omitnil,omitempty" name:"Suggestion"`

	// 命中标签,可参阅对应数据结构(LabelGrade)的详细描述
	Label *LabelGrade `json:"Label,omitnil,omitempty" name:"Label"`

	// 命中标签对应腾讯侧定义的标签
	TcLabelCodes []*string `json:"TcLabelCodes,omitnil,omitempty" name:"TcLabelCodes"`

	// 该字段用于返回当前标签(Label)下被检测文本命中的关键词信息,用于标注文本违规的具体原因(如:加我微信)。该参数可能会有多个返回值,代表命中的多个关键词;如返回值为空且Score不为空,则代表识别结果所对应的恶意标签(Label)是来自于语义模型判断的返回值
	Keywords []*string `json:"Keywords,omitnil,omitempty" name:"Keywords"`

	// 该字段用于返回文本审核的详细结果,返回值信息可参阅对应数据结构(ModerationDetail)的详细描述
	ModerationDetails []*ModerationDetail `json:"ModerationDetails,omitnil,omitempty" name:"ModerationDetails"`

	// 该字段用于返回审核结果置信度,使用百分制。分数越高表示结果可信度越高。
	Score *uint64 `json:"Score,omitnil,omitempty" name:"Score"`

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

Predefined struct for user

type ModerationDetail added in v1.0.830

type ModerationDetail struct {
	// 审核建议,Block表示建议拦截,Review表示建议人工复审,Pass表示建议放行
	// 注意:此字段可能返回 null,表示取不到有效值。
	Suggestion *string `json:"Suggestion,omitnil,omitempty" name:"Suggestion"`

	// 命中标签,含标签码和一二三级标签名
	// 注意:此字段可能返回 null,表示取不到有效值。
	Label *LabelGrade `json:"Label,omitnil,omitempty" name:"Label"`

	// 标签得分
	// 注意:此字段可能返回 null,表示取不到有效值。
	Score *uint64 `json:"Score,omitnil,omitempty" name:"Score"`

	// label对应腾讯侧命中标签码
	// 注意:此字段可能返回 null,表示取不到有效值。
	TcLabelCodes []*string `json:"TcLabelCodes,omitnil,omitempty" name:"TcLabelCodes"`

	// 库检测命中详情
	// 注意:此字段可能返回 null,表示取不到有效值。
	LibResults []*LibCheckResult `json:"LibResults,omitnil,omitempty" name:"LibResults"`

	// 模型检测详情
	// 注意:此字段可能返回 null,表示取不到有效值。
	ModelResults []*ModelResult `json:"ModelResults,omitnil,omitempty" name:"ModelResults"`

	// 情绪正负向检测结果
	// 注意:此字段可能返回 null,表示取不到有效值。
	SentimentResult *SentimentDetail `json:"SentimentResult,omitnil,omitempty" name:"SentimentResult"`
}

type Positions added in v1.0.773

type Positions struct {
	// 关键词起始位置
	// 注意:此字段可能返回 null,表示取不到有效值。
	Start *int64 `json:"Start,omitnil,omitempty" name:"Start"`

	// 关键词结束位置
	// 注意:此字段可能返回 null,表示取不到有效值。
	End *int64 `json:"End,omitnil,omitempty" name:"End"`
}

type RiskDetails

type RiskDetails struct {
	// 该字段用于返回账号信息检测对应的风险类别,取值为:**RiskAccount**(账号存在风险)、**RiskIP**(IP地址存在风险)、**RiskIMEI**(移动设备识别码存在风险)。
	Label *string `json:"Label,omitnil,omitempty" name:"Label"`

	// 该字段用于返回账号信息检测对应的风险等级,取值为:**1**(疑似存在风险)和**2**(存在恶意风险)。
	Level *int64 `json:"Level,omitnil,omitempty" name:"Level"`
}

type SentimentAnalysis added in v1.0.805

type SentimentAnalysis struct {
	// 情感标签
	// 注意:此字段可能返回 null,表示取不到有效值。
	Label *string `json:"Label,omitnil,omitempty" name:"Label"`

	// 标签分数,取值范围0到100
	// 注意:此字段可能返回 null,表示取不到有效值。
	Score *int64 `json:"Score,omitnil,omitempty" name:"Score"`

	// 情感分析明细
	// 注意:此字段可能返回 null,表示取不到有效值。
	Detail *SentimentDetail `json:"Detail,omitnil,omitempty" name:"Detail"`

	// 响应码,成功为"OK",失败为"InternalError"
	Code *string `json:"Code,omitnil,omitempty" name:"Code"`

	// 异常信息
	// 注意:此字段可能返回 null,表示取不到有效值。
	Message *string `json:"Message,omitnil,omitempty" name:"Message"`
}

type SentimentDetail added in v1.0.805

type SentimentDetail struct {
	// 正向分数,取值范围0到100
	// 注意:此字段可能返回 null,表示取不到有效值。
	Positive *int64 `json:"Positive,omitnil,omitempty" name:"Positive"`

	// 负向分数,取值范围0到100
	// 注意:此字段可能返回 null,表示取不到有效值。
	Negative *int64 `json:"Negative,omitnil,omitempty" name:"Negative"`
}

type Tag added in v1.0.537

type Tag struct {
	// 该字段用于返回命中的关键词
	// 注意:此字段可能返回 null,表示取不到有效值。
	Keyword *string `json:"Keyword,omitnil,omitempty" name:"Keyword"`

	// 该字段用于返回子标签
	// 注意:此字段可能返回 null,表示取不到有效值。
	SubLabel *string `json:"SubLabel,omitnil,omitempty" name:"SubLabel"`

	// 该字段用于返回子标签对应的分数
	// 注意:此字段可能返回 null,表示取不到有效值。
	Score *int64 `json:"Score,omitnil,omitempty" name:"Score"`
}

type TextModerationRequest

type TextModerationRequest struct {
	*tchttp.BaseRequest

	// 该字段表示待检测对象的文本内容,文本需要按utf-8格式编码,长度不能超过10000个字符(按unicode编码计算),并进行 Base64加密
	Content *string `json:"Content,omitnil,omitempty" name:"Content"`

	// 该字段表示策略的具体编号,用于接口调度,在内容安全控制台中可配置。若不传入Biztype参数(留空),则代表采用默认的识别策略;传入则会在审核时根据业务场景采取不同的审核策略。<br>备注:Biztype仅为数字、字母与下划线的组合,长度为3-32个字符;不同Biztype关联不同的业务场景与识别能力策略,调用前请确认正确的Biztype
	BizType *string `json:"BizType,omitnil,omitempty" name:"BizType"`

	// 该字段表示您为待检测对象分配的数据ID,传入后可方便您对文件进行标识和管理。<br>取值:由英文字母(大小写均可)、数字及四个特殊符号(_,-,@,#)组成,**长度不超过64个字符**
	DataId *string `json:"DataId,omitnil,omitempty" name:"DataId"`

	// 该字段表示待检测对象对应的用户相关信息,传入后可便于甄别相应违规风险用户
	User *User `json:"User,omitnil,omitempty" name:"User"`

	// 该字段表示待检测对象对应的设备相关信息,传入后可便于甄别相应违规风险设备
	Device *Device `json:"Device,omitnil,omitempty" name:"Device"`
}

func NewTextModerationRequest

func NewTextModerationRequest() (request *TextModerationRequest)

func (*TextModerationRequest) FromJsonString

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

func (r *TextModerationRequest) ToJsonString() string

type TextModerationRequestParams added in v1.0.426

type TextModerationRequestParams struct {
	// 该字段表示待检测对象的文本内容,文本需要按utf-8格式编码,长度不能超过10000个字符(按unicode编码计算),并进行 Base64加密
	Content *string `json:"Content,omitnil,omitempty" name:"Content"`

	// 该字段表示策略的具体编号,用于接口调度,在内容安全控制台中可配置。若不传入Biztype参数(留空),则代表采用默认的识别策略;传入则会在审核时根据业务场景采取不同的审核策略。<br>备注:Biztype仅为数字、字母与下划线的组合,长度为3-32个字符;不同Biztype关联不同的业务场景与识别能力策略,调用前请确认正确的Biztype
	BizType *string `json:"BizType,omitnil,omitempty" name:"BizType"`

	// 该字段表示您为待检测对象分配的数据ID,传入后可方便您对文件进行标识和管理。<br>取值:由英文字母(大小写均可)、数字及四个特殊符号(_,-,@,#)组成,**长度不超过64个字符**
	DataId *string `json:"DataId,omitnil,omitempty" name:"DataId"`

	// 该字段表示待检测对象对应的用户相关信息,传入后可便于甄别相应违规风险用户
	User *User `json:"User,omitnil,omitempty" name:"User"`

	// 该字段表示待检测对象对应的设备相关信息,传入后可便于甄别相应违规风险设备
	Device *Device `json:"Device,omitnil,omitempty" name:"Device"`
}

Predefined struct for user

type TextModerationResponse

type TextModerationResponse struct {
	*tchttp.BaseResponse
	Response *TextModerationResponseParams `json:"Response"`
}

func NewTextModerationResponse

func NewTextModerationResponse() (response *TextModerationResponse)

func (*TextModerationResponse) FromJsonString

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

func (r *TextModerationResponse) ToJsonString() string

type TextModerationResponseParams added in v1.0.426

type TextModerationResponseParams struct {
	// 该字段用于返回请求参数中的BizType参数
	BizType *string `json:"BizType,omitnil,omitempty" name:"BizType"`

	// 该字段用于返回检测结果(DetailResults)中所对应的**优先级最高的恶意标签**,表示模型推荐的审核结果,建议您按照业务所需,对不同违规类型与建议值进行处理。<br>返回值:**Normal**:正常,**Porn**:色情,**Abuse**:谩骂,**Ad**:广告,**Custom**:自定义违规;以及其他令人反感、不安全或不适宜的内容类型
	Label *string `json:"Label,omitnil,omitempty" name:"Label"`

	// 该字段用于返回后续操作建议。当您获取到判定结果后,返回值表示系统推荐的后续操作;建议您按照业务所需,对不同违规类型与建议值进行处理。<br>返回值:**Block**:建议屏蔽,**Review** :建议人工复审,**Pass**:建议通过
	Suggestion *string `json:"Suggestion,omitnil,omitempty" name:"Suggestion"`

	// 该字段用于返回当前标签(Label)下被检测文本命中的关键词信息,用于标注文本违规的具体原因(如:*加我微信*)。该参数可能会有多个返回值,代表命中的多个关键词;如返回值为空且Score不为空,则代表识别结果所对应的恶意标签(Label)是来自于语义模型判断的返回值
	// 注意:此字段可能返回 null,表示取不到有效值。
	Keywords []*string `json:"Keywords,omitnil,omitempty" name:"Keywords"`

	// 该字段用于返回当前标签(Label)下的置信度,取值范围:0(**置信度最低**)-100(**置信度最高** ),越高代表文本越有可能属于当前返回的标签;如:*色情 99*,则表明该文本非常有可能属于色情内容;*色情 0*,则表明该文本不属于色情内容
	Score *int64 `json:"Score,omitnil,omitempty" name:"Score"`

	// 该字段用于返回基于文本风险库审核的详细结果,返回值信息可参阅对应数据结构(DetailResults)的详细描述
	// 注意:此字段可能返回 null,表示取不到有效值。
	DetailResults []*DetailResults `json:"DetailResults,omitnil,omitempty" name:"DetailResults"`

	// 该字段用于返回文本检测中存在违规风险的账号检测结果,主要包括违规风险类别和风险等级信息,具体内容可参阅对应数据结构(RiskDetails)的详细描述
	// 注意:此字段可能返回 null,表示取不到有效值。
	RiskDetails []*RiskDetails `json:"RiskDetails,omitnil,omitempty" name:"RiskDetails"`

	// 该字段用于返回根据您的需求配置的额外附加信息(Extra),如未配置则默认返回值为空。<br>备注:不同客户或Biztype下返回信息不同,如需配置该字段请提交工单咨询或联系售后专员处理
	// 注意:此字段可能返回 null,表示取不到有效值。
	Extra *string `json:"Extra,omitnil,omitempty" name:"Extra"`

	// 该字段用于返回检测对象对应请求参数中的DataId,与输入的DataId字段中的内容对应
	// 注意:此字段可能返回 null,表示取不到有效值。
	DataId *string `json:"DataId,omitnil,omitempty" name:"DataId"`

	// 该字段用于返回当前标签(Label)下的二级标签。
	// 注意:此字段可能返回 null,表示取不到有效值。
	SubLabel *string `json:"SubLabel,omitnil,omitempty" name:"SubLabel"`

	// 该字段用于返回上下文关联文本
	// 注意:此字段可能返回 null,表示取不到有效值。
	ContextText *string `json:"ContextText,omitnil,omitempty" name:"ContextText"`

	// 情感分析结果
	// 注意:此字段可能返回 null,表示取不到有效值。
	SentimentAnalysis *SentimentAnalysis `json:"SentimentAnalysis,omitnil,omitempty" name:"SentimentAnalysis"`

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

Predefined struct for user

type User

type User struct {
	// 该字段表示业务用户ID,填写后,系统可根据账号过往违规历史优化审核结果判定,有利于存在可疑违规风险时的辅助判断。<br>
	// 备注:该字段可传入微信openid、QQopenid、字符串等账号信息,与账号类别参数(AccountType)配合使用可确定唯一账号。
	UserId *string `json:"UserId,omitnil,omitempty" name:"UserId"`

	// 该字段表示业务用户对应的账号昵称信息。
	Nickname *string `json:"Nickname,omitnil,omitempty" name:"Nickname"`

	// 该字段表示业务用户ID对应的账号类型,取值:**1**-微信uin,**2**-QQ号,**3**-微信群uin,**4**-qq群号,**5**-微信openid,**6**-QQopenid,**7**-其它string。<br>
	// 该字段与账号ID参数(UserId)配合使用可确定唯一账号。
	AccountType *int64 `json:"AccountType,omitnil,omitempty" name:"AccountType"`

	// 该字段表示业务用户对应账号的性别信息。<br>
	// 取值:**0**(默认值,代表性别未知)、**1**(男性)、**2**(女性)。
	Gender *int64 `json:"Gender,omitnil,omitempty" name:"Gender"`

	// 该字段表示业务用户对应账号的年龄信息。<br>
	// 取值:**0**(默认值,代表年龄未知)-(**自定义年龄上限**)之间的整数。
	Age *int64 `json:"Age,omitnil,omitempty" name:"Age"`

	// 该字段表示业务用户对应账号的等级信息。<br>
	// 取值:**0**(默认值,代表等级未知)、**1**(等级较低)、**2**(等级中等)、**3**(等级较高),目前**暂不支持自定义等级**。
	Level *int64 `json:"Level,omitnil,omitempty" name:"Level"`

	// 该字段表示业务用户对应账号的手机号信息,支持全球各地区手机号的记录。<br>
	// 备注:请保持手机号格式的统一,如区号格式(086/+86)等。
	Phone *string `json:"Phone,omitnil,omitempty" name:"Phone"`

	// 该字段表示业务用户头像图片的访问链接(URL),支持PNG、JPG、JPEG、BMP、GIF、WEBP格式。
	// 备注:头像图片大小不超过5MB,建议分辨率不低于256x256;图片下载时间限制为3秒,超过则会返回下载超时。
	HeadUrl *string `json:"HeadUrl,omitnil,omitempty" name:"HeadUrl"`

	// 该字段表示业务用户的简介信息,支持汉字、英文及特殊符号,长度不超过5000个汉字字符。
	Desc *string `json:"Desc,omitnil,omitempty" name:"Desc"`

	// 该字段表示业务群聊场景时的房间ID。
	RoomId *string `json:"RoomId,omitnil,omitempty" name:"RoomId"`

	// 该字段表示消息接受者ID
	ReceiverId *string `json:"ReceiverId,omitnil,omitempty" name:"ReceiverId"`

	// 消息生成时间,精确到毫秒
	SendTime *int64 `json:"SendTime,omitnil,omitempty" name:"SendTime"`
}

Jump to

Keyboard shortcuts

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