tccli 3.0.1260.1__py2.py3-none-any.whl → 3.0.1261.1__py2.py3-none-any.whl

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.
tccli/__init__.py CHANGED
@@ -1 +1 @@
1
- __version__ = '3.0.1260.1'
1
+ __version__ = '3.0.1261.1'
@@ -1317,6 +1317,58 @@ def doUploadDoc(args, parsed_globals):
1317
1317
  FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
1318
1318
 
1319
1319
 
1320
+ def doChatCompletions(args, parsed_globals):
1321
+ g_param = parse_global_arg(parsed_globals)
1322
+
1323
+ if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
1324
+ cred = credential.CVMRoleCredential()
1325
+ elif g_param[OptionsDefine.RoleArn.replace('-', '_')] and g_param[OptionsDefine.RoleSessionName.replace('-', '_')]:
1326
+ cred = credential.STSAssumeRoleCredential(
1327
+ g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.RoleArn.replace('-', '_')],
1328
+ g_param[OptionsDefine.RoleSessionName.replace('-', '_')], endpoint=g_param["sts_cred_endpoint"]
1329
+ )
1330
+ elif os.getenv(OptionsDefine.ENV_TKE_REGION) and os.getenv(OptionsDefine.ENV_TKE_PROVIDER_ID) and os.getenv(OptionsDefine.ENV_TKE_WEB_IDENTITY_TOKEN_FILE) and os.getenv(OptionsDefine.ENV_TKE_ROLE_ARN):
1331
+ cred = credential.DefaultTkeOIDCRoleArnProvider().get_credentials()
1332
+ else:
1333
+ cred = credential.Credential(
1334
+ g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.Token]
1335
+ )
1336
+ http_profile = HttpProfile(
1337
+ reqTimeout=60 if g_param[OptionsDefine.Timeout] is None else int(g_param[OptionsDefine.Timeout]),
1338
+ reqMethod="POST",
1339
+ endpoint=g_param[OptionsDefine.Endpoint],
1340
+ proxy=g_param[OptionsDefine.HttpsProxy.replace('-', '_')]
1341
+ )
1342
+ profile = ClientProfile(httpProfile=http_profile, signMethod="HmacSHA256")
1343
+ if g_param[OptionsDefine.Language]:
1344
+ profile.language = g_param[OptionsDefine.Language]
1345
+ mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
1346
+ client = mod.LkeapClient(cred, g_param[OptionsDefine.Region], profile)
1347
+ client._sdkVersion += ("_CLI_" + __version__)
1348
+ models = MODELS_MAP[g_param[OptionsDefine.Version]]
1349
+ model = models.ChatCompletionsRequest()
1350
+ model.from_json_string(json.dumps(args))
1351
+ start_time = time.time()
1352
+ while True:
1353
+ rsp = client.ChatCompletions(model)
1354
+ result = rsp.to_json_string()
1355
+ try:
1356
+ json_obj = json.loads(result)
1357
+ except TypeError as e:
1358
+ json_obj = json.loads(result.decode('utf-8')) # python3.3
1359
+ if not g_param[OptionsDefine.Waiter] or search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj) == g_param['OptionsDefine.WaiterInfo']['to']:
1360
+ break
1361
+ cur_time = time.time()
1362
+ if cur_time - start_time >= g_param['OptionsDefine.WaiterInfo']['timeout']:
1363
+ raise ClientError('Request timeout, wait `%s` to `%s` timeout, last request is %s' %
1364
+ (g_param['OptionsDefine.WaiterInfo']['expr'], g_param['OptionsDefine.WaiterInfo']['to'],
1365
+ search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj)))
1366
+ else:
1367
+ print('Inquiry result is %s.' % search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj))
1368
+ time.sleep(g_param['OptionsDefine.WaiterInfo']['interval'])
1369
+ FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
1370
+
1371
+
1320
1372
  CLIENT_MAP = {
1321
1373
  "v20240522": lkeap_client_v20240522,
1322
1374
 
@@ -1353,6 +1405,7 @@ ACTION_MAP = {
1353
1405
  "CreateSplitDocumentFlow": doCreateSplitDocumentFlow,
1354
1406
  "UploadDocRealtime": doUploadDocRealtime,
1355
1407
  "UploadDoc": doUploadDoc,
1408
+ "ChatCompletions": doChatCompletions,
1356
1409
 
1357
1410
  }
1358
1411
 
@@ -1,5 +1,12 @@
1
1
  {
2
2
  "actions": {
3
+ "ChatCompletions": {
4
+ "document": "对话",
5
+ "input": "ChatCompletionsRequest",
6
+ "name": "对话",
7
+ "output": "ChatCompletionsResponse",
8
+ "status": "online"
9
+ },
3
10
  "CreateAttributeLabel": {
4
11
  "document": "用于为问答对创建属性标签,以便对内容进行分类和管理。 使用场景:当需要为问答对添加分类标签和属性标记时使用,比如为问答对添加“售后”标签。",
5
12
  "input": "CreateAttributeLabelRequest",
@@ -289,6 +296,51 @@
289
296
  ],
290
297
  "usage": "both"
291
298
  },
299
+ "ChatCompletionsRequest": {
300
+ "document": "ChatCompletions请求参数结构体",
301
+ "members": [
302
+ {
303
+ "disabled": false,
304
+ "document": "模型名称",
305
+ "example": "deepseek-r1",
306
+ "member": "string",
307
+ "name": "Model",
308
+ "required": true,
309
+ "type": "string"
310
+ },
311
+ {
312
+ "disabled": false,
313
+ "document": "会话列表",
314
+ "example": "[{\"role\":\"user\",\"content\":\"你好\"}]",
315
+ "member": "Message",
316
+ "name": "Messages",
317
+ "required": true,
318
+ "type": "list"
319
+ },
320
+ {
321
+ "disabled": false,
322
+ "document": "是否流式输出",
323
+ "example": "true",
324
+ "member": "bool",
325
+ "name": "Stream",
326
+ "required": false,
327
+ "type": "bool"
328
+ }
329
+ ],
330
+ "type": "object"
331
+ },
332
+ "ChatCompletionsResponse": {
333
+ "document": "ChatCompletions返回参数结构体",
334
+ "members": [
335
+ {
336
+ "document": "唯一请求 ID,由服务端生成,每次请求都会返回(若请求因其他原因未能抵达服务端,则该次请求不会获得 RequestId)。定位问题时需要提供该次请求的 RequestId。本接口为流式响应接口,当请求成功时,RequestId 会被放在 HTTP 响应的 Header \"X-TC-RequestId\" 中。",
337
+ "member": "string",
338
+ "name": "RequestId",
339
+ "type": "string"
340
+ }
341
+ ],
342
+ "type": "object"
343
+ },
292
344
  "CreateAttributeLabelRequest": {
293
345
  "document": "CreateAttributeLabel请求参数结构体",
294
346
  "members": [
@@ -1,5 +1,13 @@
1
1
  {
2
2
  "actions": {
3
+ "ChatCompletions": [
4
+ {
5
+ "document": "对话",
6
+ "input": "POST / HTTP/1.1\nHost: lkeap.tencentcloudapi.com\nContent-Type: application/json\nX-TC-Action: ChatCompletions\n<公共请求参数>\n\n{\n \"Model\": \"deepseek-r1\",\n \"Messages\": [\n {\n \"Role\": \"user\",\n \"Content\": \"你好\"\n }\n ],\n \"Stream\": false\n}",
7
+ "output": "{\n \"Response\": {\n \"RequestId\": \"26b3ed8b-960d-4d68-bc7f-098839f4b574\"\n }\n}",
8
+ "title": "对话"
9
+ }
10
+ ],
3
11
  "CreateAttributeLabel": [
4
12
  {
5
13
  "document": "添加属性标签",
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: tccli
3
- Version: 3.0.1260.1
3
+ Version: 3.0.1261.1
4
4
  Summary: Universal Command Line Environment for Tencent Cloud
5
5
  Project-URL: Bug Tracker, https://github.com/TencentCloud/tencentcloud-cli/issues
6
6
  Project-URL: Homepage, https://github.com/TencentCloud/tencentcloud-cli
@@ -13,7 +13,7 @@ Classifier: Programming Language :: Python :: 2.7
13
13
  Classifier: Programming Language :: Python :: 3
14
14
  Requires-Dist: jmespath==0.10.0
15
15
  Requires-Dist: six==1.16.0
16
- Requires-Dist: tencentcloud-sdk-python>=3.0.1260
16
+ Requires-Dist: tencentcloud-sdk-python>=3.0.1261
17
17
  Description-Content-Type: text/markdown
18
18
 
19
19
  # 命令行工具简介
@@ -1,4 +1,4 @@
1
- tccli/__init__.py,sha256=AsiYzGI_l5Ho7vF7Uo849_wLzJLL6mNNV0vND5cuFwY,27
1
+ tccli/__init__.py,sha256=Cti-C6UWTDv1lSYeBpbOOSmuiAV_HPteZ_22SkYL4iI,27
2
2
  tccli/argparser.py,sha256=WtfpBhj2R6JHSzagy6w6Q4y3YVmyIC_yK80w3tqBPgU,5589
3
3
  tccli/argument.py,sha256=ZtVo3AySpzM-Hw6_hPdU27FjUsc8QPB2fIuLy7JSBAk,8091
4
4
  tccli/base_command.py,sha256=rFWNAwfS0GA6LLGNOM-iPI0RV81Jag5cZn536ZQN0pw,2859
@@ -660,9 +660,9 @@ tccli/services/lke/lke_client.py,sha256=eVVbtENfY5pgGrELPi-91VJB3UzC4TPB-J0yx3m1
660
660
  tccli/services/lke/v20231130/api.json,sha256=L-ZkFJqOqcrpVgZ4jvQX_Om3Hsx0bC0rJwWYR1w3YBY,468959
661
661
  tccli/services/lke/v20231130/examples.json,sha256=rJD9w_EteQy7nRXFKzO2c3ms1-qA60SOBWBL-YR7HZw,249886
662
662
  tccli/services/lkeap/__init__.py,sha256=asxLax87Gwt4UF1pQoh5GX51weKCm6t8FPDRq-aKv7w,89
663
- tccli/services/lkeap/lkeap_client.py,sha256=6QcroW5LQPos0Aw6ivAVUm-X-cSTU0FZhH-15QNAvoc,83050
664
- tccli/services/lkeap/v20240522/api.json,sha256=coGClyaI0AY5rHU0r06Raly-uFhaT5O-RdPbo3zBox8,73652
665
- tccli/services/lkeap/v20240522/examples.json,sha256=T6_C8scDghFeGkJw_uOhrj7mOEBBF7rQ1xe8BhqyQrE,18380
663
+ tccli/services/lkeap/lkeap_client.py,sha256=FmVnY270LDf6WiXZg1gfdpwPDYMzLaSiYTFne3VdoVQ,86124
664
+ tccli/services/lkeap/v20240522/api.json,sha256=PKfRZuzoh9QMB6tH5H4FDu97B60ZK36ZzDFRBmToZM8,75351
665
+ tccli/services/lkeap/v20240522/examples.json,sha256=JjgQ90U3De0csF4xSQAFhjWVJhh0wFs3TC79lJkI-aw,18941
666
666
  tccli/services/lowcode/__init__.py,sha256=Kwnfhcs3YjlqMpMouELxDMbP4F0BLDwcaqTPutTSvDs,93
667
667
  tccli/services/lowcode/lowcode_client.py,sha256=CCcE5zFcrRqXqP6a1ojCRluayVSBE4yY5tY7W1foCjA,9260
668
668
  tccli/services/lowcode/v20210108/api.json,sha256=hQQF1qhVv6hsWmCmrqKtleToPFUiRxy_sAKINMRTvJY,17390
@@ -1165,8 +1165,8 @@ tccli/services/yunsou/v20180504/api.json,sha256=2808fil5p3pTEJ3SqXEEq7eSrASZOiv8
1165
1165
  tccli/services/yunsou/v20180504/examples.json,sha256=Jg4WuqS_Wxl7eTBMbzjem65FuUZQi3qq3xtlBNFZlTU,11870
1166
1166
  tccli/services/yunsou/v20191115/api.json,sha256=r_p7c7fMNylQVDpSN0CkUB4Cx1nYW1lI3BM_Zi50FNs,15932
1167
1167
  tccli/services/yunsou/v20191115/examples.json,sha256=vN5MzexHVPMckm4MbnXNiOe3KKiVchvf4_uLpjOskuk,3983
1168
- tccli-3.0.1260.1.dist-info/METADATA,sha256=ihwdvhqkneCkKdEyAHeAv9oU9bg3O9GuY7haDU9aVjk,16408
1169
- tccli-3.0.1260.1.dist-info/WHEEL,sha256=HyPWovjK_wfsxZqVnw7Bu5rgKxNh3Nm__lHm0ALDcb4,101
1170
- tccli-3.0.1260.1.dist-info/entry_points.txt,sha256=9ZzsXxi7Xj3ZneT7VxRVJpFvnmdEOeysh999_0gWVvo,85
1171
- tccli-3.0.1260.1.dist-info/license_files/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
1172
- tccli-3.0.1260.1.dist-info/RECORD,,
1168
+ tccli-3.0.1261.1.dist-info/METADATA,sha256=_rYdhf9z_oqSHlmwcTdt4splg4viYSoyfg-6gr5Pipc,16408
1169
+ tccli-3.0.1261.1.dist-info/WHEEL,sha256=HyPWovjK_wfsxZqVnw7Bu5rgKxNh3Nm__lHm0ALDcb4,101
1170
+ tccli-3.0.1261.1.dist-info/entry_points.txt,sha256=9ZzsXxi7Xj3ZneT7VxRVJpFvnmdEOeysh999_0gWVvo,85
1171
+ tccli-3.0.1261.1.dist-info/license_files/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
1172
+ tccli-3.0.1261.1.dist-info/RECORD,,