1 Star 40 Fork 9

tencentcloud/tencentcloud-sdk-java

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
TmsClient.java 4.68 KB
一键复制 编辑 原始数据 按行查看 历史
tencentcloud 提交于 2024-04-29 04:29 . release 3.1.1010
/*
* Copyright (c) 2017-2018 THL A29 Limited, a Tencent company. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.tencentcloudapi.tms.v20201229;
import java.lang.reflect.Type;
import com.google.gson.JsonSyntaxException;
import com.google.gson.reflect.TypeToken;
import com.tencentcloudapi.common.exception.TencentCloudSDKException;
import com.tencentcloudapi.common.AbstractClient;
import com.tencentcloudapi.common.profile.ClientProfile;
import com.tencentcloudapi.common.JsonResponseModel;
import com.tencentcloudapi.common.Credential;
import com.tencentcloudapi.tms.v20201229.models.*;
public class TmsClient extends AbstractClient{
private static String endpoint = "tms.tencentcloudapi.com";
private static String service = "tms";
private static String version = "2020-12-29";
public TmsClient(Credential credential, String region) {
this(credential, region, new ClientProfile());
}
public TmsClient(Credential credential, String region, ClientProfile profile) {
super(TmsClient.endpoint, TmsClient.version, credential, region, profile);
}
/**
*"AIGC代答"产品帮助客户在其AIGC场景下,对于敏感类的问题,不是由客户的大模型机器人来回答,而是我们来进行代答,尽最大可能帮助客户规避风险。
* @param req AnswerQuestionRequest
* @return AnswerQuestionResponse
* @throws TencentCloudSDKException
*/
public AnswerQuestionResponse AnswerQuestion(AnswerQuestionRequest req) throws TencentCloudSDKException{
req.setSkipSign(false);
return this.internalRequest(req, "AnswerQuestion", AnswerQuestionResponse.class);
}
/**
*天御文本内容安全定制标签文本审核接口为定制接口,会按照客户定制标签输出审核结果,如需使用请联系商务经理或[在线客服](https://cloud.tencent.com/online-service?from=doc_1125)咨询。
* @param req ModerateTextRequest
* @return ModerateTextResponse
* @throws TencentCloudSDKException
*/
public ModerateTextResponse ModerateText(ModerateTextRequest req) throws TencentCloudSDKException{
req.setSkipSign(false);
return this.internalRequest(req, "ModerateText", ModerateTextResponse.class);
}
/**
*本接口(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次/秒**,超过该频率限制则接口会报错。
* @param req TextModerationRequest
* @return TextModerationResponse
* @throws TencentCloudSDKException
*/
public TextModerationResponse TextModeration(TextModerationRequest req) throws TencentCloudSDKException{
req.setSkipSign(false);
return this.internalRequest(req, "TextModeration", TextModerationResponse.class);
}
}
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/tencentcloud/tencentcloud-sdk-java.git
git@gitee.com:tencentcloud/tencentcloud-sdk-java.git
tencentcloud
tencentcloud-sdk-java
tencentcloud-sdk-java
master

搜索帮助

344bd9b3 5694891 D2dac590 5694891