tencentcloud-sdk-nodejs 4.0.741 → 4.0.742

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/CHANGELOG.md CHANGED
@@ -1,3 +1,31 @@
1
+ # Release 4.0.742
2
+
3
+ ## 腾讯混元大模型(hunyuan) 版本:2023-09-01
4
+
5
+ ### 第 1 次发布
6
+
7
+ 发布时间:2023-11-23 11:01:12
8
+
9
+ 本次发布包含了以下内容:
10
+
11
+ 改善已有的文档。
12
+
13
+ 新增接口:
14
+
15
+ * [ChatPro](https://cloud.tencent.com/document/api/1729/101837)
16
+ * [ChatStd](https://cloud.tencent.com/document/api/1729/101836)
17
+ * [GetTokenCount](https://cloud.tencent.com/document/api/1729/101835)
18
+
19
+ 新增数据结构:
20
+
21
+ * [Choice](https://cloud.tencent.com/document/api/1729/101838#Choice)
22
+ * [Delta](https://cloud.tencent.com/document/api/1729/101838#Delta)
23
+ * [ErrorMsg](https://cloud.tencent.com/document/api/1729/101838#ErrorMsg)
24
+ * [Message](https://cloud.tencent.com/document/api/1729/101838#Message)
25
+ * [Usage](https://cloud.tencent.com/document/api/1729/101838#Usage)
26
+
27
+
28
+
1
29
  # Release 4.0.741
2
30
 
3
31
  ## 云服务器(cvm) 版本:2017-03-12
@@ -1,179 +1,10 @@
1
1
  # 本版本更新包含以下内容:
2
2
 
3
- ## 云服务器(cvm) 版本:2017-03-12
4
-
5
- ### 第 121 次发布
6
-
7
- 发布时间:2023-11-23 01:14:32
8
-
9
- 本次发布包含了以下内容:
10
-
11
- 改善已有的文档。
12
-
13
- 修改接口:
14
-
15
- * [ModifyInstancesAttribute](https://cloud.tencent.com/document/api/213/15739)
16
-
17
- * 新增入参:UserData
18
-
19
-
20
-
21
-
22
- ## Elasticsearch Service(es) 版本:2018-04-16
23
-
24
- ### 第 50 次发布
25
-
26
- 发布时间:2023-11-23 01:18:36
27
-
28
- 本次发布包含了以下内容:
29
-
30
- 改善已有的文档。
31
-
32
- 修改接口:
33
-
34
- * [RestartInstance](https://cloud.tencent.com/document/api/845/30630)
35
-
36
- * 新增入参:UpgradeKernel
37
-
38
- * [UpdateInstance](https://cloud.tencent.com/document/api/845/30629)
39
-
40
- * 新增入参:KibanaPrivateDomain, CerebroPrivateDomain
41
-
42
-
43
- 修改数据结构:
44
-
45
- * [InstanceInfo](https://cloud.tencent.com/document/api/845/30634#InstanceInfo)
46
-
47
- * 新增成员:KibanaPrivateVip, CustomKibanaPrivateUrl
48
-
49
- * [OptionalWebServiceInfo](https://cloud.tencent.com/document/api/845/30634#OptionalWebServiceInfo)
50
-
51
- * 新增成员:PrivateVip, CustomPrivateUrl
52
-
53
-
3
+ ## 腾讯混元大模型(hunyuan) 版本:2023-09-01
54
4
 
5
+ ### 第 1 次发布
55
6
 
56
- ## 腾讯电子签企业版(ess) 版本:2020-11-11
57
-
58
- ### 第 136 次发布
59
-
60
- 发布时间:2023-11-23 01:18:49
61
-
62
- 本次发布包含了以下内容:
63
-
64
- 改善已有的文档。
65
-
66
- 修改接口:
67
-
68
- * [CreateSchemeUrl](https://cloud.tencent.com/document/api/1323/70359)
69
-
70
- * 新增入参:IdCardType, IdCardNumber
71
-
72
-
73
-
74
-
75
- ## 腾讯电子签(基础版)(essbasic) 版本:2021-05-26
76
-
77
- ### 第 133 次发布
78
-
79
- 发布时间:2023-11-23 01:19:06
80
-
81
- 本次发布包含了以下内容:
82
-
83
- 改善已有的文档。
84
-
85
- 修改接口:
86
-
87
- * [CreateSignUrls](https://cloud.tencent.com/document/api/1420/61522)
88
-
89
- * 新增入参:IdCardType, IdCardNumber
90
-
91
-
92
- 修改数据结构:
93
-
94
- * [FillApproverInfo](https://cloud.tencent.com/document/api/1420/61525#FillApproverInfo)
95
-
96
- * <font color="#dd0000">**修改成员**:</font>NotChannelOrganization
97
-
98
-
99
-
100
-
101
- ## 腾讯电子签(基础版)(essbasic) 版本:2020-12-22
102
-
103
-
104
-
105
- ## 腾讯云区块链服务平台 TBaaS(tbaas) 版本:2018-04-16
106
-
107
- ### 第 20 次发布
108
-
109
- 发布时间:2023-11-23 01:26:18
110
-
111
- 本次发布包含了以下内容:
112
-
113
- 改善已有的文档。
114
-
115
- 修改接口:
116
-
117
- * [DownloadUserCert](https://cloud.tencent.com/document/api/663/38516)
118
-
119
- * 新增出参:Cert
120
-
121
- * [Invoke](https://cloud.tencent.com/document/api/663/19464)
122
-
123
- * 新增出参:TxId
124
-
125
-
126
-
127
-
128
- ## 容器镜像服务(tcr) 版本:2019-09-24
129
-
130
- ### 第 62 次发布
131
-
132
- 发布时间:2023-11-23 01:27:00
133
-
134
- 本次发布包含了以下内容:
135
-
136
- 改善已有的文档。
137
-
138
- <font color="#dd0000">**预下线接口**:</font>
139
-
140
- * CreateCustomAccount
141
- * DeleteCustomAccount
142
- * DescribeCustomAccounts
143
- * ModifyCustomAccount
144
-
145
-
146
-
147
- ## 微服务引擎 TSE(tse) 版本:2020-12-07
148
-
149
- ### 第 54 次发布
150
-
151
- 发布时间:2023-11-23 01:30:34
152
-
153
- 本次发布包含了以下内容:
154
-
155
- 改善已有的文档。
156
-
157
- 新增接口:
158
-
159
- * [DeleteWafDomains](https://cloud.tencent.com/document/api/1364/101828)
160
- * [DescribeWafDomains](https://cloud.tencent.com/document/api/1364/101827)
161
- * [DescribeWafProtection](https://cloud.tencent.com/document/api/1364/101826)
162
-
163
- 新增数据结构:
164
-
165
- * [DescribeWafDomainsResult](https://cloud.tencent.com/document/api/1364/54942#DescribeWafDomainsResult)
166
- * [DescribeWafProtectionResult](https://cloud.tencent.com/document/api/1364/54942#DescribeWafProtectionResult)
167
- * [RouteWafStatus](https://cloud.tencent.com/document/api/1364/54942#RouteWafStatus)
168
- * [ServiceWafStatus](https://cloud.tencent.com/document/api/1364/54942#ServiceWafStatus)
169
-
170
-
171
-
172
- ## 数据开发治理平台 WeData(wedata) 版本:2021-08-20
173
-
174
- ### 第 59 次发布
175
-
176
- 发布时间:2023-11-23 01:33:33
7
+ 发布时间:2023-11-23 11:01:12
177
8
 
178
9
  本次发布包含了以下内容:
179
10
 
@@ -181,12 +12,17 @@
181
12
 
182
13
  新增接口:
183
14
 
184
- * [DescribeColumnsMeta](https://cloud.tencent.com/document/api/1267/101829)
15
+ * [ChatPro](https://cloud.tencent.com/document/api/1729/101837)
16
+ * [ChatStd](https://cloud.tencent.com/document/api/1729/101836)
17
+ * [GetTokenCount](https://cloud.tencent.com/document/api/1729/101835)
185
18
 
186
19
  新增数据结构:
187
20
 
188
- * [ColumnMeta](https://cloud.tencent.com/document/api/1267/76336#ColumnMeta)
189
- * [Pair](https://cloud.tencent.com/document/api/1267/76336#Pair)
21
+ * [Choice](https://cloud.tencent.com/document/api/1729/101838#Choice)
22
+ * [Delta](https://cloud.tencent.com/document/api/1729/101838#Delta)
23
+ * [ErrorMsg](https://cloud.tencent.com/document/api/1729/101838#ErrorMsg)
24
+ * [Message](https://cloud.tencent.com/document/api/1729/101838#Message)
25
+ * [Usage](https://cloud.tencent.com/document/api/1729/101838#Usage)
190
26
 
191
27
 
192
28
 
@@ -66170,6 +66006,33 @@
66170
66006
 
66171
66007
 
66172
66008
 
66009
+ ## 腾讯混元大模型(hunyuan) 版本:2023-09-01
66010
+
66011
+ ### 第 1 次发布
66012
+
66013
+ 发布时间:2023-11-23 11:01:12
66014
+
66015
+ 本次发布包含了以下内容:
66016
+
66017
+ 改善已有的文档。
66018
+
66019
+ 新增接口:
66020
+
66021
+ * [[ChatPro](https://cloud.tencent.com/document/api/1729/101837)](https://cloud.tencent.com/document/api/#/#)
66022
+ * [[ChatStd](https://cloud.tencent.com/document/api/1729/101836)](https://cloud.tencent.com/document/api/#/#)
66023
+ * [[GetTokenCount](https://cloud.tencent.com/document/api/1729/101835)](https://cloud.tencent.com/document/api/#/#)
66024
+
66025
+ 新增数据结构:
66026
+
66027
+ * [[Choice](https://cloud.tencent.com/document/api/1729/101838#Choice)](https://cloud.tencent.com/document/api/1729/101838#[Choice](https://cloud.tencent.com/document/api/1729/101838#Choice))
66028
+ * [[Delta](https://cloud.tencent.com/document/api/1729/101838#Delta)](https://cloud.tencent.com/document/api/1729/101838#[Delta](https://cloud.tencent.com/document/api/1729/101838#Delta))
66029
+ * [[ErrorMsg](https://cloud.tencent.com/document/api/1729/101838#ErrorMsg)](https://cloud.tencent.com/document/api/1729/101838#[ErrorMsg](https://cloud.tencent.com/document/api/1729/101838#ErrorMsg))
66030
+ * [[Message](https://cloud.tencent.com/document/api/1729/101838#Message)](https://cloud.tencent.com/document/api/1729/101838#[Message](https://cloud.tencent.com/document/api/1729/101838#Message))
66031
+ * [[Usage](https://cloud.tencent.com/document/api/1729/101838#Usage)](https://cloud.tencent.com/document/api/1729/101838#[Usage](https://cloud.tencent.com/document/api/1729/101838#Usage))
66032
+
66033
+
66034
+
66035
+
66173
66036
  ## 人脸识别(iai) 版本:2018-03-01
66174
66037
 
66175
66038
  ### 第 20 次发布
@@ -122557,7 +122420,7 @@
122557
122420
 
122558
122421
 
122559
122422
 
122560
- ## 腾讯知识图谱数据查询(tkgdq) 版本:2019-04-11
122423
+ ## (tkgdq) 版本:2019-04-11
122561
122424
 
122562
122425
  ### 第 1 次发布
122563
122426
 
@@ -124979,16 +124842,16 @@
124979
124842
 
124980
124843
  新增接口:
124981
124844
 
124982
- * [[DeleteWafDomains](https://cloud.tencent.com/document/api/1364/101828)](https://cloud.tencent.com/document/api/#/#)
124983
- * [[DescribeWafDomains](https://cloud.tencent.com/document/api/1364/101827)](https://cloud.tencent.com/document/api/#/#)
124984
- * [[DescribeWafProtection](https://cloud.tencent.com/document/api/1364/101826)](https://cloud.tencent.com/document/api/#/#)
124845
+ * [DeleteWafDomains](https://cloud.tencent.com/document/api/1364/101828)
124846
+ * [DescribeWafDomains](https://cloud.tencent.com/document/api/1364/101827)
124847
+ * [DescribeWafProtection](https://cloud.tencent.com/document/api/1364/101826)
124985
124848
 
124986
124849
  新增数据结构:
124987
124850
 
124988
- * [[DescribeWafDomainsResult](https://cloud.tencent.com/document/api/1364/54942#DescribeWafDomainsResult)](https://cloud.tencent.com/document/api/1364/54942#[DescribeWafDomainsResult](https://cloud.tencent.com/document/api/1364/54942#DescribeWafDomainsResult))
124989
- * [[DescribeWafProtectionResult](https://cloud.tencent.com/document/api/1364/54942#DescribeWafProtectionResult)](https://cloud.tencent.com/document/api/1364/54942#[DescribeWafProtectionResult](https://cloud.tencent.com/document/api/1364/54942#DescribeWafProtectionResult))
124990
- * [[RouteWafStatus](https://cloud.tencent.com/document/api/1364/54942#RouteWafStatus)](https://cloud.tencent.com/document/api/1364/54942#[RouteWafStatus](https://cloud.tencent.com/document/api/1364/54942#RouteWafStatus))
124991
- * [[ServiceWafStatus](https://cloud.tencent.com/document/api/1364/54942#ServiceWafStatus)](https://cloud.tencent.com/document/api/1364/54942#[ServiceWafStatus](https://cloud.tencent.com/document/api/1364/54942#ServiceWafStatus))
124851
+ * [DescribeWafDomainsResult](https://cloud.tencent.com/document/api/1364/54942#DescribeWafDomainsResult)
124852
+ * [DescribeWafProtectionResult](https://cloud.tencent.com/document/api/1364/54942#DescribeWafProtectionResult)
124853
+ * [RouteWafStatus](https://cloud.tencent.com/document/api/1364/54942#RouteWafStatus)
124854
+ * [ServiceWafStatus](https://cloud.tencent.com/document/api/1364/54942#ServiceWafStatus)
124992
124855
 
124993
124856
  ### 第 53 次发布
124994
124857
 
@@ -140256,12 +140119,12 @@
140256
140119
 
140257
140120
  新增接口:
140258
140121
 
140259
- * [[DescribeColumnsMeta](https://cloud.tencent.com/document/api/1267/101829)](https://cloud.tencent.com/document/api/#/#)
140122
+ * [DescribeColumnsMeta](https://cloud.tencent.com/document/api/1267/101829)
140260
140123
 
140261
140124
  新增数据结构:
140262
140125
 
140263
- * [[ColumnMeta](https://cloud.tencent.com/document/api/1267/76336#ColumnMeta)](https://cloud.tencent.com/document/api/1267/76336#[ColumnMeta](https://cloud.tencent.com/document/api/1267/76336#ColumnMeta))
140264
- * [[Pair](https://cloud.tencent.com/document/api/1267/76336#Pair)](https://cloud.tencent.com/document/api/1267/76336#[Pair](https://cloud.tencent.com/document/api/1267/76336#Pair))
140126
+ * [ColumnMeta](https://cloud.tencent.com/document/api/1267/76336#ColumnMeta)
140127
+ * [Pair](https://cloud.tencent.com/document/api/1267/76336#Pair)
140265
140128
 
140266
140129
  ### 第 58 次发布
140267
140130
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "tencentcloud-sdk-nodejs",
3
- "version": "4.0.741",
3
+ "version": "4.0.742",
4
4
  "description": "腾讯云 API NODEJS SDK",
5
5
  "main": "tencentcloud/index.js",
6
6
  "scripts": {
package/products.md CHANGED
@@ -111,6 +111,7 @@
111
111
  | hai | [高性能应用服务](https://cloud.tencent.com/document/product/1721) | 2023-11-23 01:19:50 |
112
112
  | hasim | [高可用物联网卡](https://cloud.tencent.com/document/product/1482) | 2023-05-18 01:29:47 |
113
113
  | hcm | [数学作业批改](https://cloud.tencent.com/document/product/1004) | 2023-11-01 01:14:52 |
114
+ | hunyuan | [腾讯混元大模型](https://cloud.tencent.com/document/product/1729) | 2023-11-23 11:16:03 |
114
115
  | iai | [人脸识别](https://cloud.tencent.com/document/product/867) | 2023-10-24 01:16:21 |
115
116
  | ic | [图片瘦身](https://cloud.tencent.com/document/product/636) | 2023-03-02 01:23:21 |
116
117
  | icr | [对话机器人](https://cloud.tencent.com/document/product/1268) | 2023-05-18 01:30:40 |
@@ -1 +1 @@
1
- export const sdkVersion = "4.0.741"
1
+ export const sdkVersion = "4.0.742"
@@ -0,0 +1,5 @@
1
+ import { v20230901 } from "./v20230901"
2
+
3
+ export const hunyuan = {
4
+ v20230901: v20230901,
5
+ }
@@ -0,0 +1,72 @@
1
+ /* eslint-disable @typescript-eslint/no-unused-vars */
2
+ /*
3
+ * Copyright (c) 2018 THL A29 Limited, a Tencent company. All Rights Reserved.
4
+ *
5
+ * Licensed under the Apache License, Version 2.0 (the "License");
6
+ * you may not use this file except in compliance with the License.
7
+ * You may obtain a copy of the License at
8
+ *
9
+ * http://www.apache.org/licenses/LICENSE-2.0
10
+ *
11
+ * Unless required by applicable law or agreed to in writing,
12
+ * software distributed under the License is distributed on an
13
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14
+ * KIND, either express or implied. See the License for the
15
+ * specific language governing permissions and limitations
16
+ * under the License.
17
+ */
18
+ import { AbstractClient } from "../../../common/abstract_client"
19
+ import { ClientConfig } from "../../../common/interface"
20
+ import {
21
+ GetTokenCountResponse,
22
+ ErrorMsg,
23
+ ChatStdResponse,
24
+ ChatProResponse,
25
+ Choice,
26
+ ChatProRequest,
27
+ Delta,
28
+ Usage,
29
+ Message,
30
+ GetTokenCountRequest,
31
+ ChatStdRequest,
32
+ } from "./hunyuan_models"
33
+
34
+ /**
35
+ * hunyuan client
36
+ * @class
37
+ */
38
+ export class Client extends AbstractClient {
39
+ constructor(clientConfig: ClientConfig) {
40
+ super("hunyuan.tencentcloudapi.com", "2023-09-01", clientConfig)
41
+ }
42
+
43
+ /**
44
+ * 腾讯混元大模型高级版是由腾讯研发的大语言模型,具备强大的中文创作能力,复杂语境下的逻辑推理能力,以及可靠的任务执行能力。本接口为SSE协议。
45
+ */
46
+ async ChatPro(
47
+ req: ChatProRequest,
48
+ cb?: (error: string, rep: ChatProResponse) => void
49
+ ): Promise<ChatProResponse> {
50
+ return this.request("ChatPro", req, cb)
51
+ }
52
+
53
+ /**
54
+ * 腾讯混元大模型标准版是由腾讯研发的大语言模型,具备强大的中文创作能力,复杂语境下的逻辑推理能力,以及可靠的任务执行能力。本接口为SSE协议。
55
+ */
56
+ async ChatStd(
57
+ req: ChatStdRequest,
58
+ cb?: (error: string, rep: ChatStdResponse) => void
59
+ ): Promise<ChatStdResponse> {
60
+ return this.request("ChatStd", req, cb)
61
+ }
62
+
63
+ /**
64
+ * 该接口用于计算文本对应Token数、字符数。
65
+ */
66
+ async GetTokenCount(
67
+ req: GetTokenCountRequest,
68
+ cb?: (error: string, rep: GetTokenCountResponse) => void
69
+ ): Promise<GetTokenCountResponse> {
70
+ return this.request("GetTokenCount", req, cb)
71
+ }
72
+ }
@@ -0,0 +1,255 @@
1
+ /*
2
+ * Copyright (c) 2018 THL A29 Limited, a Tencent company. All Rights Reserved.
3
+ *
4
+ * Licensed under the Apache License, Version 2.0 (the "License");
5
+ * you may not use this file except in compliance with the License.
6
+ * You may obtain a copy of the License at
7
+ *
8
+ * http://www.apache.org/licenses/LICENSE-2.0
9
+ *
10
+ * Unless required by applicable law or agreed to in writing,
11
+ * software distributed under the License is distributed on an
12
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
13
+ * KIND, either express or implied. See the License for the
14
+ * specific language governing permissions and limitations
15
+ * under the License.
16
+ */
17
+
18
+ /**
19
+ * GetTokenCount返回参数结构体
20
+ */
21
+ export interface GetTokenCountResponse {
22
+ /**
23
+ * token计数
24
+ */
25
+ TokenCount?: number
26
+ /**
27
+ * 字符计数
28
+ */
29
+ CharacterCount?: number
30
+ /**
31
+ * 切分后的列表
32
+ */
33
+ Tokens?: Array<string>
34
+ /**
35
+ * 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。
36
+ */
37
+ RequestId?: string
38
+ }
39
+
40
+ /**
41
+ * 运行时异常信息。
42
+ */
43
+ export interface ErrorMsg {
44
+ /**
45
+ * 错误提示信息。
46
+ */
47
+ Msg?: string
48
+ /**
49
+ * 错误码。
50
+ 4000 服务内部异常。
51
+ 4001 请求模型超时。
52
+
53
+ */
54
+ Code?: number
55
+ }
56
+
57
+ /**
58
+ * ChatStd返回参数结构体
59
+ */
60
+ export interface ChatStdResponse {
61
+ /**
62
+ * unix 时间戳,单位为秒。
63
+ */
64
+ Created?: number
65
+ /**
66
+ * token统计信息。
67
+ 按照总token数量计费。
68
+ */
69
+ Usage?: Usage
70
+ /**
71
+ * 免责声明。
72
+ */
73
+ Note?: string
74
+ /**
75
+ * 本轮对话的id。
76
+ */
77
+ Id?: string
78
+ /**
79
+ * 回复内容。
80
+ */
81
+ Choices?: Array<Choice>
82
+ /**
83
+ * 错误信息。
84
+ 如果流式返回中服务处理异常,返回该错误信息。
85
+ 注意:此字段可能返回 null,表示取不到有效值。
86
+ */
87
+ ErrorMsg?: ErrorMsg
88
+ /**
89
+ * 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。本接口为流式响应接口,当请求成功时,RequestId 会被放在 HTTP 响应的 Header "X-TC-RequestId" 中。
90
+ */
91
+ RequestId?: string
92
+ }
93
+
94
+ /**
95
+ * ChatPro返回参数结构体
96
+ */
97
+ export interface ChatProResponse {
98
+ /**
99
+ * unix 时间戳,单位为秒。
100
+ */
101
+ Created?: number
102
+ /**
103
+ * token统计信息。
104
+ 按照总token数量计费。
105
+ */
106
+ Usage?: Usage
107
+ /**
108
+ * 免责声明。
109
+ */
110
+ Note?: string
111
+ /**
112
+ * 本轮对话的id。
113
+ */
114
+ Id?: string
115
+ /**
116
+ * 回复内容。
117
+ */
118
+ Choices?: Array<Choice>
119
+ /**
120
+ * 错误信息。
121
+ 如果流式返回中服务处理异常,返回该错误信息。
122
+ 注意:此字段可能返回 null,表示取不到有效值。
123
+ */
124
+ ErrorMsg?: ErrorMsg
125
+ /**
126
+ * 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。本接口为流式响应接口,当请求成功时,RequestId 会被放在 HTTP 响应的 Header "X-TC-RequestId" 中。
127
+ */
128
+ RequestId?: string
129
+ }
130
+
131
+ /**
132
+ * 返回的回复, 支持多个
133
+ */
134
+ export interface Choice {
135
+ /**
136
+ * 流式结束标志位,为 stop 则表示尾包。
137
+ */
138
+ FinishReason?: string
139
+ /**
140
+ * 返回值。
141
+ */
142
+ Delta?: Delta
143
+ }
144
+
145
+ /**
146
+ * ChatPro请求参数结构体
147
+ */
148
+ export interface ChatProRequest {
149
+ /**
150
+ * 聊天上下文信息。
151
+ 说明:
152
+ 1.长度最多为40, 按对话时间从旧到新在数组中排列。
153
+ 2.Message的Role当前可选值:user、assistant,其中,user和assistant需要交替出现(一问一答),最后一个为user提问, 且Content不能为空。
154
+ 3.Messages中Content总长度不超过16000token,超过则会截断最前面的内容,只保留尾部内容。建议不超过4000token。
155
+ */
156
+ Messages: Array<Message>
157
+ /**
158
+ * 说明:
159
+ 1.影响输出文本的多样性,取值越大,生成文本的多样性越强。
160
+ 2.默认1.0,取值区间为[0.0, 1.0]。
161
+ 3.非必要不建议使用, 不合理的取值会影响效果。
162
+ */
163
+ TopP?: number
164
+ /**
165
+ * 说明:
166
+ 1.较高的数值会使输出更加随机,而较低的数值会使其更加集中和确定。
167
+ 2.默认1.0,取值区间为[0.0,2.0]。
168
+ 3.非必要不建议使用,不合理的取值会影响效果。
169
+ */
170
+ Temperature?: number
171
+ }
172
+
173
+ /**
174
+ * 返回的内容(流式返回)
175
+ */
176
+ export interface Delta {
177
+ /**
178
+ * 角色名称。
179
+ */
180
+ Role?: string
181
+ /**
182
+ * 内容详情。
183
+ */
184
+ Content?: string
185
+ }
186
+
187
+ /**
188
+ * token 数量
189
+ */
190
+ export interface Usage {
191
+ /**
192
+ * 输入 token 数量。
193
+ */
194
+ PromptTokens?: number
195
+ /**
196
+ * 输出 token 数量。
197
+ */
198
+ CompletionTokens?: number
199
+ /**
200
+ * 总 token 数量。
201
+ */
202
+ TotalTokens?: number
203
+ }
204
+
205
+ /**
206
+ * 会话内容, 按对话时间序排列,长度最多为40
207
+ */
208
+ export interface Message {
209
+ /**
210
+ * 角色
211
+ */
212
+ Role: string
213
+ /**
214
+ * 消息的内容
215
+ */
216
+ Content: string
217
+ }
218
+
219
+ /**
220
+ * GetTokenCount请求参数结构体
221
+ */
222
+ export interface GetTokenCountRequest {
223
+ /**
224
+ * 输入文本
225
+ */
226
+ Prompt: string
227
+ }
228
+
229
+ /**
230
+ * ChatStd请求参数结构体
231
+ */
232
+ export interface ChatStdRequest {
233
+ /**
234
+ * 聊天上下文信息。
235
+ 说明:
236
+ 1.长度最多为40, 按对话时间从旧到新在数组中排列。
237
+ 2.Message的Role当前可选值:user、assistant,其中,user和assistant需要交替出现(一问一答),最后一个为user提问, 且Content不能为空。
238
+ 3.Messages中Content总长度不超过16000token,超过则会截断最前面的内容,只保留尾部内容。建议不超过4000token。
239
+ */
240
+ Messages: Array<Message>
241
+ /**
242
+ * 说明:
243
+ 1.影响输出文本的多样性,取值越大,生成文本的多样性越强。
244
+ 2.默认1.0,取值区间为[0.0, 1.0]。
245
+ 3.非必要不建议使用, 不合理的取值会影响效果。
246
+ */
247
+ TopP?: number
248
+ /**
249
+ * 说明:
250
+ 1.较高的数值会使输出更加随机,而较低的数值会使其更加集中和确定。
251
+ 2.默认1.0,取值区间为[0.0,2.0]。
252
+ 3.非必要不建议使用,不合理的取值会影响效果。
253
+ */
254
+ Temperature?: number
255
+ }
@@ -0,0 +1,6 @@
1
+ import * as Models from "./hunyuan_models"
2
+ import { Client } from "./hunyuan_client"
3
+ export const v20230901 = {
4
+ Client: Client,
5
+ Models: Models,
6
+ }
@@ -109,6 +109,7 @@ export { habo } from "./habo"
109
109
  export { hai } from "./hai"
110
110
  export { hasim } from "./hasim"
111
111
  export { hcm } from "./hcm"
112
+ export { hunyuan } from "./hunyuan"
112
113
  export { iai } from "./iai"
113
114
  export { ic } from "./ic"
114
115
  export { icr } from "./icr"
@@ -1 +1 @@
1
- export declare const sdkVersion = "4.0.741";
1
+ export declare const sdkVersion = "4.0.742";
@@ -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.741";
4
+ exports.sdkVersion = "4.0.742";
@@ -0,0 +1,6 @@
1
+ export declare const hunyuan: {
2
+ v20230901: {
3
+ Client: typeof import("./v20230901/hunyuan_client").Client;
4
+ Models: typeof import("./v20230901/hunyuan_models");
5
+ };
6
+ };
@@ -0,0 +1,7 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.hunyuan = void 0;
4
+ const v20230901_1 = require("./v20230901");
5
+ exports.hunyuan = {
6
+ v20230901: v20230901_1.v20230901,
7
+ };
@@ -0,0 +1,22 @@
1
+ import { AbstractClient } from "../../../common/abstract_client";
2
+ import { ClientConfig } from "../../../common/interface";
3
+ import { GetTokenCountResponse, ChatStdResponse, ChatProResponse, ChatProRequest, GetTokenCountRequest, ChatStdRequest } from "./hunyuan_models";
4
+ /**
5
+ * hunyuan client
6
+ * @class
7
+ */
8
+ export declare class Client extends AbstractClient {
9
+ constructor(clientConfig: ClientConfig);
10
+ /**
11
+ * 腾讯混元大模型高级版是由腾讯研发的大语言模型,具备强大的中文创作能力,复杂语境下的逻辑推理能力,以及可靠的任务执行能力。本接口为SSE协议。
12
+ */
13
+ ChatPro(req: ChatProRequest, cb?: (error: string, rep: ChatProResponse) => void): Promise<ChatProResponse>;
14
+ /**
15
+ * 腾讯混元大模型标准版是由腾讯研发的大语言模型,具备强大的中文创作能力,复杂语境下的逻辑推理能力,以及可靠的任务执行能力。本接口为SSE协议。
16
+ */
17
+ ChatStd(req: ChatStdRequest, cb?: (error: string, rep: ChatStdResponse) => void): Promise<ChatStdResponse>;
18
+ /**
19
+ * 该接口用于计算文本对应Token数、字符数。
20
+ */
21
+ GetTokenCount(req: GetTokenCountRequest, cb?: (error: string, rep: GetTokenCountResponse) => void): Promise<GetTokenCountResponse>;
22
+ }
@@ -0,0 +1,49 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.Client = void 0;
4
+ /* eslint-disable @typescript-eslint/no-unused-vars */
5
+ /*
6
+ * Copyright (c) 2018 THL A29 Limited, a Tencent company. All Rights Reserved.
7
+ *
8
+ * Licensed under the Apache License, Version 2.0 (the "License");
9
+ * you may not use this file except in compliance with the License.
10
+ * You may obtain a copy of the License at
11
+ *
12
+ * http://www.apache.org/licenses/LICENSE-2.0
13
+ *
14
+ * Unless required by applicable law or agreed to in writing,
15
+ * software distributed under the License is distributed on an
16
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
17
+ * KIND, either express or implied. See the License for the
18
+ * specific language governing permissions and limitations
19
+ * under the License.
20
+ */
21
+ const abstract_client_1 = require("../../../common/abstract_client");
22
+ /**
23
+ * hunyuan client
24
+ * @class
25
+ */
26
+ class Client extends abstract_client_1.AbstractClient {
27
+ constructor(clientConfig) {
28
+ super("hunyuan.tencentcloudapi.com", "2023-09-01", clientConfig);
29
+ }
30
+ /**
31
+ * 腾讯混元大模型高级版是由腾讯研发的大语言模型,具备强大的中文创作能力,复杂语境下的逻辑推理能力,以及可靠的任务执行能力。本接口为SSE协议。
32
+ */
33
+ async ChatPro(req, cb) {
34
+ return this.request("ChatPro", req, cb);
35
+ }
36
+ /**
37
+ * 腾讯混元大模型标准版是由腾讯研发的大语言模型,具备强大的中文创作能力,复杂语境下的逻辑推理能力,以及可靠的任务执行能力。本接口为SSE协议。
38
+ */
39
+ async ChatStd(req, cb) {
40
+ return this.request("ChatStd", req, cb);
41
+ }
42
+ /**
43
+ * 该接口用于计算文本对应Token数、字符数。
44
+ */
45
+ async GetTokenCount(req, cb) {
46
+ return this.request("GetTokenCount", req, cb);
47
+ }
48
+ }
49
+ exports.Client = Client;
@@ -0,0 +1,228 @@
1
+ /**
2
+ * GetTokenCount返回参数结构体
3
+ */
4
+ export interface GetTokenCountResponse {
5
+ /**
6
+ * token计数
7
+ */
8
+ TokenCount?: number;
9
+ /**
10
+ * 字符计数
11
+ */
12
+ CharacterCount?: number;
13
+ /**
14
+ * 切分后的列表
15
+ */
16
+ Tokens?: Array<string>;
17
+ /**
18
+ * 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。
19
+ */
20
+ RequestId?: string;
21
+ }
22
+ /**
23
+ * 运行时异常信息。
24
+ */
25
+ export interface ErrorMsg {
26
+ /**
27
+ * 错误提示信息。
28
+ */
29
+ Msg?: string;
30
+ /**
31
+ * 错误码。
32
+ 4000 服务内部异常。
33
+ 4001 请求模型超时。
34
+
35
+ */
36
+ Code?: number;
37
+ }
38
+ /**
39
+ * ChatStd返回参数结构体
40
+ */
41
+ export interface ChatStdResponse {
42
+ /**
43
+ * unix 时间戳,单位为秒。
44
+ */
45
+ Created?: number;
46
+ /**
47
+ * token统计信息。
48
+ 按照总token数量计费。
49
+ */
50
+ Usage?: Usage;
51
+ /**
52
+ * 免责声明。
53
+ */
54
+ Note?: string;
55
+ /**
56
+ * 本轮对话的id。
57
+ */
58
+ Id?: string;
59
+ /**
60
+ * 回复内容。
61
+ */
62
+ Choices?: Array<Choice>;
63
+ /**
64
+ * 错误信息。
65
+ 如果流式返回中服务处理异常,返回该错误信息。
66
+ 注意:此字段可能返回 null,表示取不到有效值。
67
+ */
68
+ ErrorMsg?: ErrorMsg;
69
+ /**
70
+ * 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。本接口为流式响应接口,当请求成功时,RequestId 会被放在 HTTP 响应的 Header "X-TC-RequestId" 中。
71
+ */
72
+ RequestId?: string;
73
+ }
74
+ /**
75
+ * ChatPro返回参数结构体
76
+ */
77
+ export interface ChatProResponse {
78
+ /**
79
+ * unix 时间戳,单位为秒。
80
+ */
81
+ Created?: number;
82
+ /**
83
+ * token统计信息。
84
+ 按照总token数量计费。
85
+ */
86
+ Usage?: Usage;
87
+ /**
88
+ * 免责声明。
89
+ */
90
+ Note?: string;
91
+ /**
92
+ * 本轮对话的id。
93
+ */
94
+ Id?: string;
95
+ /**
96
+ * 回复内容。
97
+ */
98
+ Choices?: Array<Choice>;
99
+ /**
100
+ * 错误信息。
101
+ 如果流式返回中服务处理异常,返回该错误信息。
102
+ 注意:此字段可能返回 null,表示取不到有效值。
103
+ */
104
+ ErrorMsg?: ErrorMsg;
105
+ /**
106
+ * 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。本接口为流式响应接口,当请求成功时,RequestId 会被放在 HTTP 响应的 Header "X-TC-RequestId" 中。
107
+ */
108
+ RequestId?: string;
109
+ }
110
+ /**
111
+ * 返回的回复, 支持多个
112
+ */
113
+ export interface Choice {
114
+ /**
115
+ * 流式结束标志位,为 stop 则表示尾包。
116
+ */
117
+ FinishReason?: string;
118
+ /**
119
+ * 返回值。
120
+ */
121
+ Delta?: Delta;
122
+ }
123
+ /**
124
+ * ChatPro请求参数结构体
125
+ */
126
+ export interface ChatProRequest {
127
+ /**
128
+ * 聊天上下文信息。
129
+ 说明:
130
+ 1.长度最多为40, 按对话时间从旧到新在数组中排列。
131
+ 2.Message的Role当前可选值:user、assistant,其中,user和assistant需要交替出现(一问一答),最后一个为user提问, 且Content不能为空。
132
+ 3.Messages中Content总长度不超过16000token,超过则会截断最前面的内容,只保留尾部内容。建议不超过4000token。
133
+ */
134
+ Messages: Array<Message>;
135
+ /**
136
+ * 说明:
137
+ 1.影响输出文本的多样性,取值越大,生成文本的多样性越强。
138
+ 2.默认1.0,取值区间为[0.0, 1.0]。
139
+ 3.非必要不建议使用, 不合理的取值会影响效果。
140
+ */
141
+ TopP?: number;
142
+ /**
143
+ * 说明:
144
+ 1.较高的数值会使输出更加随机,而较低的数值会使其更加集中和确定。
145
+ 2.默认1.0,取值区间为[0.0,2.0]。
146
+ 3.非必要不建议使用,不合理的取值会影响效果。
147
+ */
148
+ Temperature?: number;
149
+ }
150
+ /**
151
+ * 返回的内容(流式返回)
152
+ */
153
+ export interface Delta {
154
+ /**
155
+ * 角色名称。
156
+ */
157
+ Role?: string;
158
+ /**
159
+ * 内容详情。
160
+ */
161
+ Content?: string;
162
+ }
163
+ /**
164
+ * token 数量
165
+ */
166
+ export interface Usage {
167
+ /**
168
+ * 输入 token 数量。
169
+ */
170
+ PromptTokens?: number;
171
+ /**
172
+ * 输出 token 数量。
173
+ */
174
+ CompletionTokens?: number;
175
+ /**
176
+ * 总 token 数量。
177
+ */
178
+ TotalTokens?: number;
179
+ }
180
+ /**
181
+ * 会话内容, 按对话时间序排列,长度最多为40
182
+ */
183
+ export interface Message {
184
+ /**
185
+ * 角色
186
+ */
187
+ Role: string;
188
+ /**
189
+ * 消息的内容
190
+ */
191
+ Content: string;
192
+ }
193
+ /**
194
+ * GetTokenCount请求参数结构体
195
+ */
196
+ export interface GetTokenCountRequest {
197
+ /**
198
+ * 输入文本
199
+ */
200
+ Prompt: string;
201
+ }
202
+ /**
203
+ * ChatStd请求参数结构体
204
+ */
205
+ export interface ChatStdRequest {
206
+ /**
207
+ * 聊天上下文信息。
208
+ 说明:
209
+ 1.长度最多为40, 按对话时间从旧到新在数组中排列。
210
+ 2.Message的Role当前可选值:user、assistant,其中,user和assistant需要交替出现(一问一答),最后一个为user提问, 且Content不能为空。
211
+ 3.Messages中Content总长度不超过16000token,超过则会截断最前面的内容,只保留尾部内容。建议不超过4000token。
212
+ */
213
+ Messages: Array<Message>;
214
+ /**
215
+ * 说明:
216
+ 1.影响输出文本的多样性,取值越大,生成文本的多样性越强。
217
+ 2.默认1.0,取值区间为[0.0, 1.0]。
218
+ 3.非必要不建议使用, 不合理的取值会影响效果。
219
+ */
220
+ TopP?: number;
221
+ /**
222
+ * 说明:
223
+ 1.较高的数值会使输出更加随机,而较低的数值会使其更加集中和确定。
224
+ 2.默认1.0,取值区间为[0.0,2.0]。
225
+ 3.非必要不建议使用,不合理的取值会影响效果。
226
+ */
227
+ Temperature?: number;
228
+ }
@@ -0,0 +1,18 @@
1
+ "use strict";
2
+ /*
3
+ * Copyright (c) 2018 THL A29 Limited, a Tencent company. All Rights Reserved.
4
+ *
5
+ * Licensed under the Apache License, Version 2.0 (the "License");
6
+ * you may not use this file except in compliance with the License.
7
+ * You may obtain a copy of the License at
8
+ *
9
+ * http://www.apache.org/licenses/LICENSE-2.0
10
+ *
11
+ * Unless required by applicable law or agreed to in writing,
12
+ * software distributed under the License is distributed on an
13
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14
+ * KIND, either express or implied. See the License for the
15
+ * specific language governing permissions and limitations
16
+ * under the License.
17
+ */
18
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,6 @@
1
+ import * as Models from "./hunyuan_models";
2
+ import { Client } from "./hunyuan_client";
3
+ export declare const v20230901: {
4
+ Client: typeof Client;
5
+ Models: typeof Models;
6
+ };
@@ -0,0 +1,9 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.v20230901 = void 0;
4
+ const Models = require("./hunyuan_models");
5
+ const hunyuan_client_1 = require("./hunyuan_client");
6
+ exports.v20230901 = {
7
+ Client: hunyuan_client_1.Client,
8
+ Models: Models
9
+ };
@@ -109,6 +109,7 @@ export { habo } from "./habo";
109
109
  export { hai } from "./hai";
110
110
  export { hasim } from "./hasim";
111
111
  export { hcm } from "./hcm";
112
+ export { hunyuan } from "./hunyuan";
112
113
  export { iai } from "./iai";
113
114
  export { ic } from "./ic";
114
115
  export { icr } from "./icr";
@@ -222,6 +222,8 @@ var hasim_1 = require("./hasim");
222
222
  Object.defineProperty(exports, "hasim", { enumerable: true, get: function () { return hasim_1.hasim; } });
223
223
  var hcm_1 = require("./hcm");
224
224
  Object.defineProperty(exports, "hcm", { enumerable: true, get: function () { return hcm_1.hcm; } });
225
+ var hunyuan_1 = require("./hunyuan");
226
+ Object.defineProperty(exports, "hunyuan", { enumerable: true, get: function () { return hunyuan_1.hunyuan; } });
225
227
  var iai_1 = require("./iai");
226
228
  Object.defineProperty(exports, "iai", { enumerable: true, get: function () { return iai_1.iai; } });
227
229
  var ic_1 = require("./ic");
@@ -0,0 +1,51 @@
1
+
2
+ const expect = require("chai").expect
3
+ const tencentcloud = require("../../tencentcloud-sdk-nodejs")
4
+ const client = new tencentcloud.hunyuan.v20230901.Client({
5
+ credential: {
6
+ secretId: process.env.secretId,
7
+ secretKey: process.env.secretKey,
8
+ },
9
+ region: "ap-shanghai",
10
+ profile: {
11
+ signMethod: "TC3-HMAC-SHA256",
12
+ httpProfile: {
13
+ reqMethod: "POST",
14
+ reqTimeout: 30,
15
+ endpoint: "cvm.ap-shanghai.tencentcloudapi.com",
16
+ },
17
+ },
18
+ })
19
+ describe("hunyuan.v20230901.test.js", function () {
20
+
21
+ it("hunyuan.v20230901.ChatPro", async function () {
22
+ try {
23
+ const data = await client.ChatPro({})
24
+ expect(data).to.be.ok
25
+ } catch(error) {
26
+ expect(error.requestId).to.be.ok
27
+ expect(error.code).to.be.ok
28
+ }
29
+ })
30
+
31
+ it("hunyuan.v20230901.ChatStd", async function () {
32
+ try {
33
+ const data = await client.ChatStd({})
34
+ expect(data).to.be.ok
35
+ } catch(error) {
36
+ expect(error.requestId).to.be.ok
37
+ expect(error.code).to.be.ok
38
+ }
39
+ })
40
+
41
+ it("hunyuan.v20230901.GetTokenCount", async function () {
42
+ try {
43
+ const data = await client.GetTokenCount({})
44
+ expect(data).to.be.ok
45
+ } catch(error) {
46
+ expect(error.requestId).to.be.ok
47
+ expect(error.code).to.be.ok
48
+ }
49
+ })
50
+
51
+ })