tencentcloud-sdk-nodejs-tms 4.1.130 → 4.1.136

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,6 @@
1
- import { v20200713 } from "./v20200713";
2
1
  import { v20201229 } from "./v20201229";
2
+ import { v20200713 } from "./v20200713";
3
3
  export const tms = {
4
- v20200713: v20200713,
5
4
  v20201229: v20201229,
5
+ v20200713: v20200713,
6
6
  };
@@ -3,7 +3,13 @@ export class Client extends TencentCloudCommon.AbstractClient {
3
3
  constructor(clientConfig) {
4
4
  super("tms.tencentcloudapi.com", "2020-12-29", clientConfig);
5
5
  }
6
+ async CreateFinancialLLMTask(req, cb) {
7
+ return this.request("CreateFinancialLLMTask", req, cb);
8
+ }
6
9
  async TextModeration(req, cb) {
7
10
  return this.request("TextModeration", req, cb);
8
11
  }
12
+ async GetFinancialLLMTaskResult(req, cb) {
13
+ return this.request("GetFinancialLLMTaskResult", req, cb);
14
+ }
9
15
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "tencentcloud-sdk-nodejs-tms",
3
- "version": "4.1.130",
3
+ "version": "4.1.136",
4
4
  "description": "腾讯云 API NODEJS SDK",
5
5
  "main": "./tencentcloud/index.js",
6
6
  "module": "./es/index.js",
@@ -1,10 +1,10 @@
1
1
  export declare const tms: {
2
- v20200713: {
3
- Client: typeof import("./v20200713/tms_client").Client;
4
- Models: typeof import("./v20200713/tms_models");
5
- };
6
2
  v20201229: {
7
3
  Client: typeof import("./v20201229/tms_client").Client;
8
4
  Models: typeof import("./v20201229/tms_models");
9
5
  };
6
+ v20200713: {
7
+ Client: typeof import("./v20200713/tms_client").Client;
8
+ Models: typeof import("./v20200713/tms_models");
9
+ };
10
10
  };
@@ -1,9 +1,9 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.tms = void 0;
4
- const v20200713_1 = require("./v20200713");
5
4
  const v20201229_1 = require("./v20201229");
5
+ const v20200713_1 = require("./v20200713");
6
6
  exports.tms = {
7
- v20200713: v20200713_1.v20200713,
8
7
  v20201229: v20201229_1.v20201229,
8
+ v20200713: v20200713_1.v20200713,
9
9
  };
@@ -1,11 +1,15 @@
1
1
  import * as TencentCloudCommon from "tencentcloud-sdk-nodejs-common";
2
- import { TextModerationRequest, TextModerationResponse } from "./tms_models";
2
+ import { GetFinancialLLMTaskResultRequest, GetFinancialLLMTaskResultResponse, TextModerationRequest, CreateFinancialLLMTaskResponse, CreateFinancialLLMTaskRequest, TextModerationResponse } from "./tms_models";
3
3
  /**
4
4
  * tms client
5
5
  * @class
6
6
  */
7
7
  export declare class Client extends TencentCloudCommon.AbstractClient {
8
8
  constructor(clientConfig: TencentCloudCommon.ClientConfig);
9
+ /**
10
+ * 创建金融大模型审校任务
11
+ */
12
+ CreateFinancialLLMTask(req: CreateFinancialLLMTaskRequest, cb?: (error: string, rep: CreateFinancialLLMTaskResponse) => void): Promise<CreateFinancialLLMTaskResponse>;
9
13
  /**
10
14
  * 本接口(Text Moderation)用于提交文本内容进行智能审核任务。使用前请您使用腾讯云主账号登录控制台 [开通文本内容安全服务](https://console.cloud.tencent.com/cms) 并调整好对应的业务配置。
11
15
 
@@ -18,7 +22,8 @@ export declare class Client extends TencentCloudCommon.AbstractClient {
18
22
  - 支持识别多种违规场景,包括:低俗、谩骂、色情、广告等场景;
19
23
  - 支持根据不同的业务场景配置自定义的审核策略,可在控制台文本内容安全-策略管理中配置;
20
24
  - 支持用户自定义配置词库黑白名单,打击自定义识别类型的违规文本(目前仅支持黑名单配置);
21
- - 支持在审核文本内容时同时关联账号或设备信息,可识别违规风险账号或设备。
25
+ - 支持在审核文本内容时同时关联账号或设备信息,可识别违规风险账号或设备;
26
+ - 支持大模型、聊天室等场景下的流式上下文审核。
22
27
 
23
28
  ### 接口调用说明:
24
29
  - 文本内容大小支持:文本原文长度不能超过unicode编码长度10000个字符;
@@ -26,4 +31,8 @@ export declare class Client extends TencentCloudCommon.AbstractClient {
26
31
  - 默认接口请求频率限制:**1000次/秒**,超过该频率限制则接口会报错。
27
32
  */
28
33
  TextModeration(req: TextModerationRequest, cb?: (error: string, rep: TextModerationResponse) => void): Promise<TextModerationResponse>;
34
+ /**
35
+ * 获取金融大模型审校任务结果
36
+ */
37
+ GetFinancialLLMTaskResult(req: GetFinancialLLMTaskResultRequest, cb?: (error: string, rep: GetFinancialLLMTaskResultResponse) => void): Promise<GetFinancialLLMTaskResultResponse>;
29
38
  }
@@ -28,6 +28,12 @@ class Client extends TencentCloudCommon.AbstractClient {
28
28
  constructor(clientConfig) {
29
29
  super("tms.tencentcloudapi.com", "2020-12-29", clientConfig);
30
30
  }
31
+ /**
32
+ * 创建金融大模型审校任务
33
+ */
34
+ async CreateFinancialLLMTask(req, cb) {
35
+ return this.request("CreateFinancialLLMTask", req, cb);
36
+ }
31
37
  /**
32
38
  * 本接口(Text Moderation)用于提交文本内容进行智能审核任务。使用前请您使用腾讯云主账号登录控制台 [开通文本内容安全服务](https://console.cloud.tencent.com/cms) 并调整好对应的业务配置。
33
39
 
@@ -40,7 +46,8 @@ class Client extends TencentCloudCommon.AbstractClient {
40
46
  - 支持识别多种违规场景,包括:低俗、谩骂、色情、广告等场景;
41
47
  - 支持根据不同的业务场景配置自定义的审核策略,可在控制台文本内容安全-策略管理中配置;
42
48
  - 支持用户自定义配置词库黑白名单,打击自定义识别类型的违规文本(目前仅支持黑名单配置);
43
- - 支持在审核文本内容时同时关联账号或设备信息,可识别违规风险账号或设备。
49
+ - 支持在审核文本内容时同时关联账号或设备信息,可识别违规风险账号或设备;
50
+ - 支持大模型、聊天室等场景下的流式上下文审核。
44
51
 
45
52
  ### 接口调用说明:
46
53
  - 文本内容大小支持:文本原文长度不能超过unicode编码长度10000个字符;
@@ -50,5 +57,11 @@ class Client extends TencentCloudCommon.AbstractClient {
50
57
  async TextModeration(req, cb) {
51
58
  return this.request("TextModeration", req, cb);
52
59
  }
60
+ /**
61
+ * 获取金融大模型审校任务结果
62
+ */
63
+ async GetFinancialLLMTaskResult(req, cb) {
64
+ return this.request("GetFinancialLLMTaskResult", req, cb);
65
+ }
53
66
  }
54
67
  exports.Client = Client;
@@ -24,17 +24,13 @@ export interface SentimentAnalysis {
24
24
  Message?: string;
25
25
  }
26
26
  /**
27
- * 标识命中的违规关键词位置信息
27
+ * GetFinancialLLMTaskResult请求参数结构体
28
28
  */
29
- export interface Positions {
29
+ export interface GetFinancialLLMTaskResultRequest {
30
30
  /**
31
- * 关键词起始位置
32
- */
33
- Start?: number;
34
- /**
35
- * 关键词结束位置
31
+ * 金融大模型审校任务ID
36
32
  */
37
- End?: number;
33
+ TaskId: string;
38
34
  }
39
35
  /**
40
36
  * 账号风险检测结果
@@ -50,38 +46,41 @@ export interface RiskDetails {
50
46
  Level?: number;
51
47
  }
52
48
  /**
53
- * TextModeration请求参数结构体
49
+ * GetFinancialLLMTaskResult返回参数结构体
54
50
  */
55
- export interface TextModerationRequest {
51
+ export interface GetFinancialLLMTaskResultResponse {
56
52
  /**
57
- * 该字段表示待检测对象的文本内容,文本需要按utf-8格式编码,长度不能超过10000个字符(按unicode编码计算),并进行 Base64加密
53
+ * 审校任务状态:
54
+
55
+ - Success: 成功
56
+ - Processing: 处理中,请等待
57
+ - Failed: 失败
58
58
  */
59
- Content: string;
59
+ Status?: string;
60
60
  /**
61
- * 该字段表示使用的策略的具体编号,该字段需要先在[内容安全控制台](https://console.cloud.tencent.com/cms/clouds/manage)中配置。
62
- 备注:不同Biztype关联不同的业务场景与识别能力策略,调用前请确认正确的Biztype。
61
+ * 大模型审校结果
63
62
  */
64
- BizType?: string;
63
+ ModerationResult?: string;
65
64
  /**
66
- * 该字段表示您为待检测对象分配的数据ID,传入后可方便您对文件进行标识和管理。<br>取值:由英文字母(大小写均可)、数字及四个特殊符号(_,-,@,#)组成,**长度不超过64个字符**
65
+ * 审校任务失败原因,仅当任务失败时有值
67
66
  */
68
- DataId?: string;
67
+ FailureReason?: string;
69
68
  /**
70
- * 该字段表示待检测对象对应的用户相关信息,传入后可便于甄别相应违规风险用户
69
+ * 审校任务开始时间
71
70
  */
72
- User?: User;
71
+ StartTime?: string;
73
72
  /**
74
- * 该字段表示待检测对象对应的设备相关信息,传入后可便于甄别相应违规风险设备
73
+ * 本次检测的违规点列表
75
74
  */
76
- Device?: Device;
75
+ ReviewedLabels?: Array<string>;
77
76
  /**
78
- * 表示Content的原始语种,枚举值包括 "en" 和 "zh"。其中,"en" 表示英文,"zh" 表示中文。非中文场景的处理耗时较高,具体情况取决于送审文本长度,非中文场景需[反馈工单](https://console.cloud.tencent.com/workorder/category?level1_id=141&level2_id=1287&source=14&data_title=%E6%96%87%E6%9C%AC%E5%86%85%E5%AE%B9%E5%AE%89%E5%85%A8&step=1)确认。
77
+ * 违规明细
79
78
  */
80
- SourceLanguage?: string;
79
+ Details?: Array<FinancialLLMViolationDetail>;
81
80
  /**
82
- * 审核的业务类型,枚举值包括"TEXT"和"TEXT_AIGC"。其中"TEXT"表示传统文本审核,"TEXT_AIGC"表示AI生成检测(生成检测能力具体能力了解可[参见文档](https://cloud.tencent.com/document/product/1124/118694))。
81
+ * 唯一请求 ID,由服务端生成,每次请求都会返回(若请求因其他原因未能抵达服务端,则该次请求不会获得 RequestId)。定位问题时需要提供该次请求的 RequestId。
83
82
  */
84
- Type?: string;
83
+ RequestId?: string;
85
84
  }
86
85
  /**
87
86
  * 文本审核返回的详细结果
@@ -129,6 +128,44 @@ export interface DetailResults {
129
128
  */
130
129
  HitInfos?: Array<HitInfo>;
131
130
  }
131
+ /**
132
+ * TextModeration请求参数结构体
133
+ */
134
+ export interface TextModerationRequest {
135
+ /**
136
+ * 该字段表示待检测对象的文本内容,文本需要按utf-8格式编码,长度不能超过10000个字符(按unicode编码计算),并进行 Base64加密
137
+ */
138
+ Content: string;
139
+ /**
140
+ * 该字段表示使用的策略的具体编号,该字段需要先在[内容安全控制台](https://console.cloud.tencent.com/cms/clouds/manage)中配置。
141
+ 备注:不同Biztype关联不同的业务场景与识别能力策略,调用前请确认正确的Biztype。
142
+ */
143
+ BizType?: string;
144
+ /**
145
+ * 该字段表示您为待检测对象分配的数据ID,传入后可方便您对文件进行标识和管理。<br>取值:由英文字母(大小写均可)、数字及四个特殊符号(_,-,@,#)组成,**长度不超过64个字符**
146
+ */
147
+ DataId?: string;
148
+ /**
149
+ * 该字段表示待检测对象对应的用户相关信息,传入后可便于甄别相应违规风险用户
150
+ */
151
+ User?: User;
152
+ /**
153
+ * 该字段表示待检测对象对应的设备相关信息,传入后可便于甄别相应违规风险设备
154
+ */
155
+ Device?: Device;
156
+ /**
157
+ * 表示Content的原始语种,枚举值包括 "en" 和 "zh"。其中,"en" 表示英文,"zh" 表示中文。非中文场景的处理耗时较高,具体情况取决于送审文本长度,非中文场景需[反馈工单](https://console.cloud.tencent.com/workorder/category?level1_id=141&level2_id=1287&source=14&data_title=%E6%96%87%E6%9C%AC%E5%86%85%E5%AE%B9%E5%AE%89%E5%85%A8&step=1)确认。
158
+ */
159
+ SourceLanguage?: string;
160
+ /**
161
+ * 审核的业务类型,枚举值包括"TEXT"和"TEXT_AIGC"。其中"TEXT"表示传统文本审核,"TEXT_AIGC"表示AI生成检测(生成检测能力具体能力了解可[参见文档](https://cloud.tencent.com/document/product/1124/118694))。
162
+ */
163
+ Type?: string;
164
+ /**
165
+ * 流式审核策略维度下的唯一会话ID
166
+ */
167
+ SessionId?: string;
168
+ }
132
169
  /**
133
170
  * 关键词命中位置信息
134
171
  */
@@ -151,81 +188,94 @@ export interface HitInfo {
151
188
  Positions?: Array<Positions>;
152
189
  }
153
190
  /**
154
- * 该字段用于返回审核结果明细字段的标签及分数
191
+ * 金融大模型审校-违规原因
155
192
  */
156
- export interface Tag {
157
- /**
158
- * 该字段用于返回命中的关键词
159
- */
160
- Keyword?: string;
193
+ export interface FinancialLLMViolationReason {
161
194
  /**
162
- * 该字段用于返回子标签
195
+ * 违规原文片段
163
196
  */
164
- SubLabel?: string;
197
+ TargetText?: string;
165
198
  /**
166
- * 该字段用于返回子标签对应的分数
199
+ * 违规原因
167
200
  */
168
- Score?: number;
201
+ Reason?: string;
169
202
  }
170
203
  /**
171
- * 用于表示业务用户的账号相关信息
204
+ * CreateFinancialLLMTask返回参数结构体
172
205
  */
173
- export interface User {
206
+ export interface CreateFinancialLLMTaskResponse {
174
207
  /**
175
- * 该字段表示业务用户ID,填写后,系统可根据账号过往违规历史优化审核结果判定,有利于存在可疑违规风险时的辅助判断。<br>
176
- 备注:该字段可传入微信openid、QQopenid、字符串等账号信息,与账号类别参数(AccountType)配合使用可确定唯一账号。
208
+ * 金融大模型审校任务ID
177
209
  */
178
- UserId?: string;
210
+ TaskId?: string;
179
211
  /**
180
- * 该字段表示业务用户对应的账号昵称信息。
212
+ * 唯一请求 ID,由服务端生成,每次请求都会返回(若请求因其他原因未能抵达服务端,则该次请求不会获得 RequestId)。定位问题时需要提供该次请求的 RequestId。
181
213
  */
182
- Nickname?: string;
214
+ RequestId?: string;
215
+ }
216
+ /**
217
+ * 该字段用于返回审核结果明细字段的标签及分数
218
+ */
219
+ export interface Tag {
183
220
  /**
184
- * 该字段表示业务用户ID对应的账号类型,取值:**1**-微信uin,**2**-QQ号,**3**-微信群uin,**4**-qq群号,**5**-微信openid,**6**-QQopenid,**7**-其它string。<br>
185
- 该字段与账号ID参数(UserId)配合使用可确定唯一账号。
221
+ * 该字段用于返回命中的关键词
186
222
  */
187
- AccountType?: number;
223
+ Keyword?: string;
188
224
  /**
189
- * 该字段表示业务用户对应账号的性别信息。<br>
190
- 取值:**0**(默认值,代表性别未知)、**1**(男性)、**2**(女性)。
225
+ * 该字段用于返回子标签
191
226
  */
192
- Gender?: number;
227
+ SubLabel?: string;
193
228
  /**
194
- * 该字段表示业务用户对应账号的年龄信息。<br>
195
- 取值:**0**(默认值,代表年龄未知)-(**自定义年龄上限**)之间的整数。
229
+ * 该字段用于返回子标签对应的分数
196
230
  */
197
- Age?: number;
231
+ Score?: number;
232
+ }
233
+ /**
234
+ * CreateFinancialLLMTask请求参数结构体
235
+ */
236
+ export interface CreateFinancialLLMTaskRequest {
198
237
  /**
199
- * 该字段表示业务用户对应账号的等级信息。<br>
200
- 取值:**0**(默认值,代表等级未知)、**1**(等级较低)、**2**(等级中等)、**3**(等级较高),目前**暂不支持自定义等级**。
238
+ * 审核策略BizType
201
239
  */
202
- Level?: number;
240
+ BizType: string;
203
241
  /**
204
- * 该字段表示业务用户对应账号的手机号信息,支持全球各地区手机号的记录。<br>
205
- 备注:请保持手机号格式的统一,如区号格式(086/+86)等。
242
+ * 待审文件类型,目前支持:PDF, DOC, DOCX
206
243
  */
207
- Phone?: string;
244
+ FileType?: string;
208
245
  /**
209
- * 该字段表示业务用户头像图片的访问链接(URL),支持PNG、JPG、JPEG、BMP、GIF、WEBP格式。
210
- 备注:头像图片大小不超过5MB,建议分辨率不低于256x256;图片下载时间限制为3秒,超过则会返回下载超时。
246
+ * 送审内容类型:1-文档,2-文本
211
247
  */
212
- HeadUrl?: string;
248
+ ContentType?: number;
213
249
  /**
214
- * 该字段表示业务用户的简介信息,支持汉字、英文及特殊符号,长度不超过5000个汉字字符。
250
+ * 送审内容,根据ContentType字段的取值,传入送审文档的Url链接,或送审文本的Base64编码
251
+
252
+ 文档限制:
253
+
254
+ - 文件下载时间不超过15秒(文件存储于腾讯云的Url可保障更高的下载速度和稳定性,建议文件存储于腾讯云。非腾讯云存储的 Url 速度和稳定性可能受一定影响。)
255
+ - 所下载文件经 Base64 编码后不超过支持的文件大小:PDF/DOC/DOCX - 200M
256
+ - 文档解析后的纯文本长度不超过 10000字
257
+
258
+ 文本限制:Base64解码后的文本长度不超过10000字
259
+
215
260
  */
216
- Desc?: string;
261
+ Content?: string;
262
+ }
263
+ /**
264
+ * 金融大模型审校 违规明细
265
+ */
266
+ export interface FinancialLLMViolationDetail {
217
267
  /**
218
- * 该字段表示业务群聊场景时的房间ID。
268
+ * 违规点
219
269
  */
220
- RoomId?: string;
270
+ Label?: string;
221
271
  /**
222
- * 该字段表示消息接受者ID
272
+ * 处置建议
223
273
  */
224
- ReceiverId?: string;
274
+ Suggestion?: string;
225
275
  /**
226
- * 消息生成时间,精确到毫秒
276
+ * 违规原因列表
227
277
  */
228
- SendTime?: number;
278
+ Reasons?: Array<FinancialLLMViolationReason>;
229
279
  }
230
280
  /**
231
281
  * 用于表示业务用户对应的设备信息
@@ -335,8 +385,85 @@ export interface TextModerationResponse {
335
385
  * 该字段用于标识本次审核决策归因,比如text_nlp_tianji标识是由nlp tianji模型给出的审核决策,text_keyword_public标识命中了业务的关键词库
336
386
  */
337
387
  HitType?: string;
388
+ /**
389
+ * 流式审核策略维度下的唯一会话ID
390
+ */
391
+ SessionId?: string;
338
392
  /**
339
393
  * 唯一请求 ID,由服务端生成,每次请求都会返回(若请求因其他原因未能抵达服务端,则该次请求不会获得 RequestId)。定位问题时需要提供该次请求的 RequestId。
340
394
  */
341
395
  RequestId?: string;
342
396
  }
397
+ /**
398
+ * 标识命中的违规关键词位置信息
399
+ */
400
+ export interface Positions {
401
+ /**
402
+ * 关键词起始位置
403
+ */
404
+ Start?: number;
405
+ /**
406
+ * 关键词结束位置
407
+ */
408
+ End?: number;
409
+ }
410
+ /**
411
+ * 用于表示业务用户的账号相关信息
412
+ */
413
+ export interface User {
414
+ /**
415
+ * 该字段表示业务用户ID,填写后,系统可根据账号过往违规历史优化审核结果判定,有利于存在可疑违规风险时的辅助判断。<br>
416
+ 备注:该字段可传入微信openid、QQopenid、字符串等账号信息,与账号类别参数(AccountType)配合使用可确定唯一账号。
417
+ */
418
+ UserId?: string;
419
+ /**
420
+ * 该字段表示业务用户对应的账号昵称信息。
421
+ */
422
+ Nickname?: string;
423
+ /**
424
+ * 该字段表示业务用户ID对应的账号类型,取值:**1**-微信uin,**2**-QQ号,**3**-微信群uin,**4**-qq群号,**5**-微信openid,**6**-QQopenid,**7**-其它string。<br>
425
+ 该字段与账号ID参数(UserId)配合使用可确定唯一账号。
426
+ */
427
+ AccountType?: number;
428
+ /**
429
+ * 该字段表示业务用户对应账号的性别信息。<br>
430
+ 取值:**0**(默认值,代表性别未知)、**1**(男性)、**2**(女性)。
431
+ */
432
+ Gender?: number;
433
+ /**
434
+ * 该字段表示业务用户对应账号的年龄信息。<br>
435
+ 取值:**0**(默认值,代表年龄未知)-(**自定义年龄上限**)之间的整数。
436
+ */
437
+ Age?: number;
438
+ /**
439
+ * 该字段表示业务用户对应账号的等级信息。<br>
440
+ 取值:**0**(默认值,代表等级未知)、**1**(等级较低)、**2**(等级中等)、**3**(等级较高),目前**暂不支持自定义等级**。
441
+ */
442
+ Level?: number;
443
+ /**
444
+ * 该字段表示业务用户对应账号的手机号信息,支持全球各地区手机号的记录。<br>
445
+ 备注:请保持手机号格式的统一,如区号格式(086/+86)等。
446
+ */
447
+ Phone?: string;
448
+ /**
449
+ * 该字段表示业务用户头像图片的访问链接(URL),支持PNG、JPG、JPEG、BMP、GIF、WEBP格式。
450
+ 备注:头像图片大小不超过5MB,建议分辨率不低于256x256;图片下载时间限制为3秒,超过则会返回下载超时。
451
+ */
452
+ HeadUrl?: string;
453
+ /**
454
+ * 该字段表示业务用户的简介信息,支持汉字、英文及特殊符号,长度不超过5000个汉字字符。
455
+ */
456
+ Desc?: string;
457
+ /**
458
+ * 该字段表示业务群聊场景时的房间ID。
459
+ */
460
+ RoomId?: string;
461
+ /**
462
+ * 该字段表示消息接受者ID
463
+ */
464
+ ReceiverId?: string;
465
+ /**
466
+ * 消息生成时间,精确到毫秒
467
+ */
468
+ SendTime?: number;
469
+ }