tccli 3.0.1097.1__py2.py3-none-any.whl → 3.0.1099.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 (64) hide show
  1. tccli/__init__.py +1 -1
  2. tccli/examples/apm/v20210622/DescribeGeneralApmApplicationConfig.md +103 -0
  3. tccli/examples/apm/v20210622/DescribeTagValues.md +27 -0
  4. tccli/examples/apm/v20210622/ModifyGeneralApmApplicationConfig.md +29 -0
  5. tccli/examples/cfw/v20190904/DescribeIPStatusList.md +4 -4
  6. tccli/examples/cls/v20201016/OpenKafkaConsumer.md +1 -1
  7. tccli/examples/cynosdb/v20190107/DescribeChangedParamsAfterUpgrade.md +31 -0
  8. tccli/examples/ess/v20201111/CreateBatchSignUrl.md +28 -0
  9. tccli/examples/essbasic/v20210526/ChannelCreateBatchSignUrl.md +28 -0
  10. tccli/examples/faceid/v20180301/GetFaceIdResult.md +3 -1
  11. tccli/examples/hunyuan/v20230901/ChatCompletions.md +43 -0
  12. tccli/examples/ims/v20200713/ImageModeration.md +4 -1
  13. tccli/examples/iotexplorer/v20190423/DescribeDeviceFirmwares.md +33 -0
  14. tccli/examples/teo/v20220901/DescribeRealtimeLogDeliveryTasks.md +42 -21
  15. tccli/services/aiart/v20221229/api.json +1 -1
  16. tccli/services/apm/apm_client.py +159 -0
  17. tccli/services/apm/v20210622/api.json +456 -0
  18. tccli/services/apm/v20210622/examples.json +24 -0
  19. tccli/services/ccc/v20200210/api.json +1 -1
  20. tccli/services/cfs/v20190719/api.json +27 -27
  21. tccli/services/cfw/v20190904/api.json +5 -5
  22. tccli/services/cfw/v20190904/examples.json +1 -1
  23. tccli/services/cloudstudio/v20230508/api.json +14 -5
  24. tccli/services/cls/v20201016/api.json +68 -44
  25. tccli/services/cls/v20201016/examples.json +1 -1
  26. tccli/services/cynosdb/cynosdb_client.py +53 -0
  27. tccli/services/cynosdb/v20190107/api.json +122 -2
  28. tccli/services/cynosdb/v20190107/examples.json +8 -0
  29. tccli/services/dcdb/v20180411/api.json +2 -2
  30. tccli/services/ess/v20201111/api.json +51 -3
  31. tccli/services/ess/v20201111/examples.json +6 -0
  32. tccli/services/essbasic/v20210526/api.json +50 -2
  33. tccli/services/essbasic/v20210526/examples.json +6 -0
  34. tccli/services/faceid/v20180301/api.json +21 -1
  35. tccli/services/faceid/v20180301/examples.json +1 -1
  36. tccli/services/hunyuan/hunyuan_client.py +53 -0
  37. tccli/services/hunyuan/v20230901/api.json +161 -22
  38. tccli/services/hunyuan/v20230901/examples.json +8 -0
  39. tccli/services/ims/v20200713/api.json +13 -0
  40. tccli/services/ims/v20200713/examples.json +1 -1
  41. tccli/services/ims/v20201229/api.json +55 -55
  42. tccli/services/iotexplorer/iotexplorer_client.py +53 -0
  43. tccli/services/iotexplorer/v20190423/api.json +89 -0
  44. tccli/services/iotexplorer/v20190423/examples.json +8 -0
  45. tccli/services/iss/v20230517/api.json +36 -0
  46. tccli/services/lcic/v20220817/api.json +1 -1
  47. tccli/services/lke/lke_client.py +8 -114
  48. tccli/services/lke/v20231130/api.json +2 -166
  49. tccli/services/lke/v20231130/examples.json +0 -16
  50. tccli/services/mariadb/v20170312/api.json +2 -2
  51. tccli/services/monitor/v20180724/api.json +1 -1
  52. tccli/services/mps/v20190612/api.json +46 -1
  53. tccli/services/rum/v20210622/api.json +2 -2
  54. tccli/services/tdid/v20210519/api.json +2 -2
  55. tccli/services/teo/v20220901/api.json +142 -31
  56. tccli/services/teo/v20220901/examples.json +2 -2
  57. tccli/services/tione/v20211111/api.json +28 -0
  58. tccli/services/tmt/v20180321/api.json +1 -1
  59. tccli/services/waf/v20180125/api.json +2 -2
  60. {tccli-3.0.1097.1.dist-info → tccli-3.0.1099.1.dist-info}/METADATA +2 -2
  61. {tccli-3.0.1097.1.dist-info → tccli-3.0.1099.1.dist-info}/RECORD +64 -58
  62. {tccli-3.0.1097.1.dist-info → tccli-3.0.1099.1.dist-info}/WHEEL +0 -0
  63. {tccli-3.0.1097.1.dist-info → tccli-3.0.1099.1.dist-info}/entry_points.txt +0 -0
  64. {tccli-3.0.1097.1.dist-info → tccli-3.0.1099.1.dist-info}/license_files/LICENSE +0 -0
@@ -338,6 +338,14 @@
338
338
  "title": "查询集群Binlog日志列表"
339
339
  }
340
340
  ],
341
+ "DescribeChangedParamsAfterUpgrade": [
342
+ {
343
+ "document": "查询升降配运行参数对比",
344
+ "input": "POST / HTTP/1.1\nHost: cynosdb.tencentcloudapi.com\nContent-Type: application/json\nX-TC-Action: DescribeChangedParamsAfterUpgrade\n<公共请求参数>\n\n{\n \"InstanceId\": \"cynosdbmysql-ins-p8dst5v9\",\n \"DstCpu\": 1,\n \"DstMem\": 1\n}",
345
+ "output": "{\n \"Response\": {\n \"RequestId\": \"7613eed6-5eb5-4d17-ae69-dd93c44d7ad4\",\n \"TotalCount\": 1,\n \"Items\": [\n {\n \"ParamName\": \"demoString\",\n \"NewValue\": \"demoString\",\n \"OldValue\": \"demoString\",\n \"ValueFunction\": \"demoString\"\n }\n ]\n }\n}",
346
+ "title": "查询升降配运行参数对比"
347
+ }
348
+ ],
341
349
  "DescribeClusterDatabases": [
342
350
  {
343
351
  "document": "",
@@ -15,7 +15,7 @@
15
15
  "status": "online"
16
16
  },
17
17
  "CancelDcnJob": {
18
- "document": "取消DCN同步",
18
+ "document": "本接口(CancelDcnJob)用于取消DCN同步",
19
19
  "input": "CancelDcnJobRequest",
20
20
  "name": "取消DCN同步",
21
21
  "output": "CancelDcnJobResponse",
@@ -731,7 +731,7 @@
731
731
  "example": "11211",
732
732
  "member": "int64",
733
733
  "name": "FlowId",
734
- "required": true,
734
+ "output_required": true,
735
735
  "type": "int",
736
736
  "value_allowed_null": false
737
737
  },
@@ -2260,7 +2260,7 @@
2260
2260
  "example": "无",
2261
2261
  "member": "string",
2262
2262
  "name": "Name",
2263
- "required": true,
2263
+ "required": false,
2264
2264
  "type": "string"
2265
2265
  },
2266
2266
  {
@@ -2269,7 +2269,7 @@
2269
2269
  "example": "无",
2270
2270
  "member": "string",
2271
2271
  "name": "Mobile",
2272
- "required": true,
2272
+ "required": false,
2273
2273
  "type": "string"
2274
2274
  },
2275
2275
  {
@@ -2334,6 +2334,15 @@
2334
2334
  "name": "JumpToDetail",
2335
2335
  "required": false,
2336
2336
  "type": "bool"
2337
+ },
2338
+ {
2339
+ "disabled": false,
2340
+ "document": "批量签署合同相关信息,指定合同和签署方的信息,用于补充动态签署人。\t",
2341
+ "example": "无",
2342
+ "member": "FlowBatchUrlInfo",
2343
+ "name": "FlowBatchUrlInfo",
2344
+ "required": false,
2345
+ "type": "object"
2337
2346
  }
2338
2347
  ],
2339
2348
  "type": "object"
@@ -5618,7 +5627,7 @@
5618
5627
  },
5619
5628
  {
5620
5629
  "disabled": false,
5621
- "document": "授权有效期。时间戳秒级",
5630
+ "document": "授权有效期,时间戳秒级。可以传0,代表有效期到2099年12月12日23点59分59秒。",
5622
5631
  "example": "无",
5623
5632
  "member": "int64",
5624
5633
  "name": "Expired",
@@ -9127,6 +9136,45 @@
9127
9136
  ],
9128
9137
  "usage": "out"
9129
9138
  },
9139
+ "FlowBatchApproverInfo": {
9140
+ "document": "批量签署合同相关信息,指定批量签署合同和签署方的信息,用于补充动态签署人。",
9141
+ "members": [
9142
+ {
9143
+ "disabled": false,
9144
+ "document": "合同流程ID。",
9145
+ "example": "yDwFmUUckpstqfvzUE1h3jo1f3cqjkGm",
9146
+ "member": "string",
9147
+ "name": "FlowId",
9148
+ "required": false,
9149
+ "type": "string"
9150
+ },
9151
+ {
9152
+ "disabled": false,
9153
+ "document": "签署节点ID,用于生成动态签署人链接完成领取。注:`生成动态签署人补充链接时必传。`",
9154
+ "example": "无",
9155
+ "member": "string",
9156
+ "name": "RecipientId",
9157
+ "required": false,
9158
+ "type": "string"
9159
+ }
9160
+ ],
9161
+ "usage": "in"
9162
+ },
9163
+ "FlowBatchUrlInfo": {
9164
+ "document": "批量签署合同相关信息,指定批量签署合同和签署方的信息,用于补充动态签署人。",
9165
+ "members": [
9166
+ {
9167
+ "disabled": false,
9168
+ "document": "批量签署合同和签署方的信息,用于补充动态签署人。",
9169
+ "example": "无",
9170
+ "member": "FlowBatchApproverInfo",
9171
+ "name": "FlowBatchApproverInfos",
9172
+ "required": false,
9173
+ "type": "list"
9174
+ }
9175
+ ],
9176
+ "usage": "in"
9177
+ },
9130
9178
  "FlowBrief": {
9131
9179
  "document": "合同流程的基础信息",
9132
9180
  "members": [
@@ -176,6 +176,12 @@
176
176
  "input": "POST / HTTP/1.1\nHost: ess.tencentcloudapi.com\nContent-Type: application/json\nX-TC-Action: CreateBatchSignUrl\n<公共请求参数>\n\n{\n \"IdCardNumber\": \"\",\n \"IdCardType\": \"\",\n \"Name\": \"张三\",\n \"NotifyType\": \"SMS\",\n \"Mobile\": \"17777777777\",\n \"Operator\": {\n \"UserId\": \"yDRCLUUgygq2******uO4zjEwg0vjoimj\"\n },\n \"FlowIds\": [\n \"yDR1AUUgygja******uO4zjEB8zAkJEFN\"\n ]\n}",
177
177
  "output": "{\n \"Response\": {\n \"Error\": {\n \"Code\": \"InvalidParameter\",\n \"Message\": \"合同[yDR1AUUgygja******uO4zjEB8zAkJEFN]不包含链接中的参与方信息, 请确保链接姓名手机号等信息与合同中一致\"\n },\n \"RequestId\": \"5beb5f54-cf3d-4c26-a4ee-a97c85196a3e\"\n }\n}",
178
178
  "title": "合同发起的时候签署方信息和生成链接中的不一致"
179
+ },
180
+ {
181
+ "document": "按照合同发起时候返回的合同信息生成批量签署链接,通过FlowIds参数对用户可以批签的合同进行限制,并指定批量领取的动态签署方。",
182
+ "input": "POST / HTTP/1.1\nHost: ess.tencentcloudapi.com\nContent-Type: application/json\nX-TC-Action: CreateBatchSignUrl\n<公共请求参数>\n\n{\n \"Operator\": {\n \"UserId\": \"yDRCLUUgygq2******uO4zjEwg0vjoimj\"\n },\n \"FlowIds\": [\n \"yDwFdUUckpsw******yQ0af8bHosXQtb\",\n \"yDR1AUUgygj******uO4zjE8gTG7xvgH\"\n ],\n \"FlowBatchUrlInfo\": {\n \"FlowBatchApproverInfos\": [\n {\n \"FlowId\": \"yDwFdUUckpsw******yQ0af8bHosXQtb\",\n \"RecipientId\": \"yDC5SUUckp******sumxxsjT3EEMVG\"\n },\n {\n \"FlowId\": \"yDR1AUUgygj******uO4zjE8gTG7xvgH\",\n \"RecipientId\": \"yDC5SUUckp*****sumxEeTQ3Xcn0B\"\n }\n ]\n }\n}",
183
+ "output": "{\n \"Response\": {\n \"ExpiredTime\": 1714533495,\n \"MiniAppPath\": \"pages/guide/index?shortKey=yDC5tUf****tMb93lb5\",\n \"RequestId\": \"s1713928695416440124\",\n \"SignUrl\": \"https://test.essurl.cn/uBS****do7\"\n }\n}",
184
+ "title": "生成动态签署人批量领取链接"
179
185
  }
180
186
  ],
181
187
  "CreateConvertTaskApi": [
@@ -1669,7 +1669,7 @@
1669
1669
  "example": "无",
1670
1670
  "member": "string",
1671
1671
  "name": "Name",
1672
- "required": true,
1672
+ "required": false,
1673
1673
  "type": "string"
1674
1674
  },
1675
1675
  {
@@ -1678,7 +1678,7 @@
1678
1678
  "example": "无",
1679
1679
  "member": "string",
1680
1680
  "name": "Mobile",
1681
- "required": true,
1681
+ "required": false,
1682
1682
  "type": "string"
1683
1683
  },
1684
1684
  {
@@ -1743,6 +1743,15 @@
1743
1743
  "name": "JumpToDetail",
1744
1744
  "required": false,
1745
1745
  "type": "bool"
1746
+ },
1747
+ {
1748
+ "disabled": false,
1749
+ "document": "批量签署合同相关信息,指定合同和签署方的信息,用于补充动态签署人。\t",
1750
+ "example": "无",
1751
+ "member": "FlowBatchUrlInfo",
1752
+ "name": "FlowBatchUrlInfo",
1753
+ "required": false,
1754
+ "type": "object"
1746
1755
  }
1747
1756
  ],
1748
1757
  "type": "object"
@@ -8540,6 +8549,45 @@
8540
8549
  ],
8541
8550
  "usage": "out"
8542
8551
  },
8552
+ "FlowBatchApproverInfo": {
8553
+ "document": "批量签署合同相关信息,指定批量签署合同和签署方的信息,用于补充动态签署人。",
8554
+ "members": [
8555
+ {
8556
+ "disabled": false,
8557
+ "document": "合同流程ID。",
8558
+ "example": "yDwFmUUckpstqfvzUE1h3jo1f3cqjkGm",
8559
+ "member": "string",
8560
+ "name": "FlowId",
8561
+ "required": false,
8562
+ "type": "string"
8563
+ },
8564
+ {
8565
+ "disabled": false,
8566
+ "document": "签署节点ID,用于生成动态签署人链接完成领取。注:`生成动态签署人补充链接时必传。`",
8567
+ "example": "无",
8568
+ "member": "string",
8569
+ "name": "RecipientId",
8570
+ "required": false,
8571
+ "type": "string"
8572
+ }
8573
+ ],
8574
+ "usage": "in"
8575
+ },
8576
+ "FlowBatchUrlInfo": {
8577
+ "document": "批量签署合同相关信息,指定批量签署合同和签署方的信息,用于补充动态签署人。",
8578
+ "members": [
8579
+ {
8580
+ "disabled": false,
8581
+ "document": "批量签署合同和签署方的信息,用于补充动态签署人。",
8582
+ "example": "无",
8583
+ "member": "FlowBatchApproverInfo",
8584
+ "name": "FlowBatchApproverInfos",
8585
+ "required": false,
8586
+ "type": "list"
8587
+ }
8588
+ ],
8589
+ "usage": "in"
8590
+ },
8543
8591
  "FlowDetailInfo": {
8544
8592
  "document": "此结构体(FlowDetailInfo)描述的是合同(流程)的详细信息",
8545
8593
  "members": [
@@ -132,6 +132,12 @@
132
132
  "input": "POST / HTTP/1.1\nHost: ess.tencentcloudapi.com\nContent-Type: application/json\nX-TC-Action: CreateBatchSignUrl\n<公共请求参数>\n\n{\n \"IdCardNumber\": \"\",\n \"IdCardType\": \"\",\n \"Name\": \"张三\",\n \"NotifyType\": \"SMS\",\n \"Mobile\": \"17777777777\",\n \"Agent\": {\n \"ProxyOperator\": {\n \"OpenId\": \"test_open_id\"\n },\n \"ProxyOrganizationOpenId\": \"test_org_open_id\",\n \"AppId\": \"yDxbWUyKQ*******4zjEB8mxCcDjAyF\"\n },\n \"FlowIds\": [\n \"yDR1AUUgygja******uO4zjEB8zAkJEFN\"\n ]\n}",
133
133
  "output": "{\n \"Response\": {\n \"Error\": {\n \"Code\": \"InvalidParameter\",\n \"Message\": \"合同[yDR1AUUgygja******uO4zjEB8zAkJEFN]不包含链接中的参与方信息, 请确保链接姓名手机号等信息与合同中一致\"\n },\n \"RequestId\": \"5beb5f54-cf3d-4c26-a4ee-a97c85196a3e\"\n }\n}",
134
134
  "title": "合同发起的时候签署方信息和生成链接中的不一致"
135
+ },
136
+ {
137
+ "document": "按照合同发起时候返回的合同信息生成批量签署链接,通过FlowIds参数对用户可以批签的合同进行限制,并指定批量领取的动态签署方。",
138
+ "input": "POST / HTTP/1.1\nHost: essbasic.tencentcloudapi.com\nContent-Type: application/json\nX-TC-Action: ChannelCreateBatchSignUrl\n<公共请求参数>\n\n{\n \"Agent\": {\n \"ProxyOperator\": {\n \"OpenId\": \"test_open_id\"\n },\n \"ProxyOrganizationOpenId\": \"test_org_open_id\",\n \"AppId\": \"yDxbWUyKQ*******4zjEB8mxCcDjAyF\"\n },\n \"FlowIds\": [\n \"yDwFdUUckpsw******yQ0af8bHosXQtb\",\n \"yDR1AUUgygj******uO4zjE8gTG7xvgH\"\n ],\n \"FlowBatchUrlInfo\": {\n \"FlowBatchApproverInfos\": [\n {\n \"FlowId\": \"yDC5yUUckpwexoz4UuoHfkT1DMEDQSG5\",\n \"RecipientId\": \"yDC5yUUckpwexozwUuoHfkTwB00zdfLo\"\n }\n ]\n }\n}",
139
+ "output": "{\n \"Response\": {\n \"ExpiredTime\": 1684899114,\n \"RequestId\": \"5beb5f54-cf3d-4c26-a4ee-a97c85196a3e\",\n \"SignUrl\": \"https://ess.url.cn/FuP**Swc\",\n \"MiniAppPath\": \"pages/guide/index?shortKey=FuP3**wc\"\n }\n}",
140
+ "title": "生成动态签署人批量领取链接"
135
141
  }
136
142
  ],
137
143
  "ChannelCreateBoundFlows": [
@@ -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,