tencentcloud-sdk-nodejs 4.0.1023 → 4.0.1025

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.
Files changed (32) hide show
  1. package/README.md +3 -3
  2. package/package.json +1 -1
  3. package/src/common/sdk_version.ts +1 -1
  4. package/src/services/cdb/v20170320/cdb_client.ts +4 -2
  5. package/src/services/cdwdoris/v20211228/cdwdoris_models.ts +0 -1
  6. package/src/services/lke/v20231130/lke_models.ts +12 -0
  7. package/src/services/lkeap/v20240522/lkeap_client.ts +101 -5
  8. package/src/services/lkeap/v20240522/lkeap_models.ts +109 -18
  9. package/src/services/mongodb/v20190725/mongodb_models.ts +6 -2
  10. package/src/services/ocr/v20181119/ocr_models.ts +2 -2
  11. package/src/services/ses/v20201002/ses_models.ts +13 -25
  12. package/src/services/tat/v20201028/tat_models.ts +7 -4
  13. package/src/services/tccatalog/v20241024/tccatalog_models.ts +14 -2
  14. package/src/services/trocket/v20230308/trocket_client.ts +12 -0
  15. package/src/services/trocket/v20230308/trocket_models.ts +37 -0
  16. package/tencentcloud/common/sdk_version.d.ts +1 -1
  17. package/tencentcloud/common/sdk_version.js +1 -1
  18. package/tencentcloud/services/cdb/v20170320/cdb_client.d.ts +3 -1
  19. package/tencentcloud/services/cdb/v20170320/cdb_client.js +3 -1
  20. package/tencentcloud/services/cdwdoris/v20211228/cdwdoris_models.d.ts +0 -1
  21. package/tencentcloud/services/lke/v20231130/lke_models.d.ts +12 -0
  22. package/tencentcloud/services/lkeap/v20240522/lkeap_client.d.ts +95 -2
  23. package/tencentcloud/services/lkeap/v20240522/lkeap_client.js +94 -1
  24. package/tencentcloud/services/lkeap/v20240522/lkeap_models.d.ts +106 -18
  25. package/tencentcloud/services/mongodb/v20190725/mongodb_models.d.ts +6 -2
  26. package/tencentcloud/services/ocr/v20181119/ocr_models.d.ts +2 -2
  27. package/tencentcloud/services/ses/v20201002/ses_models.d.ts +13 -25
  28. package/tencentcloud/services/tat/v20201028/tat_models.d.ts +7 -4
  29. package/tencentcloud/services/tccatalog/v20241024/tccatalog_models.d.ts +14 -2
  30. package/tencentcloud/services/trocket/v20230308/trocket_client.d.ts +5 -1
  31. package/tencentcloud/services/trocket/v20230308/trocket_client.js +6 -0
  32. package/tencentcloud/services/trocket/v20230308/trocket_models.d.ts +35 -0
@@ -135,6 +135,7 @@ import {
135
135
  DescribeMQTTMessageRequest,
136
136
  CreateRoleResponse,
137
137
  DescribeMQTTTopicListResponse,
138
+ ModifyInstanceEndpointRequest,
138
139
  SourceClusterGroupConfig,
139
140
  DescribeMQTTUserListRequest,
140
141
  ModifyMQTTInstanceResponse,
@@ -158,6 +159,7 @@ import {
158
159
  DeleteTopicResponse,
159
160
  DescribeMQTTInstanceCertResponse,
160
161
  DescribeMQTTTopicResponse,
162
+ ModifyInstanceEndpointResponse,
161
163
  DescribeInstanceRequest,
162
164
  DescribeProductSKUsResponse,
163
165
  DescribeMQTTMessageListRequest,
@@ -572,6 +574,16 @@ TopicName,主题名称过滤
572
574
  return this.request("DescribeInstance", req, cb)
573
575
  }
574
576
 
577
+ /**
578
+ * 修改 RocketMQ 5.x 集群接入点。
579
+ */
580
+ async ModifyInstanceEndpoint(
581
+ req: ModifyInstanceEndpointRequest,
582
+ cb?: (error: string, rep: ModifyInstanceEndpointResponse) => void
583
+ ): Promise<ModifyInstanceEndpointResponse> {
584
+ return this.request("ModifyInstanceEndpoint", req, cb)
585
+ }
586
+
575
587
  /**
576
588
  * 获取主题列表,Filter参数使用说明如下:
577
589
 
@@ -3106,6 +3106,33 @@ export interface DescribeMQTTTopicListResponse {
3106
3106
  RequestId?: string
3107
3107
  }
3108
3108
 
3109
+ /**
3110
+ * ModifyInstanceEndpoint请求参数结构体
3111
+ */
3112
+ export interface ModifyInstanceEndpointRequest {
3113
+ /**
3114
+ * 集群ID
3115
+ */
3116
+ InstanceId: string
3117
+ /**
3118
+ * 接入点类型,
3119
+ PUBLIC 公网
3120
+ */
3121
+ Type: string
3122
+ /**
3123
+ * 公网带宽,Mbps为单位
3124
+ */
3125
+ Bandwidth?: number
3126
+ /**
3127
+ * 公网安全组信息
3128
+ */
3129
+ IpRules?: Array<IpRule>
3130
+ /**
3131
+ * 公网是否按流量计费
3132
+ */
3133
+ BillingFlow?: boolean
3134
+ }
3135
+
3109
3136
  /**
3110
3137
  * 消费组配置信息
3111
3138
  */
@@ -3698,6 +3725,16 @@ export interface DescribeMQTTTopicResponse {
3698
3725
  RequestId?: string
3699
3726
  }
3700
3727
 
3728
+ /**
3729
+ * ModifyInstanceEndpoint返回参数结构体
3730
+ */
3731
+ export interface ModifyInstanceEndpointResponse {
3732
+ /**
3733
+ * 唯一请求 ID,由服务端生成,每次请求都会返回(若请求因其他原因未能抵达服务端,则该次请求不会获得 RequestId)。定位问题时需要提供该次请求的 RequestId。
3734
+ */
3735
+ RequestId?: string
3736
+ }
3737
+
3701
3738
  /**
3702
3739
  * DescribeInstance请求参数结构体
3703
3740
  */
@@ -1 +1 @@
1
- export declare const sdkVersion = "4.0.1023";
1
+ export declare const sdkVersion = "4.0.1025";
@@ -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.1023";
4
+ exports.sdkVersion = "4.0.1025";
@@ -546,7 +546,9 @@ export declare class Client extends AbstractClient {
546
546
  */
547
547
  DescribeAccounts(req: DescribeAccountsRequest, cb?: (error: string, rep: DescribeAccountsResponse) => void): Promise<DescribeAccountsResponse>;
548
548
  /**
549
- * 通过该 API 可以查询实例的 CPU 弹性扩容策略
549
+ * DescribeCpuExpandStrategy
550
+
551
+ 通过该 API 可以查询实例的 CPU 弹性扩容策略
550
552
  */
551
553
  DescribeCpuExpandStrategy(req: DescribeCpuExpandStrategyRequest, cb?: (error: string, rep: DescribeCpuExpandStrategyResponse) => void): Promise<DescribeCpuExpandStrategyResponse>;
552
554
  /**
@@ -814,7 +814,9 @@ class Client extends abstract_client_1.AbstractClient {
814
814
  return this.request("DescribeAccounts", req, cb);
815
815
  }
816
816
  /**
817
- * 通过该 API 可以查询实例的 CPU 弹性扩容策略
817
+ * DescribeCpuExpandStrategy
818
+
819
+ 通过该 API 可以查询实例的 CPU 弹性扩容策略
818
820
  */
819
821
  async DescribeCpuExpandStrategy(req, cb) {
820
822
  return this.request("DescribeCpuExpandStrategy", req, cb);
@@ -1640,7 +1640,6 @@ export interface CreateBackUpScheduleRequest {
1640
1640
  export interface ActionAlterUserResponse {
1641
1641
  /**
1642
1642
  * 错误信息
1643
- 注意:此字段可能返回 null,表示取不到有效值。
1644
1643
  */
1645
1644
  ErrorMsg?: string;
1646
1645
  /**
@@ -5146,6 +5146,18 @@ export interface ModelInfo {
5146
5146
  注意:此字段可能返回 null,表示取不到有效值。
5147
5147
  */
5148
5148
  MaxTokens?: ModelParameter;
5149
+ /**
5150
+ * 模型来源 Hunyuan:腾讯混元大模型,Industry:腾讯云行业大模型,Experience:新模型体验
5151
+ */
5152
+ Source?: string;
5153
+ /**
5154
+ * 模型图标
5155
+ */
5156
+ Icon?: string;
5157
+ /**
5158
+ * 是否免费
5159
+ */
5160
+ IsFree?: boolean;
5149
5161
  }
5150
5162
  /**
5151
5163
  * DeleteRejectedQuestion请求参数结构体
@@ -1,6 +1,6 @@
1
1
  import { AbstractClient } from "../../../common/abstract_client";
2
2
  import { ClientConfig } from "../../../common/interface";
3
- import { ChatCompletionsRequest, CreateSplitDocumentFlowRequest, ListQAsRequest, ReconstructDocumentSSEResponse, GetEmbeddingRequest, ImportQAsResponse, 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, QueryRewriteResponse, UploadDocRequest, DeleteQAsResponse, CreateKnowledgeBaseResponse, GetEmbeddingResponse, QueryRewriteRequest, RunRerankResponse, CreateReconstructDocumentFlowResponse, ChatCompletionsResponse, 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
@@ -114,7 +114,100 @@ export declare class Client extends AbstractClient {
114
114
  */
115
115
  UploadDoc(req: UploadDocRequest, cb?: (error: string, rep: UploadDocResponse) => void): Promise<UploadDocResponse>;
116
116
  /**
117
- * 对话
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
+ ### Openai兼容协议接口
137
+ 知识引擎原子能力大模型对话 API 兼容了 OpenAI 的接口规范,这意味着您可以直接使用 OpenAI 官方提供的 SDK 来调用大模型对话接口。您仅需要将 base_url 和 [api_key](https://cloud.tencent.com/document/product/1772/115970) 替换成相关配置,不需要对应用做额外修改,即可无缝将您的应用切换到相应的大模型。
138
+ > base_url: https://api.lkeap.cloud.tencent.com/v1
139
+
140
+ > api_key的获取请参考[API KEY管理](https://cloud.tencent.com/document/product/1772/115970)
141
+
142
+
143
+ #### 快速接入
144
+ 1. 完成[实名认证](https://console.cloud.tencent.com/developer/auth)。
145
+ 2. 主账户前往[控制台](https://console.cloud.tencent.com/lkeap)开通服务。若为子账户,需由主账号在[权限管理](https://console.cloud.tencent.com/cam)中为子账号授权,关联预设策略,策略名称:QcloudLKEAPFullAccess。
146
+ 3. 通过API Explorer[在线调试](https://console.cloud.tencent.com/api/explorer?Product=lkeap&Version=2024-05-22&Action=ChatCompletions)。
147
+ 4. 使用[官方 SDK ](https://cloud.tencent.com/document/product/1772/115963#SDK)调用本接口(支持Python/Java/PHP/Go/Node.js/.NET等语言)。
148
+
149
+ -----------
150
+
151
+ ### SDK调用示例
152
+ 通过本地代码调用本接口(支持Python/Java/PHP/Go/Node.js/.NET等语言):下面的代码以 Python 语言为例,展示如何访问腾讯云上的DeepSeek模型API的样例。
153
+ (1)安装环境
154
+ ```
155
+ python3 -m pip install --upgrade tencentcloud-sdk-python-common
156
+ python3 -m pip install --upgrade tencentcloud-sdk-python-lkeap
157
+ ```
158
+
159
+ (2)示例代码
160
+
161
+ - 其中SecretKey和SecretID需要从腾讯云控制台获取
162
+
163
+ - 参数params中模型Model字段可以选择“deepseek-r1“和“deepseek-v3”
164
+
165
+ ```
166
+ # -*- coding: utf-8 -*-
167
+ import json
168
+
169
+ from tencentcloud.common.common_client import CommonClient
170
+ from tencentcloud.common import credential
171
+ from tencentcloud.common.exception.tencent_cloud_sdk_exception import TencentCloudSDKException
172
+ from tencentcloud.common.profile.client_profile import ClientProfile
173
+ from tencentcloud.common.profile.http_profile import HttpProfile
174
+
175
+ class NonStreamResponse(object):
176
+ def __init__(self):
177
+ self.response = ""
178
+
179
+ def _deserialize(self, obj):
180
+ self.response = json.dumps(obj)
181
+
182
+ try:
183
+ # 实例化一个认证对象,入参需要传入腾讯云账户 SecretId 和 SecretKey,此处还需注意密钥对的保密
184
+ # 代码泄露可能会导致 SecretId 和 SecretKey 泄露,并威胁账号下所有资源的安全性。以下代码示例仅供参考,建议采用更安全的方式来使用密钥,请参见:https://cloud.tencent.com/document/product/1278/85305
185
+ # 密钥可前往官网控制台 https://console.cloud.tencent.com/cam/capi 进行获取
186
+ cred = credential.Credential("", "")
187
+
188
+ httpProfile = HttpProfile()
189
+ httpProfile.endpoint = "lkeap.tencentcloudapi.com"
190
+ httpProfile.reqTimeout = 40000 # 流式接口可能耗时较长
191
+ clientProfile = ClientProfile()
192
+ clientProfile.httpProfile = httpProfile
193
+
194
+ params = "{\"Model\":\"deepseek-r1\",\"Messages\":[{\"Role\":\"user\",\"Content\":\"你好\"}],\"Stream\":true}";
195
+ common_client = CommonClient("lkeap", "2024-05-22", cred, "ap-guangzhou", profile=clientProfile)
196
+ resp = common_client._call_and_deserialize("ChatCompletions", json.loads(params), NonStreamResponse)
197
+ if isinstance(resp, NonStreamResponse): # 非流式响应
198
+ print(resp.response)
199
+ else: # 流式响应
200
+ for event in resp:
201
+ print(event)
202
+ except TencentCloudSDKException as err:
203
+ print(err)
204
+
205
+ ```
206
+
207
+ **DeepSeek-R1使用建议**
208
+
209
+ 1. 将温度设置在 0.5-0.7 范围内(建议为0.6),以防止无休止的重复或不连贯的输出。
210
+ 2. 避免添加system prompt,所有说明都应包含在user prompt中。
118
211
  */
119
212
  ChatCompletions(req: ChatCompletionsRequest, cb?: (error: string, rep: ChatCompletionsResponse) => void): Promise<ChatCompletionsResponse>;
120
213
  }
@@ -184,7 +184,100 @@ class Client extends abstract_client_1.AbstractClient {
184
184
  return this.request("UploadDoc", req, cb);
185
185
  }
186
186
  /**
187
- * 对话
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
+ ### Openai兼容协议接口
207
+ 知识引擎原子能力大模型对话 API 兼容了 OpenAI 的接口规范,这意味着您可以直接使用 OpenAI 官方提供的 SDK 来调用大模型对话接口。您仅需要将 base_url 和 [api_key](https://cloud.tencent.com/document/product/1772/115970) 替换成相关配置,不需要对应用做额外修改,即可无缝将您的应用切换到相应的大模型。
208
+ > base_url: https://api.lkeap.cloud.tencent.com/v1
209
+
210
+ > api_key的获取请参考[API KEY管理](https://cloud.tencent.com/document/product/1772/115970)
211
+
212
+
213
+ #### 快速接入
214
+ 1. 完成[实名认证](https://console.cloud.tencent.com/developer/auth)。
215
+ 2. 主账户前往[控制台](https://console.cloud.tencent.com/lkeap)开通服务。若为子账户,需由主账号在[权限管理](https://console.cloud.tencent.com/cam)中为子账号授权,关联预设策略,策略名称:QcloudLKEAPFullAccess。
216
+ 3. 通过API Explorer[在线调试](https://console.cloud.tencent.com/api/explorer?Product=lkeap&Version=2024-05-22&Action=ChatCompletions)。
217
+ 4. 使用[官方 SDK ](https://cloud.tencent.com/document/product/1772/115963#SDK)调用本接口(支持Python/Java/PHP/Go/Node.js/.NET等语言)。
218
+
219
+ -----------
220
+
221
+ ### SDK调用示例
222
+ 通过本地代码调用本接口(支持Python/Java/PHP/Go/Node.js/.NET等语言):下面的代码以 Python 语言为例,展示如何访问腾讯云上的DeepSeek模型API的样例。
223
+ (1)安装环境
224
+ ```
225
+ python3 -m pip install --upgrade tencentcloud-sdk-python-common
226
+ python3 -m pip install --upgrade tencentcloud-sdk-python-lkeap
227
+ ```
228
+
229
+ (2)示例代码
230
+
231
+ - 其中SecretKey和SecretID需要从腾讯云控制台获取
232
+
233
+ - 参数params中模型Model字段可以选择“deepseek-r1“和“deepseek-v3”
234
+
235
+ ```
236
+ # -*- coding: utf-8 -*-
237
+ import json
238
+
239
+ from tencentcloud.common.common_client import CommonClient
240
+ from tencentcloud.common import credential
241
+ from tencentcloud.common.exception.tencent_cloud_sdk_exception import TencentCloudSDKException
242
+ from tencentcloud.common.profile.client_profile import ClientProfile
243
+ from tencentcloud.common.profile.http_profile import HttpProfile
244
+
245
+ class NonStreamResponse(object):
246
+ def __init__(self):
247
+ self.response = ""
248
+
249
+ def _deserialize(self, obj):
250
+ self.response = json.dumps(obj)
251
+
252
+ try:
253
+ # 实例化一个认证对象,入参需要传入腾讯云账户 SecretId 和 SecretKey,此处还需注意密钥对的保密
254
+ # 代码泄露可能会导致 SecretId 和 SecretKey 泄露,并威胁账号下所有资源的安全性。以下代码示例仅供参考,建议采用更安全的方式来使用密钥,请参见:https://cloud.tencent.com/document/product/1278/85305
255
+ # 密钥可前往官网控制台 https://console.cloud.tencent.com/cam/capi 进行获取
256
+ cred = credential.Credential("", "")
257
+
258
+ httpProfile = HttpProfile()
259
+ httpProfile.endpoint = "lkeap.tencentcloudapi.com"
260
+ httpProfile.reqTimeout = 40000 # 流式接口可能耗时较长
261
+ clientProfile = ClientProfile()
262
+ clientProfile.httpProfile = httpProfile
263
+
264
+ params = "{\"Model\":\"deepseek-r1\",\"Messages\":[{\"Role\":\"user\",\"Content\":\"你好\"}],\"Stream\":true}";
265
+ common_client = CommonClient("lkeap", "2024-05-22", cred, "ap-guangzhou", profile=clientProfile)
266
+ resp = common_client._call_and_deserialize("ChatCompletions", json.loads(params), NonStreamResponse)
267
+ if isinstance(resp, NonStreamResponse): # 非流式响应
268
+ print(resp.response)
269
+ else: # 流式响应
270
+ for event in resp:
271
+ print(event)
272
+ except TencentCloudSDKException as err:
273
+ print(err)
274
+
275
+ ```
276
+
277
+ **DeepSeek-R1使用建议**
278
+
279
+ 1. 将温度设置在 0.5-0.7 范围内(建议为0.6),以防止无休止的重复或不连贯的输出。
280
+ 2. 避免添加system prompt,所有说明都应包含在user prompt中。
188
281
  */
189
282
  async ChatCompletions(req, cb) {
190
283
  return this.request("ChatCompletions", req, cb);
@@ -14,6 +14,14 @@ export interface ChatCompletionsRequest {
14
14
  * 是否流式输出
15
15
  */
16
16
  Stream?: boolean;
17
+ /**
18
+ * 控制生成的随机性,较高的值会产生更多样化的输出。
19
+ */
20
+ Temperature?: number;
21
+ /**
22
+ * 最大生成的token数量
23
+ */
24
+ MaxTokens?: number;
17
25
  }
18
26
  /**
19
27
  * CreateSplitDocumentFlow请求参数结构体
@@ -374,6 +382,27 @@ export interface ModifyAttributeLabelRequest {
374
382
  */
375
383
  Labels?: Array<AttributeLabelItem>;
376
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
+ }
377
406
  /**
378
407
  * ReconstructDocumentSSE 功能配置参数
379
408
  */
@@ -469,25 +498,28 @@ export interface RetrieveKnowledgeRequest {
469
498
  AttributeLabels?: Array<LabelItem>;
470
499
  }
471
500
  /**
472
- * GetReconstructDocumentResult返回参数结构体
501
+ * 返回的回复, 支持多个
473
502
  */
474
- export interface GetReconstructDocumentResultResponse {
503
+ export interface Choice {
475
504
  /**
476
- * 任务状态。- `Success`:执行完成- `Processing`:执行中- `Pause`: 暂停- `Failed`:执行失败- `WaitExecute`:等待执行
505
+ * 结束标志位,可能为 stop、 sensitive或者tool_calls。
506
+ stop 表示输出正常结束。
507
+ sensitive 只在开启流式输出审核时会出现,表示安全审核未通过。
508
+ tool_calls 标识函数调用。
477
509
  */
478
- Status?: string;
510
+ FinishReason?: string;
479
511
  /**
480
- * 解析结果的临时下载地址。文件类型为zip压缩包,下载链接有效期30分钟
512
+ * 增量返回值,流式调用时使用该字段。
481
513
  */
482
- DocumentRecognizeResultUrl?: string;
514
+ Delta?: Delta;
483
515
  /**
484
- * 文档解析失败的页码
516
+ * 返回值,非流式调用时使用该字段。
485
517
  */
486
- FailedPages?: Array<ReconstructDocumentFailedPage>;
518
+ Message?: Message;
487
519
  /**
488
- * 唯一请求 ID,由服务端生成,每次请求都会返回(若请求因其他原因未能抵达服务端,则该次请求不会获得 RequestId)。定位问题时需要提供该次请求的 RequestId。
520
+ * 索引值,流式调用时使用该字段。
489
521
  */
490
- RequestId?: string;
522
+ Index?: number;
491
523
  }
492
524
  /**
493
525
  * 创建智能文档解析任务的配置信息
@@ -530,6 +562,23 @@ export interface RunRerankRequest {
530
562
  */
531
563
  Model?: string;
532
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
+ }
533
582
  /**
534
583
  * GetSplitDocumentResult请求参数结构体
535
584
  */
@@ -539,6 +588,19 @@ export interface GetSplitDocumentResultRequest {
539
588
  */
540
589
  TaskId: string;
541
590
  }
591
+ /**
592
+ * 返回的内容
593
+ */
594
+ export interface Delta {
595
+ /**
596
+ * 角色名称。
597
+ */
598
+ Role?: string;
599
+ /**
600
+ * 内容详情。
601
+ */
602
+ Content?: string;
603
+ }
542
604
  /**
543
605
  * ReconstructDocumentSSE请求参数结构体
544
606
  */
@@ -1024,13 +1086,13 @@ export interface CreateReconstructDocumentFlowResponse {
1024
1086
  RequestId?: string;
1025
1087
  }
1026
1088
  /**
1027
- * ChatCompletions返回参数结构体
1089
+ * DeleteKnowledgeBase请求参数结构体
1028
1090
  */
1029
- export interface ChatCompletionsResponse {
1091
+ export interface DeleteKnowledgeBaseRequest {
1030
1092
  /**
1031
- * 唯一请求 ID,由服务端生成,每次请求都会返回(若请求因其他原因未能抵达服务端,则该次请求不会获得 RequestId)。定位问题时需要提供该次请求的 RequestId。本接口为流式响应接口,当请求成功时,RequestId 会被放在 HTTP 响应的 Header "X-TC-RequestId" 中。
1093
+ * 知识库ID
1032
1094
  */
1033
- RequestId?: string;
1095
+ KnowledgeBaseId: string;
1034
1096
  }
1035
1097
  /**
1036
1098
  * CreateQA请求参数结构体
@@ -1100,19 +1162,45 @@ export interface Message {
1100
1162
  * 内容
1101
1163
  */
1102
1164
  Content?: string;
1165
+ /**
1166
+ * 思维链内容。
1167
+ ReasoningConent参数仅支持出参,且只有deepseek-r1模型会返回。
1168
+ */
1169
+ ReasoningContent?: string;
1103
1170
  }
1104
1171
  /**
1105
1172
  * CreateKnowledgeBase请求参数结构体
1106
1173
  */
1107
1174
  export declare type CreateKnowledgeBaseRequest = null;
1108
1175
  /**
1109
- * DeleteKnowledgeBase请求参数结构体
1176
+ * ChatCompletions返回参数结构体
1110
1177
  */
1111
- export interface DeleteKnowledgeBaseRequest {
1178
+ export interface ChatCompletionsResponse {
1112
1179
  /**
1113
- * 知识库ID
1180
+ * Unix 时间戳,单位为秒。
1114
1181
  */
1115
- 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;
1116
1204
  }
1117
1205
  /**
1118
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
  /**
@@ -2719,7 +2719,7 @@ export interface RideHailingDriverLicenseOCRRequest {
2719
2719
  */
2720
2720
  ImageBase64?: string;
2721
2721
  /**
2722
- * 图片的 Url 地址。要求图片经Base64编码后不超过 7M,分辨率建议500*800以上,支持PNG、JPG、JPEG、BMP格式。建议卡片部分占据图片2/3以上。图片下载时间不超过 3 秒。
2722
+ * 图片的 Url 地址。要求图片经Base64编码后不超过 7M,分辨率建议500\*800以上,支持PNG、JPG、JPEG、BMP格式。建议卡片部分占据图片2/3以上。图片下载时间不超过 3 秒。
2723
2723
  建议图片存储于腾讯云,可保障更高的下载速度和稳定性。
2724
2724
  */
2725
2725
  ImageUrl?: string;
@@ -10481,7 +10481,7 @@ export interface RideHailingTransportLicenseOCRRequest {
10481
10481
  */
10482
10482
  ImageBase64?: string;
10483
10483
  /**
10484
- * 图片的 Url 地址。要求图片经Base64编码后不超过 7M,分辨率建议500*800以上,支持PNG、JPG、JPEG、BMP格式。建议卡片部分占据图片2/3以上。图片下载时间不超过 3 秒。
10484
+ * 图片的 Url 地址。要求图片经Base64编码后不超过 7M,分辨率建议500\*800以上,支持PNG、JPG、JPEG、BMP格式。建议卡片部分占据图片2/3以上。图片下载时间不超过 3 秒。
10485
10485
  建议图片存储于腾讯云,可保障更高的下载速度和稳定性。
10486
10486
  */
10487
10487
  ImageUrl?: string;