tccli 3.0.1098.1__py2.py3-none-any.whl → 3.0.1100.1__py2.py3-none-any.whl

Sign up to get free protection for your applications and to get access to all the features.
Files changed (109) hide show
  1. tccli/__init__.py +1 -1
  2. tccli/examples/cfw/v20190904/DescribeIPStatusList.md +4 -4
  3. tccli/examples/cls/v20201016/CreateCosRecharge.md +4 -4
  4. tccli/examples/cls/v20201016/CreateDashboardSubscribe.md +18 -0
  5. tccli/examples/cls/v20201016/DeleteDashboardSubscribe.md +18 -0
  6. tccli/examples/cls/v20201016/DescribeDashboardSubscribes.md +18 -0
  7. tccli/examples/cls/v20201016/ModifyCosRecharge.md +3 -3
  8. tccli/examples/cls/v20201016/ModifyDashboardSubscribe.md +18 -0
  9. tccli/examples/cls/v20201016/OpenKafkaConsumer.md +1 -1
  10. tccli/examples/cls/v20201016/SearchDashboardSubscribe.md +35 -0
  11. tccli/examples/cynosdb/v20190107/DescribeChangedParamsAfterUpgrade.md +31 -0
  12. tccli/examples/dlc/v20210125/CreateSparkSessionBatchSQL.md +1 -1
  13. tccli/examples/domain/v20180808/ModifyTemplate.md +73 -0
  14. tccli/examples/ess/v20201111/DescribeBatchOrganizationRegistrationUrls.md +27 -0
  15. tccli/examples/faceid/v20180301/GetFaceIdResult.md +3 -1
  16. tccli/examples/hunyuan/v20230901/ChatCompletions.md +183 -0
  17. tccli/examples/hunyuan/v20230901/ChatPro.md +2 -2
  18. tccli/examples/ims/v20200713/ImageModeration.md +4 -1
  19. tccli/examples/lke/v20231130/GetEmbedding.md +1 -1
  20. tccli/examples/lke/v20231130/GetMsgRecord.md +4 -1
  21. tccli/examples/ocr/v20181119/RecognizeGeneralTextImageWarn.md +83 -0
  22. tccli/examples/rum/v20210622/CreateWhitelist.md +2 -2
  23. tccli/examples/rum/v20210622/DescribeRumGroupLog.md +3 -3
  24. tccli/examples/rum/v20210622/DescribeRumLogExport.md +6 -6
  25. tccli/examples/rum/v20210622/DescribeRumStatsLogList.md +2 -2
  26. tccli/examples/teo/v20220901/CreatePlan.md +47 -0
  27. tccli/examples/teo/v20220901/DescribeRealtimeLogDeliveryTasks.md +42 -21
  28. tccli/examples/teo/v20220901/DestroyPlan.md +20 -0
  29. tccli/examples/teo/v20220901/IncreasePlanQuota.md +46 -0
  30. tccli/examples/teo/v20220901/ModifyPlan.md +21 -0
  31. tccli/examples/teo/v20220901/RenewPlan.md +23 -0
  32. tccli/examples/teo/v20220901/UpgradePlan.md +23 -0
  33. tccli/examples/tione/v20191022/UpdateCodeRepository.md +1 -1
  34. tccli/examples/tke/v20180525/CheckInstancesUpgradeAble.md +15 -7
  35. tccli/examples/tke/v20180525/CreateCluster.md +58 -142
  36. tccli/examples/tke/v20180525/DescribeClusterNodePools.md +1 -0
  37. tccli/examples/tke/v20180525/GetUpgradeInstanceProgress.md +18 -19
  38. tccli/examples/tke/v20180525/ModifyClusterAuthenticationOptions.md +3 -0
  39. tccli/examples/tke/v20180525/ModifyNodePoolInstanceTypes.md +1 -1
  40. tccli/examples/tms/v20201229/AnswerQuestion.md +21 -0
  41. tccli/examples/vpc/v20170312/DescribeVpnGatewayRoutes.md +2 -1
  42. tccli/examples/vpc/v20170312/ModifyVpnGatewayRoutes.md +8 -4
  43. tccli/services/aiart/v20221229/api.json +5 -5
  44. tccli/services/ccc/v20200210/api.json +1 -1
  45. tccli/services/cfs/v20190719/api.json +27 -27
  46. tccli/services/cfw/v20190904/api.json +5 -5
  47. tccli/services/cfw/v20190904/examples.json +1 -1
  48. tccli/services/cloudstudio/v20230508/api.json +13 -4
  49. tccli/services/cls/cls_client.py +337 -72
  50. tccli/services/cls/v20201016/api.json +501 -66
  51. tccli/services/cls/v20201016/examples.json +45 -5
  52. tccli/services/cynosdb/cynosdb_client.py +53 -0
  53. tccli/services/cynosdb/v20190107/api.json +120 -2
  54. tccli/services/cynosdb/v20190107/examples.json +8 -0
  55. tccli/services/dcdb/v20180411/api.json +2 -2
  56. tccli/services/dlc/v20210125/api.json +14 -4
  57. tccli/services/dlc/v20210125/examples.json +1 -1
  58. tccli/services/domain/domain_client.py +53 -0
  59. tccli/services/domain/v20180808/api.json +62 -0
  60. tccli/services/domain/v20180808/examples.json +8 -0
  61. tccli/services/dts/v20211206/api.json +1 -1
  62. tccli/services/ess/ess_client.py +57 -4
  63. tccli/services/ess/v20201111/api.json +89 -1
  64. tccli/services/ess/v20201111/examples.json +8 -0
  65. tccli/services/essbasic/v20210526/api.json +1 -1
  66. tccli/services/faceid/v20180301/api.json +21 -1
  67. tccli/services/faceid/v20180301/examples.json +1 -1
  68. tccli/services/hunyuan/hunyuan_client.py +53 -0
  69. tccli/services/hunyuan/v20230901/api.json +165 -26
  70. tccli/services/hunyuan/v20230901/examples.json +33 -1
  71. tccli/services/ims/v20200713/api.json +13 -0
  72. tccli/services/ims/v20200713/examples.json +1 -1
  73. tccli/services/ims/v20201229/api.json +2 -1
  74. tccli/services/iotvideo/v20211125/api.json +15 -0
  75. tccli/services/lcic/v20220817/api.json +1 -1
  76. tccli/services/lke/lke_client.py +114 -8
  77. tccli/services/lke/v20231130/api.json +492 -0
  78. tccli/services/lke/v20231130/examples.json +18 -2
  79. tccli/services/mariadb/v20170312/api.json +2 -2
  80. tccli/services/monitor/v20180724/api.json +1 -1
  81. tccli/services/mps/v20190612/api.json +46 -1
  82. tccli/services/ocr/ocr_client.py +53 -0
  83. tccli/services/ocr/v20181119/api.json +156 -0
  84. tccli/services/ocr/v20181119/examples.json +8 -0
  85. tccli/services/rce/v20201103/api.json +9 -9
  86. tccli/services/rum/v20210622/api.json +37 -35
  87. tccli/services/rum/v20210622/examples.json +7 -7
  88. tccli/services/tdmq/v20200217/api.json +6 -6
  89. tccli/services/teo/teo_client.py +338 -20
  90. tccli/services/teo/v20220901/api.json +503 -18
  91. tccli/services/teo/v20220901/examples.json +62 -2
  92. tccli/services/tione/v20191022/api.json +6 -7
  93. tccli/services/tione/v20191022/examples.json +1 -1
  94. tccli/services/tione/v20211111/api.json +2 -0
  95. tccli/services/tke/v20180525/api.json +77 -93
  96. tccli/services/tke/v20180525/examples.json +7 -7
  97. tccli/services/tms/tms_client.py +53 -0
  98. tccli/services/tms/v20201229/api.json +44 -0
  99. tccli/services/tms/v20201229/examples.json +8 -0
  100. tccli/services/tmt/v20180321/api.json +1 -1
  101. tccli/services/tse/v20201207/api.json +49 -1
  102. tccli/services/vpc/v20170312/api.json +3 -0
  103. tccli/services/vpc/v20170312/examples.json +3 -3
  104. tccli/services/waf/v20180125/api.json +2 -2
  105. {tccli-3.0.1098.1.dist-info → tccli-3.0.1100.1.dist-info}/METADATA +2 -2
  106. {tccli-3.0.1098.1.dist-info → tccli-3.0.1100.1.dist-info}/RECORD +109 -92
  107. {tccli-3.0.1098.1.dist-info → tccli-3.0.1100.1.dist-info}/WHEEL +0 -0
  108. {tccli-3.0.1098.1.dist-info → tccli-3.0.1100.1.dist-info}/entry_points.txt +0 -0
  109. {tccli-3.0.1098.1.dist-info → tccli-3.0.1100.1.dist-info}/license_files/LICENSE +0 -0
@@ -641,6 +641,58 @@ def doCreateFlowGroupSignReview(args, parsed_globals):
641
641
  FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
642
642
 
643
643
 
644
+ def doUnbindEmployeeUserIdWithClientOpenId(args, parsed_globals):
645
+ g_param = parse_global_arg(parsed_globals)
646
+
647
+ if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
648
+ cred = credential.CVMRoleCredential()
649
+ elif g_param[OptionsDefine.RoleArn.replace('-', '_')] and g_param[OptionsDefine.RoleSessionName.replace('-', '_')]:
650
+ cred = credential.STSAssumeRoleCredential(
651
+ g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.RoleArn.replace('-', '_')],
652
+ g_param[OptionsDefine.RoleSessionName.replace('-', '_')], endpoint=g_param["sts_cred_endpoint"]
653
+ )
654
+ 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):
655
+ cred = credential.DefaultTkeOIDCRoleArnProvider().get_credentials()
656
+ else:
657
+ cred = credential.Credential(
658
+ g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.Token]
659
+ )
660
+ http_profile = HttpProfile(
661
+ reqTimeout=60 if g_param[OptionsDefine.Timeout] is None else int(g_param[OptionsDefine.Timeout]),
662
+ reqMethod="POST",
663
+ endpoint=g_param[OptionsDefine.Endpoint],
664
+ proxy=g_param[OptionsDefine.HttpsProxy.replace('-', '_')]
665
+ )
666
+ profile = ClientProfile(httpProfile=http_profile, signMethod="HmacSHA256")
667
+ if g_param[OptionsDefine.Language]:
668
+ profile.language = g_param[OptionsDefine.Language]
669
+ mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
670
+ client = mod.EssClient(cred, g_param[OptionsDefine.Region], profile)
671
+ client._sdkVersion += ("_CLI_" + __version__)
672
+ models = MODELS_MAP[g_param[OptionsDefine.Version]]
673
+ model = models.UnbindEmployeeUserIdWithClientOpenIdRequest()
674
+ model.from_json_string(json.dumps(args))
675
+ start_time = time.time()
676
+ while True:
677
+ rsp = client.UnbindEmployeeUserIdWithClientOpenId(model)
678
+ result = rsp.to_json_string()
679
+ try:
680
+ json_obj = json.loads(result)
681
+ except TypeError as e:
682
+ json_obj = json.loads(result.decode('utf-8')) # python3.3
683
+ if not g_param[OptionsDefine.Waiter] or search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj) == g_param['OptionsDefine.WaiterInfo']['to']:
684
+ break
685
+ cur_time = time.time()
686
+ if cur_time - start_time >= g_param['OptionsDefine.WaiterInfo']['timeout']:
687
+ raise ClientError('Request timeout, wait `%s` to `%s` timeout, last request is %s' %
688
+ (g_param['OptionsDefine.WaiterInfo']['expr'], g_param['OptionsDefine.WaiterInfo']['to'],
689
+ search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj)))
690
+ else:
691
+ print('Inquiry result is %s.' % search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj))
692
+ time.sleep(g_param['OptionsDefine.WaiterInfo']['interval'])
693
+ FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
694
+
695
+
644
696
  def doRenewAutoSignLicense(args, parsed_globals):
645
697
  g_param = parse_global_arg(parsed_globals)
646
698
 
@@ -849,7 +901,7 @@ def doModifyExtendedService(args, parsed_globals):
849
901
  FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
850
902
 
851
903
 
852
- def doUnbindEmployeeUserIdWithClientOpenId(args, parsed_globals):
904
+ def doDescribeBatchOrganizationRegistrationUrls(args, parsed_globals):
853
905
  g_param = parse_global_arg(parsed_globals)
854
906
 
855
907
  if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
@@ -878,11 +930,11 @@ def doUnbindEmployeeUserIdWithClientOpenId(args, parsed_globals):
878
930
  client = mod.EssClient(cred, g_param[OptionsDefine.Region], profile)
879
931
  client._sdkVersion += ("_CLI_" + __version__)
880
932
  models = MODELS_MAP[g_param[OptionsDefine.Version]]
881
- model = models.UnbindEmployeeUserIdWithClientOpenIdRequest()
933
+ model = models.DescribeBatchOrganizationRegistrationUrlsRequest()
882
934
  model.from_json_string(json.dumps(args))
883
935
  start_time = time.time()
884
936
  while True:
885
- rsp = client.UnbindEmployeeUserIdWithClientOpenId(model)
937
+ rsp = client.DescribeBatchOrganizationRegistrationUrls(model)
886
938
  result = rsp.to_json_string()
887
939
  try:
888
940
  json_obj = json.loads(result)
@@ -4096,11 +4148,12 @@ ACTION_MAP = {
4096
4148
  "CreateUserAutoSignSealUrl": doCreateUserAutoSignSealUrl,
4097
4149
  "CreateUserAutoSignEnableUrl": doCreateUserAutoSignEnableUrl,
4098
4150
  "CreateFlowGroupSignReview": doCreateFlowGroupSignReview,
4151
+ "UnbindEmployeeUserIdWithClientOpenId": doUnbindEmployeeUserIdWithClientOpenId,
4099
4152
  "RenewAutoSignLicense": doRenewAutoSignLicense,
4100
4153
  "CreateEmbedWebUrl": doCreateEmbedWebUrl,
4101
4154
  "VerifyPdf": doVerifyPdf,
4102
4155
  "ModifyExtendedService": doModifyExtendedService,
4103
- "UnbindEmployeeUserIdWithClientOpenId": doUnbindEmployeeUserIdWithClientOpenId,
4156
+ "DescribeBatchOrganizationRegistrationUrls": doDescribeBatchOrganizationRegistrationUrls,
4104
4157
  "CreateBatchCancelFlowUrl": doCreateBatchCancelFlowUrl,
4105
4158
  "ModifyFlowDeadline": doModifyFlowDeadline,
4106
4159
  "BindEmployeeUserIdWithClientOpenId": doBindEmployeeUserIdWithClientOpenId,
@@ -315,6 +315,13 @@
315
315
  "output": "DeleteSealPoliciesResponse",
316
316
  "status": "online"
317
317
  },
318
+ "DescribeBatchOrganizationRegistrationUrls": {
319
+ "document": "此接口用于获取企业批量认证异步任务的状态及结果。\n\n前提条件:已调用 CreateBatchOrganizationRegistrationTasks创建企业批量认证链接任务接口,并得到了任务Id。\n\n异步任务的处理完成时间视当前已提交的任务量、任务的复杂程度等因素决定,正常情况下 3~5 秒即可完成,但也可能需要更长的时间",
320
+ "input": "DescribeBatchOrganizationRegistrationUrlsRequest",
321
+ "name": "查询企业批量认证链接",
322
+ "output": "DescribeBatchOrganizationRegistrationUrlsResponse",
323
+ "status": "online"
324
+ },
318
325
  "DescribeBillUsage": {
319
326
  "document": "通过此接口(DescribeBillUsage)查询该企业的套餐套餐使用情况。",
320
327
  "input": "DescribeBillUsageRequest",
@@ -5627,7 +5634,7 @@
5627
5634
  },
5628
5635
  {
5629
5636
  "disabled": false,
5630
- "document": "授权有效期。时间戳秒级",
5637
+ "document": "授权有效期,时间戳秒级。可以传0,代表有效期到2099年12月12日23点59分59秒。",
5631
5638
  "example": "无",
5632
5639
  "member": "int64",
5633
5640
  "name": "Expired",
@@ -6563,6 +6570,61 @@
6563
6570
  ],
6564
6571
  "usage": "both"
6565
6572
  },
6573
+ "DescribeBatchOrganizationRegistrationUrlsRequest": {
6574
+ "document": "DescribeBatchOrganizationRegistrationUrls请求参数结构体",
6575
+ "members": [
6576
+ {
6577
+ "disabled": false,
6578
+ "document": "执行本接口操作的员工信息。\n注: `在调用此接口时,请确保指定的员工已获得所需的接口调用权限,并具备接口传入的相应资源的数据权限。`",
6579
+ "example": "无",
6580
+ "member": "UserInfo",
6581
+ "name": "Operator",
6582
+ "required": true,
6583
+ "type": "object"
6584
+ },
6585
+ {
6586
+ "disabled": false,
6587
+ "document": "通过接口CreateBatchOrganizationRegistrationTasks创建企业批量认证链接任得到的任务Id",
6588
+ "example": "无",
6589
+ "member": "string",
6590
+ "name": "TaskId",
6591
+ "required": true,
6592
+ "type": "string"
6593
+ },
6594
+ {
6595
+ "disabled": false,
6596
+ "document": "代理相关应用信息,如集团主企业代子企业操作的场景中ProxyOrganizationId必填",
6597
+ "example": "无",
6598
+ "member": "Agent",
6599
+ "name": "Agent",
6600
+ "required": false,
6601
+ "type": "object"
6602
+ }
6603
+ ],
6604
+ "type": "object"
6605
+ },
6606
+ "DescribeBatchOrganizationRegistrationUrlsResponse": {
6607
+ "document": "DescribeBatchOrganizationRegistrationUrls返回参数结构体",
6608
+ "members": [
6609
+ {
6610
+ "disabled": false,
6611
+ "document": "企业批量注册链接信息",
6612
+ "example": "无",
6613
+ "member": "OrganizationAuthUrl",
6614
+ "name": "OrganizationAuthUrls",
6615
+ "output_required": false,
6616
+ "type": "list",
6617
+ "value_allowed_null": false
6618
+ },
6619
+ {
6620
+ "document": "唯一请求 ID,由服务端生成,每次请求都会返回(若请求因其他原因未能抵达服务端,则该次请求不会获得 RequestId)。定位问题时需要提供该次请求的 RequestId。",
6621
+ "member": "string",
6622
+ "name": "RequestId",
6623
+ "type": "string"
6624
+ }
6625
+ ],
6626
+ "type": "object"
6627
+ },
6566
6628
  "DescribeBillUsageDetailRequest": {
6567
6629
  "document": "DescribeBillUsageDetail请求参数结构体",
6568
6630
  "members": [
@@ -11083,6 +11145,32 @@
11083
11145
  ],
11084
11146
  "usage": "out"
11085
11147
  },
11148
+ "OrganizationAuthUrl": {
11149
+ "document": "企业批量注册链接信息",
11150
+ "members": [
11151
+ {
11152
+ "disabled": false,
11153
+ "document": "企业批量注册链接,根据Endpoint的不同设置,返回不同的链接地址。失效时间:7天\n跳转链接, 链接的有效期根据企业,员工状态和终端等有区别, 可以参考下表\n<table> <thead> <tr> <th>Endpoint</th> <th>示例</th> <th>链接有效期限</th> </tr> </thead> <tbody>\n <tr> <td>PC</td> <td>https://qian.tencent.com/console/batch-register?token=yDSx0UUgtjuaf4UEfd2MjCnfI1iuXFE6&orgName=批量认证线上测试企业9</td> <td>7天</td> </tr> \n<tr> <td>PC_SHORT_URL</td> <td>https://test.essurl.cn/8gDKUBAWK8</td> <td>7天</td> </tr> \n<tr> <td>APP</td> <td>/pages/guide/index?to=REGISTER_ENTERPRISE_FOR_BATCH&urlAuthToken=yDSx0UUgtjuaf4UEfd2MjCnfI1iuXFE6&orgName=批量认证线上测试企业9</td> <td>7天</td> </tr> </tbody> </table>\n注: \n`1.创建的链接应避免被转义,如:&被转义为\\u0026;如使用Postman请求后,请选择响应类型为 JSON,否则链接将被转义`\n",
11154
+ "example": "无",
11155
+ "member": "string",
11156
+ "name": "AuthUrl",
11157
+ "output_required": false,
11158
+ "type": "string",
11159
+ "value_allowed_null": false
11160
+ },
11161
+ {
11162
+ "disabled": false,
11163
+ "document": "企业批量注册的错误信息,例如:企业三要素不通过\t",
11164
+ "example": "无",
11165
+ "member": "string",
11166
+ "name": "ErrorMessage",
11167
+ "output_required": false,
11168
+ "type": "string",
11169
+ "value_allowed_null": false
11170
+ }
11171
+ ],
11172
+ "usage": "out"
11173
+ },
11086
11174
  "OrganizationInfo": {
11087
11175
  "document": "机构信息",
11088
11176
  "members": [
@@ -1080,6 +1080,14 @@
1080
1080
  "title": "撤销印章授权"
1081
1081
  }
1082
1082
  ],
1083
+ "DescribeBatchOrganizationRegistrationUrls": [
1084
+ {
1085
+ "document": "",
1086
+ "input": "POST / HTTP/1.1\nHost: ess.tencentcloudapi.com\nContent-Type: application/json\nX-TC-Action: DescribeBatchOrganizationRegistrationUrls\n<公共请求参数>\n\n{\n \"Operator\": {\n \"UserId\": \"yDSxSUUxxxxxxxx21JXBlJZsaj\"\n },\n \"Agent\": {},\n \"TaskId\": \"yDSxSUUxxxxxxxx21JXBlJZsaj\"\n}",
1087
+ "output": "{\n \"Response\": {\n \"OrganizationAuthUrls\": [\n {\n \"AuthUrl\": \"https://test.qian.tencent.cn/console/batch-register?token=yDxxxxxxxxxgENliu9LD&orgName=典子谦批量认证企业\",\n \"ErrorMessage\": \"\"\n }\n ],\n \"RequestId\": \"s1702447767875624775\"\n }\n}",
1088
+ "title": "查询批量企业认证"
1089
+ }
1090
+ ],
1083
1091
  "DescribeBillUsage": [
1084
1092
  {
1085
1093
  "document": "",
@@ -10593,7 +10593,7 @@
10593
10593
  },
10594
10594
  {
10595
10595
  "disabled": false,
10596
- "document": "组织机构超管姓名。\n在注册流程中,这个手机号必须跟操作人在电子签注册的个人手机号一致。",
10596
+ "document": "组织机构超管手机号。\n在注册流程中,这个手机号必须跟操作人在电子签注册的个人手机号一致。",
10597
10597
  "example": "无",
10598
10598
  "member": "string",
10599
10599
  "name": "AdminMobile",
@@ -2768,7 +2768,7 @@
2768
2768
  },
2769
2769
  {
2770
2770
  "disabled": false,
2771
- "document": "设备风险标签,仅错误码返回1007(设备疑似被劫持)时返回风险标签。标签说明:\n202、5001:设备疑似被Root\n203、5004:设备疑似被注入\n205:设备疑似被Hook\n206:设备疑似虚拟运行环境\n5007、1005:设备疑似摄像头被劫持\n8000:设备疑似存在异常篡改行为\n注意:此字段可能返回 null,表示取不到有效值。",
2771
+ "document": "plus版:描述当前请求所在设备的风险标签,详情如下:\n01-设备疑似被Root/设备疑似越狱\n02-设备疑似被注入\n03-设备疑似为模拟器\n04-设备疑似存在风险操作\n05-摄像头疑似被劫持\n06-疑似黑产设备\nnull-无设备风险\n增强版:此字段不生效,默认为null\n注意:此字段可能返回 null,表示取不到有效值。",
2772
2772
  "example": "01",
2773
2773
  "member": "string",
2774
2774
  "name": "DeviceInfoTag",
@@ -2786,6 +2786,26 @@
2786
2786
  "type": "string",
2787
2787
  "value_allowed_null": true
2788
2788
  },
2789
+ {
2790
+ "disabled": false,
2791
+ "document": "plus版:描述当前请求活体阶段被拒绝的详细原因,详情如下:\n01-用户全程闭眼\n02-用户未完成指定动作\n03-疑似翻拍攻击\n04-疑似合成图片\n05-疑似合成视频\n06-疑似合成动作\n07-疑似黑产模版\n08-疑似存在水印\n09-反光校验未通过\n10-最佳帧校验未通过\n11-人脸质量过差\n12-人脸距离不匹配\n13-疑似对抗样本攻击\nnull-无\n增强版:此字段不生效,默认为null\n注意:此字段可能返回 null,表示取不到有效值。",
2792
+ "example": "01",
2793
+ "member": "string",
2794
+ "name": "LivenessInfoTag",
2795
+ "output_required": true,
2796
+ "type": "string",
2797
+ "value_allowed_null": true
2798
+ },
2799
+ {
2800
+ "disabled": false,
2801
+ "document": "plus版:描述当前请求所在设备的风险等级,共4级,详情如下:\n1 - 安全\n2 - 低风险\n3 - 中风险\n4 - 高危\nnull - 未获取到风险等级\n增强版:此字段不生效,默认为null\n注意:此字段可能返回 null,表示取不到有效值。",
2802
+ "example": "1",
2803
+ "member": "string",
2804
+ "name": "DeviceInfoLevel",
2805
+ "output_required": true,
2806
+ "type": "string",
2807
+ "value_allowed_null": true
2808
+ },
2789
2809
  {
2790
2810
  "document": "唯一请求 ID,由服务端生成,每次请求都会返回(若请求因其他原因未能抵达服务端,则该次请求不会获得 RequestId)。定位问题时需要提供该次请求的 RequestId。",
2791
2811
  "member": "string",
@@ -162,7 +162,7 @@
162
162
  {
163
163
  "document": "",
164
164
  "input": "https://faceid.tencentcloudapi.com/?Action=GetFaceIdResult\n&FaceIdToken=CE661F1A-0F1E-45BD-BE13-34C05CEA7681\n&<公共请求参数>",
165
- "output": "{\n \"Response\": {\n \"Result\": \"0\",\n \"Description\": \"成功\",\n \"IdCard\": \"23232323232\",\n \"Name\": \"王五\",\n \"Similarity\": 97.7,\n \"RequestId\": \"0f96cf39-a183-485c-ab29-8427ab81f9ae\",\n \"Extra\": \"\",\n \"VideoBase64\": \"\",\n \"BestFrameBase64\": \"\",\n \"DeviceInfoTag\": \"01\",\n \"RiskInfoTag\": \"02\"\n }\n}",
165
+ "output": "{\n \"Response\": {\n \"Result\": \"0\",\n \"Description\": \"成功\",\n \"IdCard\": \"23232323232\",\n \"Name\": \"王五\",\n \"Similarity\": 97.7,\n \"RequestId\": \"0f96cf39-a183-485c-ab29-8427ab81f9ae\",\n \"Extra\": \"\",\n \"VideoBase64\": \"\",\n \"BestFrameBase64\": \"\",\n \"DeviceInfoTag\": \"01\",\n \"RiskInfoTag\": \"02\",\n \"LivenessInfoTag\": \"01\",\n \"DeviceInfoLevel\": \"1\"\n }\n}",
166
166
  "title": "获取结果成功时"
167
167
  }
168
168
  ],
@@ -17,6 +17,58 @@ from tencentcloud.hunyuan.v20230901 import models as models_v20230901
17
17
  from jmespath import search
18
18
  import time
19
19
 
20
+ def doChatCompletions(args, parsed_globals):
21
+ g_param = parse_global_arg(parsed_globals)
22
+
23
+ if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
24
+ cred = credential.CVMRoleCredential()
25
+ elif g_param[OptionsDefine.RoleArn.replace('-', '_')] and g_param[OptionsDefine.RoleSessionName.replace('-', '_')]:
26
+ cred = credential.STSAssumeRoleCredential(
27
+ g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.RoleArn.replace('-', '_')],
28
+ g_param[OptionsDefine.RoleSessionName.replace('-', '_')], endpoint=g_param["sts_cred_endpoint"]
29
+ )
30
+ 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):
31
+ cred = credential.DefaultTkeOIDCRoleArnProvider().get_credentials()
32
+ else:
33
+ cred = credential.Credential(
34
+ g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.Token]
35
+ )
36
+ http_profile = HttpProfile(
37
+ reqTimeout=60 if g_param[OptionsDefine.Timeout] is None else int(g_param[OptionsDefine.Timeout]),
38
+ reqMethod="POST",
39
+ endpoint=g_param[OptionsDefine.Endpoint],
40
+ proxy=g_param[OptionsDefine.HttpsProxy.replace('-', '_')]
41
+ )
42
+ profile = ClientProfile(httpProfile=http_profile, signMethod="HmacSHA256")
43
+ if g_param[OptionsDefine.Language]:
44
+ profile.language = g_param[OptionsDefine.Language]
45
+ mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
46
+ client = mod.HunyuanClient(cred, g_param[OptionsDefine.Region], profile)
47
+ client._sdkVersion += ("_CLI_" + __version__)
48
+ models = MODELS_MAP[g_param[OptionsDefine.Version]]
49
+ model = models.ChatCompletionsRequest()
50
+ model.from_json_string(json.dumps(args))
51
+ start_time = time.time()
52
+ while True:
53
+ rsp = client.ChatCompletions(model)
54
+ result = rsp.to_json_string()
55
+ try:
56
+ json_obj = json.loads(result)
57
+ except TypeError as e:
58
+ json_obj = json.loads(result.decode('utf-8')) # python3.3
59
+ if not g_param[OptionsDefine.Waiter] or search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj) == g_param['OptionsDefine.WaiterInfo']['to']:
60
+ break
61
+ cur_time = time.time()
62
+ if cur_time - start_time >= g_param['OptionsDefine.WaiterInfo']['timeout']:
63
+ raise ClientError('Request timeout, wait `%s` to `%s` timeout, last request is %s' %
64
+ (g_param['OptionsDefine.WaiterInfo']['expr'], g_param['OptionsDefine.WaiterInfo']['to'],
65
+ search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj)))
66
+ else:
67
+ print('Inquiry result is %s.' % search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj))
68
+ time.sleep(g_param['OptionsDefine.WaiterInfo']['interval'])
69
+ FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
70
+
71
+
20
72
  def doChatPro(args, parsed_globals):
21
73
  g_param = parse_global_arg(parsed_globals)
22
74
 
@@ -236,6 +288,7 @@ MODELS_MAP = {
236
288
  }
237
289
 
238
290
  ACTION_MAP = {
291
+ "ChatCompletions": doChatCompletions,
239
292
  "ChatPro": doChatPro,
240
293
  "ChatStd": doChatStd,
241
294
  "GetTokenCount": doGetTokenCount,