tencentcloud-sdk-nodejs 4.0.1022 → 4.0.1024

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.
package/README.md CHANGED
@@ -13,21 +13,50 @@
13
13
 
14
14
  安装 NODEJS SDK 前,先获取安全凭证。在第一次使用云 API 之前,用户首先需要在腾讯云控制台上申请安全凭证,安全凭证包括 SecretID 和 SecretKey, SecretID 是用于标识 API 调用者的身份,SecretKey 是用于加密签名字符串和服务器端验证签名字符串的密钥。SecretKey 必须严格保管,避免泄露。
15
15
 
16
- ## 通过 Npm 安装
16
+ ## 通过 NPM 安装
17
17
 
18
- 通过 npm 获取安装是使用 NODEJS SDK 的推荐方法,npm 是 NODEJS 的包管理工具。关于 npm 详细可参考[ npm 官网](https://www.npmjs.com/) 。
18
+ 通过 NPM 获取安装是使用 NODEJS SDK 的推荐方法,NPM 是 NODEJS 的包管理工具。关于 NPM 详细可参考 [NPM 官网](https://www.npmjs.com/) 。
19
19
 
20
- 1. 执行以下安装命令:
21
- > npm install tencentcloud-sdk-nodejs --save
22
- 2. 在您的代码中引用对应模块代码,可参考示例。
23
- 3. 如上引用方式会将腾讯云所有产品sdk下载到本地,可以将tencentcloud-sdk-nodejs换成tencentcloud-sdk-nodejs-cvm/cbs/vpc等,即可引用特定产品的sdk,代码中可将require("tencentcloud-sdk-nodejs")改为require("tencentcloud-sdk-nodejs-cvm/cbs/vpc"),其余不变,可参考示例,可大大节省存储空间。
20
+ ### 安装指定产品 SDK(推荐)
21
+
22
+ 安装 CVM SDK:
23
+
24
+ ```
25
+ npm install tencentcloud-sdk-nodejs-cvm --save
26
+ ```
27
+
28
+ 安装 VPC SDK:
29
+
30
+ ```
31
+ npm install tencentcloud-sdk-nodejs-vpc --save
32
+ ```
33
+
34
+ 具体产品的缩写表请参考 [products.md](./products.md) 中的包名字段。
35
+
36
+ 安装指定产品 SDK 后,注意修改引入的包名:
37
+
38
+ ```diff
39
+ - const tencentcloud = require("tencentcloud-sdk-nodejs")
40
+ + const { cvm } = require("tencentcloud-sdk-nodejs-cvm")
41
+
42
+ - const CvmClient = tencentcloud.cvm.v20170312.Client
43
+ + const CvmClient = cvm.v20170312.Client
44
+ ```
45
+
46
+ ### 安装全产品 SDK
47
+
48
+ ```
49
+ npm install tencentcloud-sdk-nodejs --save
50
+ ```
51
+
52
+ 全产品 SDK 包含了所有云产品的调用代码,体积偏大,对体积敏感的场景,推荐安装指定产品 SDK。
24
53
 
25
54
  ## 通过源码包安装
26
55
 
27
- 1. 前往 [Github 仓库](https://github.com/tencentcloud/tencentcloud-sdk-nodejs) 或者 [Gitee 仓库](https://gitee.com/tencentcloud/tencentcloud-sdk-nodejs) 下载源码压缩包。
56
+ 1. 前往 [GitHub 仓库](https://github.com/tencentcloud/tencentcloud-sdk-nodejs) 或者 [Gitee 仓库](https://gitee.com/tencentcloud/tencentcloud-sdk-nodejs) 下载源码压缩包。
28
57
  2. 解压源码包到您项目合适的位置,例如 `sdk/tencentcloud-sdk-nodejs`。
29
58
  3. 执行 `npm install ./sdk/tencentcloud-sdk-nodejs`。
30
- 4. 使用 `require("tencentcloud-sdk-nodejs")` 的方式引入sdk,具体可参考示例。
59
+ 4. 使用 `require("tencentcloud-sdk-nodejs")` 的方式引入SDK,具体可参考示例。
31
60
 
32
61
  # 示例
33
62
 
@@ -120,14 +149,14 @@ new XxxClient({
120
149
 
121
150
  # 旧版 SDK
122
151
 
123
- 我们推荐使用新版 NODEJS SDK,如果一定要用旧版 SDK,请前往[github 仓库](https://github.com/CFETeam/qcloudapi-sdk)下载。
152
+ 我们推荐使用新版 NODEJS SDK,如果一定要用旧版 SDK,请前往[GitHub 仓库](https://github.com/CFETeam/qcloudapi-sdk)下载。
124
153
 
125
154
  # 常见问题
126
155
  - webpack打包出错/浏览器报错
127
156
 
128
- 请**务必不要**将此sdk直接用于web前端(包括小程序等),暴露密钥在这些环境非常不安全。
157
+ 请**务必不要**将此SDK直接用于web前端(包括小程序等),暴露密钥在这些环境非常不安全。
129
158
 
130
- 正确的做法是在自己的服务端引用此sdk,并保存好密钥,做好请求鉴权;前端再调用服务端执行业务流程。
159
+ 正确的做法是在自己的服务端引用此SDK,并保存好密钥,做好请求鉴权;前端再调用服务端执行业务流程。
131
160
 
132
161
  - `The "original" argument must be of type Function.`
133
162
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "tencentcloud-sdk-nodejs",
3
- "version": "4.0.1022",
3
+ "version": "4.0.1024",
4
4
  "description": "腾讯云 API NODEJS SDK",
5
5
  "main": "tencentcloud/index.js",
6
6
  "scripts": {
@@ -1 +1 @@
1
- export const sdkVersion = "4.0.1022"
1
+ export const sdkVersion = "4.0.1024"
@@ -18,13 +18,14 @@
18
18
  import { AbstractClient } from "../../../common/abstract_client"
19
19
  import { ClientConfig } from "../../../common/interface"
20
20
  import {
21
+ ChatCompletionsRequest,
21
22
  CreateSplitDocumentFlowRequest,
22
- ImportQAsResponse,
23
23
  RetrievalRecordMetadata,
24
24
  ListQAsRequest,
25
25
  ReconstructDocumentSSEResponse,
26
26
  DocItem,
27
27
  GetEmbeddingRequest,
28
+ ImportQAsResponse,
28
29
  UploadDocRealtimeRequest,
29
30
  DescribeDocResponse,
30
31
  AttributeLabelReferItem,
@@ -42,16 +43,19 @@ import {
42
43
  SegmentationConfig,
43
44
  CreateQAResponse,
44
45
  ModifyAttributeLabelRequest,
46
+ GetReconstructDocumentResultResponse,
45
47
  ReconstructDocumentSSEConfig,
46
48
  ListDocsResponse,
47
49
  DocumentUsage,
48
50
  ListAttributeLabelsRequest,
49
51
  DeleteAttributeLabelsRequest,
50
52
  RetrieveKnowledgeRequest,
51
- GetReconstructDocumentResultResponse,
53
+ Choice,
52
54
  CreateReconstructDocumentFlowConfig,
53
55
  RunRerankRequest,
56
+ ChatUsage,
54
57
  GetSplitDocumentResultRequest,
58
+ Delta,
55
59
  ReconstructDocumentSSERequest,
56
60
  ListAttributeLabelsResponse,
57
61
  RetrievalRecord,
@@ -69,6 +73,7 @@ import {
69
73
  UploadDocRealtimeResponse,
70
74
  SplitDocumentFailedPage,
71
75
  ModifyAttributeLabelResponse,
76
+ QueryRewriteResponse,
72
77
  UploadDocRequest,
73
78
  DeleteQAsResponse,
74
79
  CreateKnowledgeBaseResponse,
@@ -78,14 +83,14 @@ import {
78
83
  CreateSplitDocumentFlowConfig,
79
84
  RunRerankResponse,
80
85
  CreateReconstructDocumentFlowResponse,
81
- QueryRewriteResponse,
86
+ DeleteKnowledgeBaseRequest,
82
87
  CreateQARequest,
83
88
  UploadDocResponse,
84
89
  AttributeItem,
85
90
  EmbeddingObject,
86
91
  Message,
87
92
  CreateKnowledgeBaseRequest,
88
- DeleteKnowledgeBaseRequest,
93
+ ChatCompletionsResponse,
89
94
  DeleteDocsRequest,
90
95
  } from "./lkeap_models"
91
96
 
@@ -353,4 +358,101 @@ export class Client extends AbstractClient {
353
358
  ): Promise<UploadDocResponse> {
354
359
  return this.request("UploadDoc", req, cb)
355
360
  }
361
+
362
+ /**
363
+ * #### 接口功能
364
+
365
+ 调用接口,发起一次对话请求。
366
+
367
+ #### 已支持的模型
368
+ - DeepSeek-V3(model 参数值为**deepseek-v3**)
369
+ - DeepSeek-V3为671B参数MoE模型,在百科知识、数学推理等多项任务上优势突出,评测成绩在主流榜单中位列开源模型榜首。
370
+ - 支持64K上下文长度,最大支持8K输出长度。
371
+ - DeepSeek-R1(model 参数值为**deepseek-r1**)
372
+ - DeepSeek-R1为671B模型,使用强化学习训练,推理过程包含大量反思和验证,思维链长度可达数万字。 该系列模型在数学、代码以及各种复杂逻辑推理任务上推理效果优异,并为用户展现了完整的思考过程。
373
+ - 支持64K上下文长度,最大支持8K输出长度。
374
+
375
+ #### 计费说明
376
+ - 限时免费
377
+
378
+ 本接口调用DeepSeek系列模型限时免费。即日至北京时间2025年2月25日23:59:59,所有腾讯云用户均可享受DeepSeek-V3、DeepSeek-R1模型限时免费服务,单账号限制接口并发上限为5。在此之后,模型价格将恢复至原价。
379
+ - 标准计费(2025年2月26日起生效)
380
+ ![image](https://cdn.xiaowei.qq.com/static/lke/deepseek-token.png)
381
+
382
+
383
+ #### 快速接入
384
+ 1. 完成[实名认证](https://console.cloud.tencent.com/developer/auth)。
385
+ 2. 主账户前往[控制台](https://console.cloud.tencent.com/lkeap)开通服务。若为子账户,需由主账号在[权限管理](https://console.cloud.tencent.com/cam)中为子账号授权,关联预设策略,策略名称:QcloudLKEAPFullAccess。
386
+ 3. 通过API Explorer[在线调试](https://console.cloud.tencent.com/api/explorer?Product=lkeap&Version=2024-05-22&Action=ChatCompletions)。
387
+ 4. 使用[官方 SDK ](https://cloud.tencent.com/document/product/1772/115963#SDK)调用本接口(支持Python/Java/PHP/Go/Node.js/.NET等语言)。
388
+
389
+ -----------
390
+
391
+ ### SDK调用示例
392
+ 通过本地代码调用本接口(支持Python/Java/PHP/Go/Node.js/.NET等语言):下面的代码以 Python 语言为例,展示如何访问腾讯云上的DeepSeek模型API的样例。
393
+ (1)安装环境
394
+ ```
395
+ python3 -m pip install --upgrade tencentcloud-sdk-python-common
396
+ python3 -m pip install --upgrade tencentcloud-sdk-python-lkeap
397
+ ```
398
+
399
+ (2)示例代码
400
+
401
+ - 其中SecretKey和SecretID需要从腾讯云控制台获取
402
+
403
+ - 参数params中模型Model字段可以选择“deepseek-r1“和“deepseek-v3”
404
+
405
+ ```
406
+ # -*- coding: utf-8 -*-
407
+ import json
408
+
409
+ from tencentcloud.common.common_client import CommonClient
410
+ from tencentcloud.common import credential
411
+ from tencentcloud.common.exception.tencent_cloud_sdk_exception import TencentCloudSDKException
412
+ from tencentcloud.common.profile.client_profile import ClientProfile
413
+ from tencentcloud.common.profile.http_profile import HttpProfile
414
+
415
+ class NonStreamResponse(object):
416
+ def __init__(self):
417
+ self.response = ""
418
+
419
+ def _deserialize(self, obj):
420
+ self.response = json.dumps(obj)
421
+
422
+ try:
423
+ # 实例化一个认证对象,入参需要传入腾讯云账户 SecretId 和 SecretKey,此处还需注意密钥对的保密
424
+ # 代码泄露可能会导致 SecretId 和 SecretKey 泄露,并威胁账号下所有资源的安全性。以下代码示例仅供参考,建议采用更安全的方式来使用密钥,请参见:https://cloud.tencent.com/document/product/1278/85305
425
+ # 密钥可前往官网控制台 https://console.cloud.tencent.com/cam/capi 进行获取
426
+ cred = credential.Credential("", "")
427
+
428
+ httpProfile = HttpProfile()
429
+ httpProfile.endpoint = "lkeap.tencentcloudapi.com"
430
+ httpProfile.reqTimeout = 40000 # 流式接口可能耗时较长
431
+ clientProfile = ClientProfile()
432
+ clientProfile.httpProfile = httpProfile
433
+
434
+ params = "{\"Model\":\"deepseek-r1\",\"Messages\":[{\"Role\":\"user\",\"Content\":\"你好\"}],\"Stream\":true}";
435
+ common_client = CommonClient("lkeap", "2024-05-22", cred, "ap-guangzhou", profile=clientProfile)
436
+ resp = common_client._call_and_deserialize("ChatCompletions", json.loads(params), NonStreamResponse)
437
+ if isinstance(resp, NonStreamResponse): # 非流式响应
438
+ print(resp.response)
439
+ else: # 流式响应
440
+ for event in resp:
441
+ print(event)
442
+ except TencentCloudSDKException as err:
443
+ print(err)
444
+
445
+ ```
446
+
447
+ **DeepSeek-R1使用建议**
448
+
449
+ 1. 将温度设置在 0.5-0.7 范围内(建议为0.6),以防止无休止的重复或不连贯的输出。
450
+ 2. 避免添加system prompt,所有说明都应包含在user prompt中。
451
+ */
452
+ async ChatCompletions(
453
+ req: ChatCompletionsRequest,
454
+ cb?: (error: string, rep: ChatCompletionsResponse) => void
455
+ ): Promise<ChatCompletionsResponse> {
456
+ return this.request("ChatCompletions", req, cb)
457
+ }
356
458
  }
@@ -15,6 +15,32 @@
15
15
  * under the License.
16
16
  */
17
17
 
18
+ /**
19
+ * ChatCompletions请求参数结构体
20
+ */
21
+ export interface ChatCompletionsRequest {
22
+ /**
23
+ * 模型名称
24
+ */
25
+ Model: string
26
+ /**
27
+ * 会话列表
28
+ */
29
+ Messages: Array<Message>
30
+ /**
31
+ * 是否流式输出
32
+ */
33
+ Stream?: boolean
34
+ /**
35
+ * 控制生成的随机性,较高的值会产生更多样化的输出。
36
+ */
37
+ Temperature?: number
38
+ /**
39
+ * 最大生成的token数量
40
+ */
41
+ MaxTokens?: number
42
+ }
43
+
18
44
  /**
19
45
  * CreateSplitDocumentFlow请求参数结构体
20
46
  */
@@ -69,16 +95,6 @@ export interface CreateSplitDocumentFlowRequest {
69
95
  Config?: CreateSplitDocumentFlowConfig
70
96
  }
71
97
 
72
- /**
73
- * ImportQAs返回参数结构体
74
- */
75
- export interface ImportQAsResponse {
76
- /**
77
- * 唯一请求 ID,由服务端生成,每次请求都会返回(若请求因其他原因未能抵达服务端,则该次请求不会获得 RequestId)。定位问题时需要提供该次请求的 RequestId。
78
- */
79
- RequestId?: string
80
- }
81
-
82
98
  /**
83
99
  * 检索结果的元数据
84
100
  */
@@ -192,6 +208,16 @@ export interface GetEmbeddingRequest {
192
208
  Inputs: Array<string>
193
209
  }
194
210
 
211
+ /**
212
+ * ImportQAs返回参数结构体
213
+ */
214
+ export interface ImportQAsResponse {
215
+ /**
216
+ * 唯一请求 ID,由服务端生成,每次请求都会返回(若请求因其他原因未能抵达服务端,则该次请求不会获得 RequestId)。定位问题时需要提供该次请求的 RequestId。
217
+ */
218
+ RequestId?: string
219
+ }
220
+
195
221
  /**
196
222
  * UploadDocRealtime请求参数结构体
197
223
  */
@@ -398,6 +424,28 @@ export interface ModifyAttributeLabelRequest {
398
424
  Labels?: Array<AttributeLabelItem>
399
425
  }
400
426
 
427
+ /**
428
+ * GetReconstructDocumentResult返回参数结构体
429
+ */
430
+ export interface GetReconstructDocumentResultResponse {
431
+ /**
432
+ * 任务状态。- `Success`:执行完成- `Processing`:执行中- `Pause`: 暂停- `Failed`:执行失败- `WaitExecute`:等待执行
433
+ */
434
+ Status?: string
435
+ /**
436
+ * 解析结果的临时下载地址。文件类型为zip压缩包,下载链接有效期30分钟
437
+ */
438
+ DocumentRecognizeResultUrl?: string
439
+ /**
440
+ * 文档解析失败的页码
441
+ */
442
+ FailedPages?: Array<ReconstructDocumentFailedPage>
443
+ /**
444
+ * 唯一请求 ID,由服务端生成,每次请求都会返回(若请求因其他原因未能抵达服务端,则该次请求不会获得 RequestId)。定位问题时需要提供该次请求的 RequestId。
445
+ */
446
+ RequestId?: string
447
+ }
448
+
401
449
  /**
402
450
  * ReconstructDocumentSSE 功能配置参数
403
451
  */
@@ -499,25 +547,28 @@ export interface RetrieveKnowledgeRequest {
499
547
  }
500
548
 
501
549
  /**
502
- * GetReconstructDocumentResult返回参数结构体
550
+ * 返回的回复, 支持多个
503
551
  */
504
- export interface GetReconstructDocumentResultResponse {
552
+ export interface Choice {
505
553
  /**
506
- * 任务状态。- `Success`:执行完成- `Processing`:执行中- `Pause`: 暂停- `Failed`:执行失败- `WaitExecute`:等待执行
554
+ * 结束标志位,可能为 stop、 sensitive或者tool_calls。
555
+ stop 表示输出正常结束。
556
+ sensitive 只在开启流式输出审核时会出现,表示安全审核未通过。
557
+ tool_calls 标识函数调用。
507
558
  */
508
- Status?: string
559
+ FinishReason?: string
509
560
  /**
510
- * 解析结果的临时下载地址。文件类型为zip压缩包,下载链接有效期30分钟
561
+ * 增量返回值,流式调用时使用该字段。
511
562
  */
512
- DocumentRecognizeResultUrl?: string
563
+ Delta?: Delta
513
564
  /**
514
- * 文档解析失败的页码
565
+ * 返回值,非流式调用时使用该字段。
515
566
  */
516
- FailedPages?: Array<ReconstructDocumentFailedPage>
567
+ Message?: Message
517
568
  /**
518
- * 唯一请求 ID,由服务端生成,每次请求都会返回(若请求因其他原因未能抵达服务端,则该次请求不会获得 RequestId)。定位问题时需要提供该次请求的 RequestId。
569
+ * 索引值,流式调用时使用该字段。
519
570
  */
520
- RequestId?: string
571
+ Index?: number
521
572
  }
522
573
 
523
574
  /**
@@ -563,6 +614,24 @@ export interface RunRerankRequest {
563
614
  Model?: string
564
615
  }
565
616
 
617
+ /**
618
+ * 消耗量
619
+ */
620
+ export interface ChatUsage {
621
+ /**
622
+ * 输入token数
623
+ */
624
+ PromptTokens?: number
625
+ /**
626
+ * 输出token数
627
+ */
628
+ CompletionTokens?: number
629
+ /**
630
+ * 总token数
631
+ */
632
+ TotalTokens?: number
633
+ }
634
+
566
635
  /**
567
636
  * GetSplitDocumentResult请求参数结构体
568
637
  */
@@ -573,6 +642,20 @@ export interface GetSplitDocumentResultRequest {
573
642
  TaskId: string
574
643
  }
575
644
 
645
+ /**
646
+ * 返回的内容
647
+ */
648
+ export interface Delta {
649
+ /**
650
+ * 角色名称。
651
+ */
652
+ Role?: string
653
+ /**
654
+ * 内容详情。
655
+ */
656
+ Content?: string
657
+ }
658
+
576
659
  /**
577
660
  * ReconstructDocumentSSE请求参数结构体
578
661
  */
@@ -860,6 +943,24 @@ export interface ModifyAttributeLabelResponse {
860
943
  RequestId?: string
861
944
  }
862
945
 
946
+ /**
947
+ * QueryRewrite返回参数结构体
948
+ */
949
+ export interface QueryRewriteResponse {
950
+ /**
951
+ * 改写结果
952
+ */
953
+ Content?: string
954
+ /**
955
+ * 消耗量,返回输入token数,输出token数以及总token数
956
+ */
957
+ Usage?: Usage
958
+ /**
959
+ * 唯一请求 ID,由服务端生成,每次请求都会返回(若请求因其他原因未能抵达服务端,则该次请求不会获得 RequestId)。定位问题时需要提供该次请求的 RequestId。
960
+ */
961
+ RequestId?: string
962
+ }
963
+
863
964
  /**
864
965
  * UploadDoc请求参数结构体
865
966
  */
@@ -1067,21 +1168,13 @@ export interface CreateReconstructDocumentFlowResponse {
1067
1168
  }
1068
1169
 
1069
1170
  /**
1070
- * QueryRewrite返回参数结构体
1171
+ * DeleteKnowledgeBase请求参数结构体
1071
1172
  */
1072
- export interface QueryRewriteResponse {
1073
- /**
1074
- * 改写结果
1075
- */
1076
- Content?: string
1077
- /**
1078
- * 消耗量,返回输入token数,输出token数以及总token数
1079
- */
1080
- Usage?: Usage
1173
+ export interface DeleteKnowledgeBaseRequest {
1081
1174
  /**
1082
- * 唯一请求 ID,由服务端生成,每次请求都会返回(若请求因其他原因未能抵达服务端,则该次请求不会获得 RequestId)。定位问题时需要提供该次请求的 RequestId。
1175
+ * 知识库ID
1083
1176
  */
1084
- RequestId?: string
1177
+ KnowledgeBaseId: string
1085
1178
  }
1086
1179
 
1087
1180
  /**
@@ -1156,6 +1249,11 @@ export interface Message {
1156
1249
  * 内容
1157
1250
  */
1158
1251
  Content?: string
1252
+ /**
1253
+ * 思维链内容。
1254
+ ReasoningConent参数仅支持出参,且只有deepseek-r1模型会返回。
1255
+ */
1256
+ ReasoningContent?: string
1159
1257
  }
1160
1258
 
1161
1259
  /**
@@ -1164,13 +1262,34 @@ export interface Message {
1164
1262
  export type CreateKnowledgeBaseRequest = null
1165
1263
 
1166
1264
  /**
1167
- * DeleteKnowledgeBase请求参数结构体
1265
+ * ChatCompletions返回参数结构体
1168
1266
  */
1169
- export interface DeleteKnowledgeBaseRequest {
1267
+ export interface ChatCompletionsResponse {
1170
1268
  /**
1171
- * 知识库ID
1269
+ * Unix 时间戳,单位为秒。
1172
1270
  */
1173
- KnowledgeBaseId: string
1271
+ Created?: number
1272
+ /**
1273
+ * Token 统计信息。
1274
+ 按照总 Token 数量计费。
1275
+ */
1276
+ Usage?: ChatUsage
1277
+ /**
1278
+ * 本次请求的 RequestId。
1279
+ */
1280
+ Id?: string
1281
+ /**
1282
+ * 回复内容。
1283
+ */
1284
+ Choices?: Array<Choice>
1285
+ /**
1286
+ * 模型名称。
1287
+ */
1288
+ Model?: string
1289
+ /**
1290
+ * 唯一请求 ID,由服务端生成,每次请求都会返回(若请求因其他原因未能抵达服务端,则该次请求不会获得 RequestId)。定位问题时需要提供该次请求的 RequestId。本接口为流式响应接口,当请求成功时,RequestId 会被放在 HTTP 响应的 Header "X-TC-RequestId" 中。
1291
+ */
1292
+ RequestId?: string
1174
1293
  }
1175
1294
 
1176
1295
  /**
@@ -99,7 +99,11 @@ export interface CreateDBInstanceRequest {
99
99
  */
100
100
  SubnetId?: string
101
101
  /**
102
- * 实例密码。自定义密码长度为8-32个字符,至少包含字母、数字和字符(!@#%^*()_)中的两种。
102
+ * 实例密码。设置要求如下:
103
+ - 字符个数为[8,32]。
104
+ - 可输入[A,Z]、[a,z]、[0,9]范围内的字符。
105
+ - 可输入的特殊字符包括:感叹号“!”,at“@”,警号“#“、百分号”%”、插入号“^”、星号“*”、括号“()”、下划线“_”。
106
+ - 不能设置单一的字母或者数字。
103
107
  */
104
108
  Password?: string
105
109
  /**
@@ -276,7 +280,7 @@ export interface KillOpsRequest {
276
280
  */
277
281
  export interface InquirePriceRenewDBInstancesRequest {
278
282
  /**
279
- * 实例ID,格式如:cmgo-p8vn****。与云数据库控制台页面中显示的实例ID相同,接口单次最多只支持5个实例进行操作。
283
+ * 实例ID,格式如:cmgo-p8vn****。请登录[MongoDB 控制台](https://console.cloud.tencent.com/mongodb)在实例列表复制实例 ID,且单次最多同时查询5个实例。
280
284
  */
281
285
  InstanceIds: Array<string>
282
286
  /**
@@ -319,23 +319,23 @@ export interface TemplatesMetadata {
319
319
  /**
320
320
  * 创建时间
321
321
  */
322
- CreatedTimestamp: number
322
+ CreatedTimestamp?: number
323
323
  /**
324
324
  * 模板名称
325
325
  */
326
- TemplateName: string
326
+ TemplateName?: string
327
327
  /**
328
328
  * 模板状态。1-审核中|0-已通过|2-拒绝|其它-不可用
329
329
  */
330
- TemplateStatus: number
330
+ TemplateStatus?: number
331
331
  /**
332
332
  * 模板ID
333
333
  */
334
- TemplateID: number
334
+ TemplateID?: number
335
335
  /**
336
336
  * 审核原因
337
337
  */
338
- ReviewReason: string
338
+ ReviewReason?: string
339
339
  }
340
340
 
341
341
  /**
@@ -356,17 +356,14 @@ export interface ReceiverDetail {
356
356
  TemplateData?: string
357
357
  /**
358
358
  * 无效原因
359
- 注意:此字段可能返回 null,表示取不到有效值。
360
359
  */
361
360
  Reason?: string
362
361
  /**
363
362
  * 1:有效,2:无效
364
- 注意:此字段可能返回 null,表示取不到有效值。
365
363
  */
366
364
  Status?: number
367
365
  /**
368
366
  * 收件人地址id
369
- 注意:此字段可能返回 null,表示取不到有效值。
370
367
  */
371
368
  EmailId?: number
372
369
  }
@@ -435,36 +432,36 @@ export interface Volume {
435
432
  * 日期
436
433
  注意:此字段可能返回 null,表示取不到有效值。
437
434
  */
438
- SendDate: string
435
+ SendDate?: string
439
436
  /**
440
437
  * 邮件请求数量
441
438
  */
442
- RequestCount: number
439
+ RequestCount?: number
443
440
  /**
444
441
  * 腾讯云通过数量
445
442
  */
446
- AcceptedCount: number
443
+ AcceptedCount?: number
447
444
  /**
448
445
  * 送达数量
449
446
  */
450
- DeliveredCount: number
447
+ DeliveredCount?: number
451
448
  /**
452
449
  * 打开邮件的用户数量,根据收件人去重
453
450
  */
454
- OpenedCount: number
451
+ OpenedCount?: number
455
452
  /**
456
453
  * 点击了邮件中的链接数量用户数量
457
454
  */
458
- ClickedCount: number
455
+ ClickedCount?: number
459
456
  /**
460
457
  * 退信数量
461
458
  */
462
- BounceCount: number
459
+ BounceCount?: number
463
460
  /**
464
461
  * 取消订阅的用户数量
465
462
  注意:此字段可能返回 null,表示取不到有效值。
466
463
  */
467
- UnsubscribeCount: number
464
+ UnsubscribeCount?: number
468
465
  }
469
466
 
470
467
  /**
@@ -755,12 +752,10 @@ export interface ReceiverData {
755
752
  Count?: number
756
753
  /**
757
754
  * 收件人列表描述
758
- 注意:此字段可能返回 null,表示取不到有效值。
759
755
  */
760
756
  Desc?: string
761
757
  /**
762
758
  * 列表状态(1 待上传 2 上传中 3 上传完成)
763
- 注意:此字段可能返回 null,表示取不到有效值。
764
759
  */
765
760
  ReceiversStatus?: number
766
761
  /**
@@ -769,7 +764,6 @@ export interface ReceiverData {
769
764
  CreateTime?: string
770
765
  /**
771
766
  * 无效收件人数量
772
- 注意:此字段可能返回 null,表示取不到有效值。
773
767
  */
774
768
  InvalidCount?: number
775
769
  }
@@ -969,27 +963,22 @@ export interface ListEmailTemplatesRequest {
969
963
  export interface CreateReceiverDetailWithDataResponse {
970
964
  /**
971
965
  * 收件人总数
972
- 注意:此字段可能返回 null,表示取不到有效值。
973
966
  */
974
967
  TotalCount?: number
975
968
  /**
976
969
  * 实际上传数量
977
- 注意:此字段可能返回 null,表示取不到有效值。
978
970
  */
979
971
  ValidCount?: number
980
972
  /**
981
973
  * 数据过长数量
982
- 注意:此字段可能返回 null,表示取不到有效值。
983
974
  */
984
975
  TooLongCount?: number
985
976
  /**
986
977
  * 邮件地址为空数量
987
- 注意:此字段可能返回 null,表示取不到有效值。
988
978
  */
989
979
  EmptyEmailCount?: number
990
980
  /**
991
981
  * 重复数量
992
- 注意:此字段可能返回 null,表示取不到有效值。
993
982
  */
994
983
  RepeatCount?: number
995
984
  /**
@@ -1353,7 +1342,6 @@ export interface BlackEmailAddress {
1353
1342
  EmailAddress?: string
1354
1343
  /**
1355
1344
  * 被拉黑的理由
1356
- 注意:此字段可能返回 null,表示取不到有效值。
1357
1345
  */
1358
1346
  IspDesc?: string
1359
1347
  }
@@ -1 +1 @@
1
- export declare const sdkVersion = "4.0.1022";
1
+ export declare const sdkVersion = "4.0.1024";
@@ -1,4 +1,4 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.sdkVersion = void 0;
4
- exports.sdkVersion = "4.0.1022";
4
+ exports.sdkVersion = "4.0.1024";
@@ -1,6 +1,6 @@
1
1
  import { AbstractClient } from "../../../common/abstract_client";
2
2
  import { ClientConfig } from "../../../common/interface";
3
- import { CreateSplitDocumentFlowRequest, ImportQAsResponse, ListQAsRequest, ReconstructDocumentSSEResponse, GetEmbeddingRequest, UploadDocRealtimeRequest, DescribeDocResponse, DeleteQAsRequest, ModifyQARequest, GetReconstructDocumentResultRequest, ListQAsResponse, DeleteAttributeLabelsResponse, ListDocsRequest, CreateAttributeLabelResponse, RetrieveKnowledgeResponse, CreateSplitDocumentFlowResponse, CreateQAResponse, ModifyAttributeLabelRequest, ListDocsResponse, ListAttributeLabelsRequest, DeleteAttributeLabelsRequest, RetrieveKnowledgeRequest, GetReconstructDocumentResultResponse, RunRerankRequest, GetSplitDocumentResultRequest, ReconstructDocumentSSERequest, ListAttributeLabelsResponse, CreateAttributeLabelRequest, ImportQAsRequest, DescribeDocRequest, DeleteKnowledgeBaseResponse, DeleteDocsResponse, CreateReconstructDocumentFlowRequest, GetSplitDocumentResultResponse, ModifyQAResponse, UploadDocRealtimeResponse, ModifyAttributeLabelResponse, UploadDocRequest, DeleteQAsResponse, CreateKnowledgeBaseResponse, GetEmbeddingResponse, QueryRewriteRequest, RunRerankResponse, CreateReconstructDocumentFlowResponse, QueryRewriteResponse, CreateQARequest, UploadDocResponse, CreateKnowledgeBaseRequest, DeleteKnowledgeBaseRequest, DeleteDocsRequest } from "./lkeap_models";
3
+ import { ChatCompletionsRequest, CreateSplitDocumentFlowRequest, ListQAsRequest, ReconstructDocumentSSEResponse, GetEmbeddingRequest, ImportQAsResponse, UploadDocRealtimeRequest, DescribeDocResponse, DeleteQAsRequest, ModifyQARequest, GetReconstructDocumentResultRequest, ListQAsResponse, DeleteAttributeLabelsResponse, ListDocsRequest, CreateAttributeLabelResponse, RetrieveKnowledgeResponse, CreateSplitDocumentFlowResponse, CreateQAResponse, ModifyAttributeLabelRequest, GetReconstructDocumentResultResponse, ListDocsResponse, ListAttributeLabelsRequest, DeleteAttributeLabelsRequest, RetrieveKnowledgeRequest, RunRerankRequest, GetSplitDocumentResultRequest, ReconstructDocumentSSERequest, ListAttributeLabelsResponse, CreateAttributeLabelRequest, ImportQAsRequest, DescribeDocRequest, DeleteKnowledgeBaseResponse, DeleteDocsResponse, CreateReconstructDocumentFlowRequest, GetSplitDocumentResultResponse, ModifyQAResponse, UploadDocRealtimeResponse, ModifyAttributeLabelResponse, QueryRewriteResponse, UploadDocRequest, DeleteQAsResponse, CreateKnowledgeBaseResponse, GetEmbeddingResponse, QueryRewriteRequest, RunRerankResponse, CreateReconstructDocumentFlowResponse, DeleteKnowledgeBaseRequest, CreateQARequest, UploadDocResponse, CreateKnowledgeBaseRequest, ChatCompletionsResponse, DeleteDocsRequest } from "./lkeap_models";
4
4
  /**
5
5
  * lkeap client
6
6
  * @class
@@ -113,4 +113,95 @@ export declare class Client extends AbstractClient {
113
113
  使用场景:适用于需要长期存储和检索的文档内容,如产品手册、用户指南等。
114
114
  */
115
115
  UploadDoc(req: UploadDocRequest, cb?: (error: string, rep: UploadDocResponse) => void): Promise<UploadDocResponse>;
116
+ /**
117
+ * #### 接口功能
118
+
119
+ 调用接口,发起一次对话请求。
120
+
121
+ #### 已支持的模型
122
+ - DeepSeek-V3(model 参数值为**deepseek-v3**)
123
+ - DeepSeek-V3为671B参数MoE模型,在百科知识、数学推理等多项任务上优势突出,评测成绩在主流榜单中位列开源模型榜首。
124
+ - 支持64K上下文长度,最大支持8K输出长度。
125
+ - DeepSeek-R1(model 参数值为**deepseek-r1**)
126
+ - DeepSeek-R1为671B模型,使用强化学习训练,推理过程包含大量反思和验证,思维链长度可达数万字。 该系列模型在数学、代码以及各种复杂逻辑推理任务上推理效果优异,并为用户展现了完整的思考过程。
127
+ - 支持64K上下文长度,最大支持8K输出长度。
128
+
129
+ #### 计费说明
130
+ - 限时免费
131
+
132
+ 本接口调用DeepSeek系列模型限时免费。即日至北京时间2025年2月25日23:59:59,所有腾讯云用户均可享受DeepSeek-V3、DeepSeek-R1模型限时免费服务,单账号限制接口并发上限为5。在此之后,模型价格将恢复至原价。
133
+ - 标准计费(2025年2月26日起生效)
134
+ ![image](https://cdn.xiaowei.qq.com/static/lke/deepseek-token.png)
135
+
136
+
137
+ #### 快速接入
138
+ 1. 完成[实名认证](https://console.cloud.tencent.com/developer/auth)。
139
+ 2. 主账户前往[控制台](https://console.cloud.tencent.com/lkeap)开通服务。若为子账户,需由主账号在[权限管理](https://console.cloud.tencent.com/cam)中为子账号授权,关联预设策略,策略名称:QcloudLKEAPFullAccess。
140
+ 3. 通过API Explorer[在线调试](https://console.cloud.tencent.com/api/explorer?Product=lkeap&Version=2024-05-22&Action=ChatCompletions)。
141
+ 4. 使用[官方 SDK ](https://cloud.tencent.com/document/product/1772/115963#SDK)调用本接口(支持Python/Java/PHP/Go/Node.js/.NET等语言)。
142
+
143
+ -----------
144
+
145
+ ### SDK调用示例
146
+ 通过本地代码调用本接口(支持Python/Java/PHP/Go/Node.js/.NET等语言):下面的代码以 Python 语言为例,展示如何访问腾讯云上的DeepSeek模型API的样例。
147
+ (1)安装环境
148
+ ```
149
+ python3 -m pip install --upgrade tencentcloud-sdk-python-common
150
+ python3 -m pip install --upgrade tencentcloud-sdk-python-lkeap
151
+ ```
152
+
153
+ (2)示例代码
154
+
155
+ - 其中SecretKey和SecretID需要从腾讯云控制台获取
156
+
157
+ - 参数params中模型Model字段可以选择“deepseek-r1“和“deepseek-v3”
158
+
159
+ ```
160
+ # -*- coding: utf-8 -*-
161
+ import json
162
+
163
+ from tencentcloud.common.common_client import CommonClient
164
+ from tencentcloud.common import credential
165
+ from tencentcloud.common.exception.tencent_cloud_sdk_exception import TencentCloudSDKException
166
+ from tencentcloud.common.profile.client_profile import ClientProfile
167
+ from tencentcloud.common.profile.http_profile import HttpProfile
168
+
169
+ class NonStreamResponse(object):
170
+ def __init__(self):
171
+ self.response = ""
172
+
173
+ def _deserialize(self, obj):
174
+ self.response = json.dumps(obj)
175
+
176
+ try:
177
+ # 实例化一个认证对象,入参需要传入腾讯云账户 SecretId 和 SecretKey,此处还需注意密钥对的保密
178
+ # 代码泄露可能会导致 SecretId 和 SecretKey 泄露,并威胁账号下所有资源的安全性。以下代码示例仅供参考,建议采用更安全的方式来使用密钥,请参见:https://cloud.tencent.com/document/product/1278/85305
179
+ # 密钥可前往官网控制台 https://console.cloud.tencent.com/cam/capi 进行获取
180
+ cred = credential.Credential("", "")
181
+
182
+ httpProfile = HttpProfile()
183
+ httpProfile.endpoint = "lkeap.tencentcloudapi.com"
184
+ httpProfile.reqTimeout = 40000 # 流式接口可能耗时较长
185
+ clientProfile = ClientProfile()
186
+ clientProfile.httpProfile = httpProfile
187
+
188
+ params = "{\"Model\":\"deepseek-r1\",\"Messages\":[{\"Role\":\"user\",\"Content\":\"你好\"}],\"Stream\":true}";
189
+ common_client = CommonClient("lkeap", "2024-05-22", cred, "ap-guangzhou", profile=clientProfile)
190
+ resp = common_client._call_and_deserialize("ChatCompletions", json.loads(params), NonStreamResponse)
191
+ if isinstance(resp, NonStreamResponse): # 非流式响应
192
+ print(resp.response)
193
+ else: # 流式响应
194
+ for event in resp:
195
+ print(event)
196
+ except TencentCloudSDKException as err:
197
+ print(err)
198
+
199
+ ```
200
+
201
+ **DeepSeek-R1使用建议**
202
+
203
+ 1. 将温度设置在 0.5-0.7 范围内(建议为0.6),以防止无休止的重复或不连贯的输出。
204
+ 2. 避免添加system prompt,所有说明都应包含在user prompt中。
205
+ */
206
+ ChatCompletions(req: ChatCompletionsRequest, cb?: (error: string, rep: ChatCompletionsResponse) => void): Promise<ChatCompletionsResponse>;
116
207
  }
@@ -183,5 +183,98 @@ class Client extends abstract_client_1.AbstractClient {
183
183
  async UploadDoc(req, cb) {
184
184
  return this.request("UploadDoc", req, cb);
185
185
  }
186
+ /**
187
+ * #### 接口功能
188
+
189
+ 调用接口,发起一次对话请求。
190
+
191
+ #### 已支持的模型
192
+ - DeepSeek-V3(model 参数值为**deepseek-v3**)
193
+ - DeepSeek-V3为671B参数MoE模型,在百科知识、数学推理等多项任务上优势突出,评测成绩在主流榜单中位列开源模型榜首。
194
+ - 支持64K上下文长度,最大支持8K输出长度。
195
+ - DeepSeek-R1(model 参数值为**deepseek-r1**)
196
+ - DeepSeek-R1为671B模型,使用强化学习训练,推理过程包含大量反思和验证,思维链长度可达数万字。 该系列模型在数学、代码以及各种复杂逻辑推理任务上推理效果优异,并为用户展现了完整的思考过程。
197
+ - 支持64K上下文长度,最大支持8K输出长度。
198
+
199
+ #### 计费说明
200
+ - 限时免费
201
+
202
+ 本接口调用DeepSeek系列模型限时免费。即日至北京时间2025年2月25日23:59:59,所有腾讯云用户均可享受DeepSeek-V3、DeepSeek-R1模型限时免费服务,单账号限制接口并发上限为5。在此之后,模型价格将恢复至原价。
203
+ - 标准计费(2025年2月26日起生效)
204
+ ![image](https://cdn.xiaowei.qq.com/static/lke/deepseek-token.png)
205
+
206
+
207
+ #### 快速接入
208
+ 1. 完成[实名认证](https://console.cloud.tencent.com/developer/auth)。
209
+ 2. 主账户前往[控制台](https://console.cloud.tencent.com/lkeap)开通服务。若为子账户,需由主账号在[权限管理](https://console.cloud.tencent.com/cam)中为子账号授权,关联预设策略,策略名称:QcloudLKEAPFullAccess。
210
+ 3. 通过API Explorer[在线调试](https://console.cloud.tencent.com/api/explorer?Product=lkeap&Version=2024-05-22&Action=ChatCompletions)。
211
+ 4. 使用[官方 SDK ](https://cloud.tencent.com/document/product/1772/115963#SDK)调用本接口(支持Python/Java/PHP/Go/Node.js/.NET等语言)。
212
+
213
+ -----------
214
+
215
+ ### SDK调用示例
216
+ 通过本地代码调用本接口(支持Python/Java/PHP/Go/Node.js/.NET等语言):下面的代码以 Python 语言为例,展示如何访问腾讯云上的DeepSeek模型API的样例。
217
+ (1)安装环境
218
+ ```
219
+ python3 -m pip install --upgrade tencentcloud-sdk-python-common
220
+ python3 -m pip install --upgrade tencentcloud-sdk-python-lkeap
221
+ ```
222
+
223
+ (2)示例代码
224
+
225
+ - 其中SecretKey和SecretID需要从腾讯云控制台获取
226
+
227
+ - 参数params中模型Model字段可以选择“deepseek-r1“和“deepseek-v3”
228
+
229
+ ```
230
+ # -*- coding: utf-8 -*-
231
+ import json
232
+
233
+ from tencentcloud.common.common_client import CommonClient
234
+ from tencentcloud.common import credential
235
+ from tencentcloud.common.exception.tencent_cloud_sdk_exception import TencentCloudSDKException
236
+ from tencentcloud.common.profile.client_profile import ClientProfile
237
+ from tencentcloud.common.profile.http_profile import HttpProfile
238
+
239
+ class NonStreamResponse(object):
240
+ def __init__(self):
241
+ self.response = ""
242
+
243
+ def _deserialize(self, obj):
244
+ self.response = json.dumps(obj)
245
+
246
+ try:
247
+ # 实例化一个认证对象,入参需要传入腾讯云账户 SecretId 和 SecretKey,此处还需注意密钥对的保密
248
+ # 代码泄露可能会导致 SecretId 和 SecretKey 泄露,并威胁账号下所有资源的安全性。以下代码示例仅供参考,建议采用更安全的方式来使用密钥,请参见:https://cloud.tencent.com/document/product/1278/85305
249
+ # 密钥可前往官网控制台 https://console.cloud.tencent.com/cam/capi 进行获取
250
+ cred = credential.Credential("", "")
251
+
252
+ httpProfile = HttpProfile()
253
+ httpProfile.endpoint = "lkeap.tencentcloudapi.com"
254
+ httpProfile.reqTimeout = 40000 # 流式接口可能耗时较长
255
+ clientProfile = ClientProfile()
256
+ clientProfile.httpProfile = httpProfile
257
+
258
+ params = "{\"Model\":\"deepseek-r1\",\"Messages\":[{\"Role\":\"user\",\"Content\":\"你好\"}],\"Stream\":true}";
259
+ common_client = CommonClient("lkeap", "2024-05-22", cred, "ap-guangzhou", profile=clientProfile)
260
+ resp = common_client._call_and_deserialize("ChatCompletions", json.loads(params), NonStreamResponse)
261
+ if isinstance(resp, NonStreamResponse): # 非流式响应
262
+ print(resp.response)
263
+ else: # 流式响应
264
+ for event in resp:
265
+ print(event)
266
+ except TencentCloudSDKException as err:
267
+ print(err)
268
+
269
+ ```
270
+
271
+ **DeepSeek-R1使用建议**
272
+
273
+ 1. 将温度设置在 0.5-0.7 范围内(建议为0.6),以防止无休止的重复或不连贯的输出。
274
+ 2. 避免添加system prompt,所有说明都应包含在user prompt中。
275
+ */
276
+ async ChatCompletions(req, cb) {
277
+ return this.request("ChatCompletions", req, cb);
278
+ }
186
279
  }
187
280
  exports.Client = Client;
@@ -1,3 +1,28 @@
1
+ /**
2
+ * ChatCompletions请求参数结构体
3
+ */
4
+ export interface ChatCompletionsRequest {
5
+ /**
6
+ * 模型名称
7
+ */
8
+ Model: string;
9
+ /**
10
+ * 会话列表
11
+ */
12
+ Messages: Array<Message>;
13
+ /**
14
+ * 是否流式输出
15
+ */
16
+ Stream?: boolean;
17
+ /**
18
+ * 控制生成的随机性,较高的值会产生更多样化的输出。
19
+ */
20
+ Temperature?: number;
21
+ /**
22
+ * 最大生成的token数量
23
+ */
24
+ MaxTokens?: number;
25
+ }
1
26
  /**
2
27
  * CreateSplitDocumentFlow请求参数结构体
3
28
  */
@@ -51,15 +76,6 @@ export interface CreateSplitDocumentFlowRequest {
51
76
  */
52
77
  Config?: CreateSplitDocumentFlowConfig;
53
78
  }
54
- /**
55
- * ImportQAs返回参数结构体
56
- */
57
- export interface ImportQAsResponse {
58
- /**
59
- * 唯一请求 ID,由服务端生成,每次请求都会返回(若请求因其他原因未能抵达服务端,则该次请求不会获得 RequestId)。定位问题时需要提供该次请求的 RequestId。
60
- */
61
- RequestId?: string;
62
- }
63
79
  /**
64
80
  * 检索结果的元数据
65
81
  */
@@ -168,6 +184,15 @@ export interface GetEmbeddingRequest {
168
184
  */
169
185
  Inputs: Array<string>;
170
186
  }
187
+ /**
188
+ * ImportQAs返回参数结构体
189
+ */
190
+ export interface ImportQAsResponse {
191
+ /**
192
+ * 唯一请求 ID,由服务端生成,每次请求都会返回(若请求因其他原因未能抵达服务端,则该次请求不会获得 RequestId)。定位问题时需要提供该次请求的 RequestId。
193
+ */
194
+ RequestId?: string;
195
+ }
171
196
  /**
172
197
  * UploadDocRealtime请求参数结构体
173
198
  */
@@ -357,6 +382,27 @@ export interface ModifyAttributeLabelRequest {
357
382
  */
358
383
  Labels?: Array<AttributeLabelItem>;
359
384
  }
385
+ /**
386
+ * GetReconstructDocumentResult返回参数结构体
387
+ */
388
+ export interface GetReconstructDocumentResultResponse {
389
+ /**
390
+ * 任务状态。- `Success`:执行完成- `Processing`:执行中- `Pause`: 暂停- `Failed`:执行失败- `WaitExecute`:等待执行
391
+ */
392
+ Status?: string;
393
+ /**
394
+ * 解析结果的临时下载地址。文件类型为zip压缩包,下载链接有效期30分钟
395
+ */
396
+ DocumentRecognizeResultUrl?: string;
397
+ /**
398
+ * 文档解析失败的页码
399
+ */
400
+ FailedPages?: Array<ReconstructDocumentFailedPage>;
401
+ /**
402
+ * 唯一请求 ID,由服务端生成,每次请求都会返回(若请求因其他原因未能抵达服务端,则该次请求不会获得 RequestId)。定位问题时需要提供该次请求的 RequestId。
403
+ */
404
+ RequestId?: string;
405
+ }
360
406
  /**
361
407
  * ReconstructDocumentSSE 功能配置参数
362
408
  */
@@ -452,25 +498,28 @@ export interface RetrieveKnowledgeRequest {
452
498
  AttributeLabels?: Array<LabelItem>;
453
499
  }
454
500
  /**
455
- * GetReconstructDocumentResult返回参数结构体
501
+ * 返回的回复, 支持多个
456
502
  */
457
- export interface GetReconstructDocumentResultResponse {
503
+ export interface Choice {
458
504
  /**
459
- * 任务状态。- `Success`:执行完成- `Processing`:执行中- `Pause`: 暂停- `Failed`:执行失败- `WaitExecute`:等待执行
505
+ * 结束标志位,可能为 stop、 sensitive或者tool_calls。
506
+ stop 表示输出正常结束。
507
+ sensitive 只在开启流式输出审核时会出现,表示安全审核未通过。
508
+ tool_calls 标识函数调用。
460
509
  */
461
- Status?: string;
510
+ FinishReason?: string;
462
511
  /**
463
- * 解析结果的临时下载地址。文件类型为zip压缩包,下载链接有效期30分钟
512
+ * 增量返回值,流式调用时使用该字段。
464
513
  */
465
- DocumentRecognizeResultUrl?: string;
514
+ Delta?: Delta;
466
515
  /**
467
- * 文档解析失败的页码
516
+ * 返回值,非流式调用时使用该字段。
468
517
  */
469
- FailedPages?: Array<ReconstructDocumentFailedPage>;
518
+ Message?: Message;
470
519
  /**
471
- * 唯一请求 ID,由服务端生成,每次请求都会返回(若请求因其他原因未能抵达服务端,则该次请求不会获得 RequestId)。定位问题时需要提供该次请求的 RequestId。
520
+ * 索引值,流式调用时使用该字段。
472
521
  */
473
- RequestId?: string;
522
+ Index?: number;
474
523
  }
475
524
  /**
476
525
  * 创建智能文档解析任务的配置信息
@@ -513,6 +562,23 @@ export interface RunRerankRequest {
513
562
  */
514
563
  Model?: string;
515
564
  }
565
+ /**
566
+ * 消耗量
567
+ */
568
+ export interface ChatUsage {
569
+ /**
570
+ * 输入token数
571
+ */
572
+ PromptTokens?: number;
573
+ /**
574
+ * 输出token数
575
+ */
576
+ CompletionTokens?: number;
577
+ /**
578
+ * 总token数
579
+ */
580
+ TotalTokens?: number;
581
+ }
516
582
  /**
517
583
  * GetSplitDocumentResult请求参数结构体
518
584
  */
@@ -522,6 +588,19 @@ export interface GetSplitDocumentResultRequest {
522
588
  */
523
589
  TaskId: string;
524
590
  }
591
+ /**
592
+ * 返回的内容
593
+ */
594
+ export interface Delta {
595
+ /**
596
+ * 角色名称。
597
+ */
598
+ Role?: string;
599
+ /**
600
+ * 内容详情。
601
+ */
602
+ Content?: string;
603
+ }
525
604
  /**
526
605
  * ReconstructDocumentSSE请求参数结构体
527
606
  */
@@ -792,6 +871,23 @@ export interface ModifyAttributeLabelResponse {
792
871
  */
793
872
  RequestId?: string;
794
873
  }
874
+ /**
875
+ * QueryRewrite返回参数结构体
876
+ */
877
+ export interface QueryRewriteResponse {
878
+ /**
879
+ * 改写结果
880
+ */
881
+ Content?: string;
882
+ /**
883
+ * 消耗量,返回输入token数,输出token数以及总token数
884
+ */
885
+ Usage?: Usage;
886
+ /**
887
+ * 唯一请求 ID,由服务端生成,每次请求都会返回(若请求因其他原因未能抵达服务端,则该次请求不会获得 RequestId)。定位问题时需要提供该次请求的 RequestId。
888
+ */
889
+ RequestId?: string;
890
+ }
795
891
  /**
796
892
  * UploadDoc请求参数结构体
797
893
  */
@@ -990,21 +1086,13 @@ export interface CreateReconstructDocumentFlowResponse {
990
1086
  RequestId?: string;
991
1087
  }
992
1088
  /**
993
- * QueryRewrite返回参数结构体
1089
+ * DeleteKnowledgeBase请求参数结构体
994
1090
  */
995
- export interface QueryRewriteResponse {
996
- /**
997
- * 改写结果
998
- */
999
- Content?: string;
1000
- /**
1001
- * 消耗量,返回输入token数,输出token数以及总token数
1002
- */
1003
- Usage?: Usage;
1091
+ export interface DeleteKnowledgeBaseRequest {
1004
1092
  /**
1005
- * 唯一请求 ID,由服务端生成,每次请求都会返回(若请求因其他原因未能抵达服务端,则该次请求不会获得 RequestId)。定位问题时需要提供该次请求的 RequestId。
1093
+ * 知识库ID
1006
1094
  */
1007
- RequestId?: string;
1095
+ KnowledgeBaseId: string;
1008
1096
  }
1009
1097
  /**
1010
1098
  * CreateQA请求参数结构体
@@ -1074,19 +1162,45 @@ export interface Message {
1074
1162
  * 内容
1075
1163
  */
1076
1164
  Content?: string;
1165
+ /**
1166
+ * 思维链内容。
1167
+ ReasoningConent参数仅支持出参,且只有deepseek-r1模型会返回。
1168
+ */
1169
+ ReasoningContent?: string;
1077
1170
  }
1078
1171
  /**
1079
1172
  * CreateKnowledgeBase请求参数结构体
1080
1173
  */
1081
1174
  export declare type CreateKnowledgeBaseRequest = null;
1082
1175
  /**
1083
- * DeleteKnowledgeBase请求参数结构体
1176
+ * ChatCompletions返回参数结构体
1084
1177
  */
1085
- export interface DeleteKnowledgeBaseRequest {
1178
+ export interface ChatCompletionsResponse {
1086
1179
  /**
1087
- * 知识库ID
1180
+ * Unix 时间戳,单位为秒。
1088
1181
  */
1089
- KnowledgeBaseId: string;
1182
+ Created?: number;
1183
+ /**
1184
+ * Token 统计信息。
1185
+ 按照总 Token 数量计费。
1186
+ */
1187
+ Usage?: ChatUsage;
1188
+ /**
1189
+ * 本次请求的 RequestId。
1190
+ */
1191
+ Id?: string;
1192
+ /**
1193
+ * 回复内容。
1194
+ */
1195
+ Choices?: Array<Choice>;
1196
+ /**
1197
+ * 模型名称。
1198
+ */
1199
+ Model?: string;
1200
+ /**
1201
+ * 唯一请求 ID,由服务端生成,每次请求都会返回(若请求因其他原因未能抵达服务端,则该次请求不会获得 RequestId)。定位问题时需要提供该次请求的 RequestId。本接口为流式响应接口,当请求成功时,RequestId 会被放在 HTTP 响应的 Header "X-TC-RequestId" 中。
1202
+ */
1203
+ RequestId?: string;
1090
1204
  }
1091
1205
  /**
1092
1206
  * DeleteDocs请求参数结构体
@@ -81,7 +81,11 @@ export interface CreateDBInstanceRequest {
81
81
  */
82
82
  SubnetId?: string;
83
83
  /**
84
- * 实例密码。自定义密码长度为8-32个字符,至少包含字母、数字和字符(!@#%^*()_)中的两种。
84
+ * 实例密码。设置要求如下:
85
+ - 字符个数为[8,32]。
86
+ - 可输入[A,Z]、[a,z]、[0,9]范围内的字符。
87
+ - 可输入的特殊字符包括:感叹号“!”,at“@”,警号“#“、百分号”%”、插入号“^”、星号“*”、括号“()”、下划线“_”。
88
+ - 不能设置单一的字母或者数字。
85
89
  */
86
90
  Password?: string;
87
91
  /**
@@ -251,7 +255,7 @@ export interface KillOpsRequest {
251
255
  */
252
256
  export interface InquirePriceRenewDBInstancesRequest {
253
257
  /**
254
- * 实例ID,格式如:cmgo-p8vn****。与云数据库控制台页面中显示的实例ID相同,接口单次最多只支持5个实例进行操作。
258
+ * 实例ID,格式如:cmgo-p8vn****。请登录[MongoDB 控制台](https://console.cloud.tencent.com/mongodb)在实例列表复制实例 ID,且单次最多同时查询5个实例。
255
259
  */
256
260
  InstanceIds: Array<string>;
257
261
  /**
@@ -287,23 +287,23 @@ export interface TemplatesMetadata {
287
287
  /**
288
288
  * 创建时间
289
289
  */
290
- CreatedTimestamp: number;
290
+ CreatedTimestamp?: number;
291
291
  /**
292
292
  * 模板名称
293
293
  */
294
- TemplateName: string;
294
+ TemplateName?: string;
295
295
  /**
296
296
  * 模板状态。1-审核中|0-已通过|2-拒绝|其它-不可用
297
297
  */
298
- TemplateStatus: number;
298
+ TemplateStatus?: number;
299
299
  /**
300
300
  * 模板ID
301
301
  */
302
- TemplateID: number;
302
+ TemplateID?: number;
303
303
  /**
304
304
  * 审核原因
305
305
  */
306
- ReviewReason: string;
306
+ ReviewReason?: string;
307
307
  }
308
308
  /**
309
309
  * 收件人列表详情
@@ -323,17 +323,14 @@ export interface ReceiverDetail {
323
323
  TemplateData?: string;
324
324
  /**
325
325
  * 无效原因
326
- 注意:此字段可能返回 null,表示取不到有效值。
327
326
  */
328
327
  Reason?: string;
329
328
  /**
330
329
  * 1:有效,2:无效
331
- 注意:此字段可能返回 null,表示取不到有效值。
332
330
  */
333
331
  Status?: number;
334
332
  /**
335
333
  * 收件人地址id
336
- 注意:此字段可能返回 null,表示取不到有效值。
337
334
  */
338
335
  EmailId?: number;
339
336
  }
@@ -397,36 +394,36 @@ export interface Volume {
397
394
  * 日期
398
395
  注意:此字段可能返回 null,表示取不到有效值。
399
396
  */
400
- SendDate: string;
397
+ SendDate?: string;
401
398
  /**
402
399
  * 邮件请求数量
403
400
  */
404
- RequestCount: number;
401
+ RequestCount?: number;
405
402
  /**
406
403
  * 腾讯云通过数量
407
404
  */
408
- AcceptedCount: number;
405
+ AcceptedCount?: number;
409
406
  /**
410
407
  * 送达数量
411
408
  */
412
- DeliveredCount: number;
409
+ DeliveredCount?: number;
413
410
  /**
414
411
  * 打开邮件的用户数量,根据收件人去重
415
412
  */
416
- OpenedCount: number;
413
+ OpenedCount?: number;
417
414
  /**
418
415
  * 点击了邮件中的链接数量用户数量
419
416
  */
420
- ClickedCount: number;
417
+ ClickedCount?: number;
421
418
  /**
422
419
  * 退信数量
423
420
  */
424
- BounceCount: number;
421
+ BounceCount?: number;
425
422
  /**
426
423
  * 取消订阅的用户数量
427
424
  注意:此字段可能返回 null,表示取不到有效值。
428
425
  */
429
- UnsubscribeCount: number;
426
+ UnsubscribeCount?: number;
430
427
  }
431
428
  /**
432
429
  * UpdateEmailIdentity请求参数结构体
@@ -703,12 +700,10 @@ export interface ReceiverData {
703
700
  Count?: number;
704
701
  /**
705
702
  * 收件人列表描述
706
- 注意:此字段可能返回 null,表示取不到有效值。
707
703
  */
708
704
  Desc?: string;
709
705
  /**
710
706
  * 列表状态(1 待上传 2 上传中 3 上传完成)
711
- 注意:此字段可能返回 null,表示取不到有效值。
712
707
  */
713
708
  ReceiversStatus?: number;
714
709
  /**
@@ -717,7 +712,6 @@ export interface ReceiverData {
717
712
  CreateTime?: string;
718
713
  /**
719
714
  * 无效收件人数量
720
- 注意:此字段可能返回 null,表示取不到有效值。
721
715
  */
722
716
  InvalidCount?: number;
723
717
  }
@@ -908,27 +902,22 @@ export interface ListEmailTemplatesRequest {
908
902
  export interface CreateReceiverDetailWithDataResponse {
909
903
  /**
910
904
  * 收件人总数
911
- 注意:此字段可能返回 null,表示取不到有效值。
912
905
  */
913
906
  TotalCount?: number;
914
907
  /**
915
908
  * 实际上传数量
916
- 注意:此字段可能返回 null,表示取不到有效值。
917
909
  */
918
910
  ValidCount?: number;
919
911
  /**
920
912
  * 数据过长数量
921
- 注意:此字段可能返回 null,表示取不到有效值。
922
913
  */
923
914
  TooLongCount?: number;
924
915
  /**
925
916
  * 邮件地址为空数量
926
- 注意:此字段可能返回 null,表示取不到有效值。
927
917
  */
928
918
  EmptyEmailCount?: number;
929
919
  /**
930
920
  * 重复数量
931
- 注意:此字段可能返回 null,表示取不到有效值。
932
921
  */
933
922
  RepeatCount?: number;
934
923
  /**
@@ -1274,7 +1263,6 @@ export interface BlackEmailAddress {
1274
1263
  EmailAddress?: string;
1275
1264
  /**
1276
1265
  * 被拉黑的理由
1277
- 注意:此字段可能返回 null,表示取不到有效值。
1278
1266
  */
1279
1267
  IspDesc?: string;
1280
1268
  }