tccli 3.0.1364.1__py2.py3-none-any.whl → 3.0.1365.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 +1 -1
- tccli/services/autoscaling/v20180419/api.json +1 -1
- tccli/services/cdn/cdn_client.py +161 -1380
- tccli/services/cdn/v20180606/api.json +5302 -9471
- tccli/services/cdn/v20180606/examples.json +0 -184
- tccli/services/cfs/v20190719/api.json +7 -7
- tccli/services/cls/v20201016/api.json +17 -13
- tccli/services/dlc/dlc_client.py +1622 -403
- tccli/services/dlc/v20210125/api.json +10882 -8052
- tccli/services/dlc/v20210125/examples.json +184 -0
- tccli/services/emr/v20190103/api.json +1 -1
- tccli/services/es/v20250101/api.json +38 -1
- tccli/services/ess/ess_client.py +110 -4
- tccli/services/ess/v20201111/api.json +354 -1
- tccli/services/ess/v20201111/examples.json +16 -0
- tccli/services/hunyuan/hunyuan_client.py +73 -179
- tccli/services/hunyuan/v20230901/api.json +0 -190
- tccli/services/hunyuan/v20230901/examples.json +0 -16
- tccli/services/monitor/v20180724/api.json +2 -2
- tccli/services/mps/v20190612/api.json +5 -5
- tccli/services/mqtt/v20240516/api.json +84 -0
- tccli/services/ocr/v20181119/api.json +3 -3
- tccli/services/ssl/v20191205/api.json +3 -3
- tccli/services/teo/teo_client.py +1266 -206
- tccli/services/teo/v20220901/api.json +1794 -112
- tccli/services/teo/v20220901/examples.json +160 -0
- tccli/services/tione/v20211111/api.json +10 -0
- tccli/services/trtc/v20190722/api.json +40 -7
- tccli/services/waf/v20180125/api.json +499 -0
- tccli/services/waf/v20180125/examples.json +32 -0
- tccli/services/waf/waf_client.py +224 -12
- {tccli-3.0.1364.1.dist-info → tccli-3.0.1365.1.dist-info}/METADATA +2 -2
- {tccli-3.0.1364.1.dist-info → tccli-3.0.1365.1.dist-info}/RECORD +36 -36
- {tccli-3.0.1364.1.dist-info → tccli-3.0.1365.1.dist-info}/WHEEL +0 -0
- {tccli-3.0.1364.1.dist-info → tccli-3.0.1365.1.dist-info}/entry_points.txt +0 -0
- {tccli-3.0.1364.1.dist-info → tccli-3.0.1365.1.dist-info}/license_files/LICENSE +0 -0
@@ -17,111 +17,7 @@ from tencentcloud.hunyuan.v20230901 import models as models_v20230901
|
|
17
17
|
from jmespath import search
|
18
18
|
import time
|
19
19
|
|
20
|
-
def
|
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.GetThreadRequest()
|
50
|
-
model.from_json_string(json.dumps(args))
|
51
|
-
start_time = time.time()
|
52
|
-
while True:
|
53
|
-
rsp = client.GetThread(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
|
-
|
72
|
-
def doSubmitHunyuanImageJob(args, parsed_globals):
|
73
|
-
g_param = parse_global_arg(parsed_globals)
|
74
|
-
|
75
|
-
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
76
|
-
cred = credential.CVMRoleCredential()
|
77
|
-
elif g_param[OptionsDefine.RoleArn.replace('-', '_')] and g_param[OptionsDefine.RoleSessionName.replace('-', '_')]:
|
78
|
-
cred = credential.STSAssumeRoleCredential(
|
79
|
-
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.RoleArn.replace('-', '_')],
|
80
|
-
g_param[OptionsDefine.RoleSessionName.replace('-', '_')], endpoint=g_param["sts_cred_endpoint"]
|
81
|
-
)
|
82
|
-
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):
|
83
|
-
cred = credential.DefaultTkeOIDCRoleArnProvider().get_credentials()
|
84
|
-
else:
|
85
|
-
cred = credential.Credential(
|
86
|
-
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.Token]
|
87
|
-
)
|
88
|
-
http_profile = HttpProfile(
|
89
|
-
reqTimeout=60 if g_param[OptionsDefine.Timeout] is None else int(g_param[OptionsDefine.Timeout]),
|
90
|
-
reqMethod="POST",
|
91
|
-
endpoint=g_param[OptionsDefine.Endpoint],
|
92
|
-
proxy=g_param[OptionsDefine.HttpsProxy.replace('-', '_')]
|
93
|
-
)
|
94
|
-
profile = ClientProfile(httpProfile=http_profile, signMethod="HmacSHA256")
|
95
|
-
if g_param[OptionsDefine.Language]:
|
96
|
-
profile.language = g_param[OptionsDefine.Language]
|
97
|
-
mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
|
98
|
-
client = mod.HunyuanClient(cred, g_param[OptionsDefine.Region], profile)
|
99
|
-
client._sdkVersion += ("_CLI_" + __version__)
|
100
|
-
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
101
|
-
model = models.SubmitHunyuanImageJobRequest()
|
102
|
-
model.from_json_string(json.dumps(args))
|
103
|
-
start_time = time.time()
|
104
|
-
while True:
|
105
|
-
rsp = client.SubmitHunyuanImageJob(model)
|
106
|
-
result = rsp.to_json_string()
|
107
|
-
try:
|
108
|
-
json_obj = json.loads(result)
|
109
|
-
except TypeError as e:
|
110
|
-
json_obj = json.loads(result.decode('utf-8')) # python3.3
|
111
|
-
if not g_param[OptionsDefine.Waiter] or search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj) == g_param['OptionsDefine.WaiterInfo']['to']:
|
112
|
-
break
|
113
|
-
cur_time = time.time()
|
114
|
-
if cur_time - start_time >= g_param['OptionsDefine.WaiterInfo']['timeout']:
|
115
|
-
raise ClientError('Request timeout, wait `%s` to `%s` timeout, last request is %s' %
|
116
|
-
(g_param['OptionsDefine.WaiterInfo']['expr'], g_param['OptionsDefine.WaiterInfo']['to'],
|
117
|
-
search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj)))
|
118
|
-
else:
|
119
|
-
print('Inquiry result is %s.' % search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj))
|
120
|
-
time.sleep(g_param['OptionsDefine.WaiterInfo']['interval'])
|
121
|
-
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
122
|
-
|
123
|
-
|
124
|
-
def doQueryHunyuanImageJob(args, parsed_globals):
|
20
|
+
def doImageQuestion(args, parsed_globals):
|
125
21
|
g_param = parse_global_arg(parsed_globals)
|
126
22
|
|
127
23
|
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
@@ -150,11 +46,11 @@ def doQueryHunyuanImageJob(args, parsed_globals):
|
|
150
46
|
client = mod.HunyuanClient(cred, g_param[OptionsDefine.Region], profile)
|
151
47
|
client._sdkVersion += ("_CLI_" + __version__)
|
152
48
|
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
153
|
-
model = models.
|
49
|
+
model = models.ImageQuestionRequest()
|
154
50
|
model.from_json_string(json.dumps(args))
|
155
51
|
start_time = time.time()
|
156
52
|
while True:
|
157
|
-
rsp = client.
|
53
|
+
rsp = client.ImageQuestion(model)
|
158
54
|
result = rsp.to_json_string()
|
159
55
|
try:
|
160
56
|
json_obj = json.loads(result)
|
@@ -173,7 +69,7 @@ def doQueryHunyuanImageJob(args, parsed_globals):
|
|
173
69
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
174
70
|
|
175
71
|
|
176
|
-
def
|
72
|
+
def doFilesList(args, parsed_globals):
|
177
73
|
g_param = parse_global_arg(parsed_globals)
|
178
74
|
|
179
75
|
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
@@ -202,11 +98,11 @@ def doChatTranslations(args, parsed_globals):
|
|
202
98
|
client = mod.HunyuanClient(cred, g_param[OptionsDefine.Region], profile)
|
203
99
|
client._sdkVersion += ("_CLI_" + __version__)
|
204
100
|
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
205
|
-
model = models.
|
101
|
+
model = models.FilesListRequest()
|
206
102
|
model.from_json_string(json.dumps(args))
|
207
103
|
start_time = time.time()
|
208
104
|
while True:
|
209
|
-
rsp = client.
|
105
|
+
rsp = client.FilesList(model)
|
210
106
|
result = rsp.to_json_string()
|
211
107
|
try:
|
212
108
|
json_obj = json.loads(result)
|
@@ -225,7 +121,7 @@ def doChatTranslations(args, parsed_globals):
|
|
225
121
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
226
122
|
|
227
123
|
|
228
|
-
def
|
124
|
+
def doGetThread(args, parsed_globals):
|
229
125
|
g_param = parse_global_arg(parsed_globals)
|
230
126
|
|
231
127
|
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
@@ -254,11 +150,11 @@ def doGetThreadMessageList(args, parsed_globals):
|
|
254
150
|
client = mod.HunyuanClient(cred, g_param[OptionsDefine.Region], profile)
|
255
151
|
client._sdkVersion += ("_CLI_" + __version__)
|
256
152
|
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
257
|
-
model = models.
|
153
|
+
model = models.GetThreadRequest()
|
258
154
|
model.from_json_string(json.dumps(args))
|
259
155
|
start_time = time.time()
|
260
156
|
while True:
|
261
|
-
rsp = client.
|
157
|
+
rsp = client.GetThread(model)
|
262
158
|
result = rsp.to_json_string()
|
263
159
|
try:
|
264
160
|
json_obj = json.loads(result)
|
@@ -277,7 +173,7 @@ def doGetThreadMessageList(args, parsed_globals):
|
|
277
173
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
278
174
|
|
279
175
|
|
280
|
-
def
|
176
|
+
def doSubmitHunyuanImageJob(args, parsed_globals):
|
281
177
|
g_param = parse_global_arg(parsed_globals)
|
282
178
|
|
283
179
|
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
@@ -306,11 +202,11 @@ def doGetEmbedding(args, parsed_globals):
|
|
306
202
|
client = mod.HunyuanClient(cred, g_param[OptionsDefine.Region], profile)
|
307
203
|
client._sdkVersion += ("_CLI_" + __version__)
|
308
204
|
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
309
|
-
model = models.
|
205
|
+
model = models.SubmitHunyuanImageJobRequest()
|
310
206
|
model.from_json_string(json.dumps(args))
|
311
207
|
start_time = time.time()
|
312
208
|
while True:
|
313
|
-
rsp = client.
|
209
|
+
rsp = client.SubmitHunyuanImageJob(model)
|
314
210
|
result = rsp.to_json_string()
|
315
211
|
try:
|
316
212
|
json_obj = json.loads(result)
|
@@ -329,7 +225,7 @@ def doGetEmbedding(args, parsed_globals):
|
|
329
225
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
330
226
|
|
331
227
|
|
332
|
-
def
|
228
|
+
def doCreateThread(args, parsed_globals):
|
333
229
|
g_param = parse_global_arg(parsed_globals)
|
334
230
|
|
335
231
|
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
@@ -358,11 +254,11 @@ def doImageQuestion(args, parsed_globals):
|
|
358
254
|
client = mod.HunyuanClient(cred, g_param[OptionsDefine.Region], profile)
|
359
255
|
client._sdkVersion += ("_CLI_" + __version__)
|
360
256
|
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
361
|
-
model = models.
|
257
|
+
model = models.CreateThreadRequest()
|
362
258
|
model.from_json_string(json.dumps(args))
|
363
259
|
start_time = time.time()
|
364
260
|
while True:
|
365
|
-
rsp = client.
|
261
|
+
rsp = client.CreateThread(model)
|
366
262
|
result = rsp.to_json_string()
|
367
263
|
try:
|
368
264
|
json_obj = json.loads(result)
|
@@ -381,7 +277,7 @@ def doImageQuestion(args, parsed_globals):
|
|
381
277
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
382
278
|
|
383
279
|
|
384
|
-
def
|
280
|
+
def doQueryHunyuanImageJob(args, parsed_globals):
|
385
281
|
g_param = parse_global_arg(parsed_globals)
|
386
282
|
|
387
283
|
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
@@ -410,11 +306,11 @@ def doCreateThread(args, parsed_globals):
|
|
410
306
|
client = mod.HunyuanClient(cred, g_param[OptionsDefine.Region], profile)
|
411
307
|
client._sdkVersion += ("_CLI_" + __version__)
|
412
308
|
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
413
|
-
model = models.
|
309
|
+
model = models.QueryHunyuanImageJobRequest()
|
414
310
|
model.from_json_string(json.dumps(args))
|
415
311
|
start_time = time.time()
|
416
312
|
while True:
|
417
|
-
rsp = client.
|
313
|
+
rsp = client.QueryHunyuanImageJob(model)
|
418
314
|
result = rsp.to_json_string()
|
419
315
|
try:
|
420
316
|
json_obj = json.loads(result)
|
@@ -433,7 +329,7 @@ def doCreateThread(args, parsed_globals):
|
|
433
329
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
434
330
|
|
435
331
|
|
436
|
-
def
|
332
|
+
def doFilesDeletions(args, parsed_globals):
|
437
333
|
g_param = parse_global_arg(parsed_globals)
|
438
334
|
|
439
335
|
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
@@ -462,11 +358,11 @@ def doRunThread(args, parsed_globals):
|
|
462
358
|
client = mod.HunyuanClient(cred, g_param[OptionsDefine.Region], profile)
|
463
359
|
client._sdkVersion += ("_CLI_" + __version__)
|
464
360
|
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
465
|
-
model = models.
|
361
|
+
model = models.FilesDeletionsRequest()
|
466
362
|
model.from_json_string(json.dumps(args))
|
467
363
|
start_time = time.time()
|
468
364
|
while True:
|
469
|
-
rsp = client.
|
365
|
+
rsp = client.FilesDeletions(model)
|
470
366
|
result = rsp.to_json_string()
|
471
367
|
try:
|
472
368
|
json_obj = json.loads(result)
|
@@ -485,7 +381,7 @@ def doRunThread(args, parsed_globals):
|
|
485
381
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
486
382
|
|
487
383
|
|
488
|
-
def
|
384
|
+
def doFilesUploads(args, parsed_globals):
|
489
385
|
g_param = parse_global_arg(parsed_globals)
|
490
386
|
|
491
387
|
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
@@ -514,11 +410,11 @@ def doSetPayMode(args, parsed_globals):
|
|
514
410
|
client = mod.HunyuanClient(cred, g_param[OptionsDefine.Region], profile)
|
515
411
|
client._sdkVersion += ("_CLI_" + __version__)
|
516
412
|
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
517
|
-
model = models.
|
413
|
+
model = models.FilesUploadsRequest()
|
518
414
|
model.from_json_string(json.dumps(args))
|
519
415
|
start_time = time.time()
|
520
416
|
while True:
|
521
|
-
rsp = client.
|
417
|
+
rsp = client.FilesUploads(model)
|
522
418
|
result = rsp.to_json_string()
|
523
419
|
try:
|
524
420
|
json_obj = json.loads(result)
|
@@ -537,7 +433,7 @@ def doSetPayMode(args, parsed_globals):
|
|
537
433
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
538
434
|
|
539
435
|
|
540
|
-
def
|
436
|
+
def doGetTokenCount(args, parsed_globals):
|
541
437
|
g_param = parse_global_arg(parsed_globals)
|
542
438
|
|
543
439
|
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
@@ -566,11 +462,11 @@ def doQueryHunyuanImageChatJob(args, parsed_globals):
|
|
566
462
|
client = mod.HunyuanClient(cred, g_param[OptionsDefine.Region], profile)
|
567
463
|
client._sdkVersion += ("_CLI_" + __version__)
|
568
464
|
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
569
|
-
model = models.
|
465
|
+
model = models.GetTokenCountRequest()
|
570
466
|
model.from_json_string(json.dumps(args))
|
571
467
|
start_time = time.time()
|
572
468
|
while True:
|
573
|
-
rsp = client.
|
469
|
+
rsp = client.GetTokenCount(model)
|
574
470
|
result = rsp.to_json_string()
|
575
471
|
try:
|
576
472
|
json_obj = json.loads(result)
|
@@ -641,7 +537,7 @@ def doGroupChatCompletions(args, parsed_globals):
|
|
641
537
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
642
538
|
|
643
539
|
|
644
|
-
def
|
540
|
+
def doSubmitHunyuanImageChatJob(args, parsed_globals):
|
645
541
|
g_param = parse_global_arg(parsed_globals)
|
646
542
|
|
647
543
|
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
@@ -670,11 +566,11 @@ def doFilesDeletions(args, parsed_globals):
|
|
670
566
|
client = mod.HunyuanClient(cred, g_param[OptionsDefine.Region], profile)
|
671
567
|
client._sdkVersion += ("_CLI_" + __version__)
|
672
568
|
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
673
|
-
model = models.
|
569
|
+
model = models.SubmitHunyuanImageChatJobRequest()
|
674
570
|
model.from_json_string(json.dumps(args))
|
675
571
|
start_time = time.time()
|
676
572
|
while True:
|
677
|
-
rsp = client.
|
573
|
+
rsp = client.SubmitHunyuanImageChatJob(model)
|
678
574
|
result = rsp.to_json_string()
|
679
575
|
try:
|
680
576
|
json_obj = json.loads(result)
|
@@ -693,7 +589,7 @@ def doFilesDeletions(args, parsed_globals):
|
|
693
589
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
694
590
|
|
695
591
|
|
696
|
-
def
|
592
|
+
def doRunThread(args, parsed_globals):
|
697
593
|
g_param = parse_global_arg(parsed_globals)
|
698
594
|
|
699
595
|
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
@@ -722,11 +618,11 @@ def doGetThreadMessage(args, parsed_globals):
|
|
722
618
|
client = mod.HunyuanClient(cred, g_param[OptionsDefine.Region], profile)
|
723
619
|
client._sdkVersion += ("_CLI_" + __version__)
|
724
620
|
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
725
|
-
model = models.
|
621
|
+
model = models.RunThreadRequest()
|
726
622
|
model.from_json_string(json.dumps(args))
|
727
623
|
start_time = time.time()
|
728
624
|
while True:
|
729
|
-
rsp = client.
|
625
|
+
rsp = client.RunThread(model)
|
730
626
|
result = rsp.to_json_string()
|
731
627
|
try:
|
732
628
|
json_obj = json.loads(result)
|
@@ -745,7 +641,7 @@ def doGetThreadMessage(args, parsed_globals):
|
|
745
641
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
746
642
|
|
747
643
|
|
748
|
-
def
|
644
|
+
def doGetThreadMessage(args, parsed_globals):
|
749
645
|
g_param = parse_global_arg(parsed_globals)
|
750
646
|
|
751
647
|
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
@@ -774,11 +670,11 @@ def doSubmitHunyuanTo3DJob(args, parsed_globals):
|
|
774
670
|
client = mod.HunyuanClient(cred, g_param[OptionsDefine.Region], profile)
|
775
671
|
client._sdkVersion += ("_CLI_" + __version__)
|
776
672
|
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
777
|
-
model = models.
|
673
|
+
model = models.GetThreadMessageRequest()
|
778
674
|
model.from_json_string(json.dumps(args))
|
779
675
|
start_time = time.time()
|
780
676
|
while True:
|
781
|
-
rsp = client.
|
677
|
+
rsp = client.GetThreadMessage(model)
|
782
678
|
result = rsp.to_json_string()
|
783
679
|
try:
|
784
680
|
json_obj = json.loads(result)
|
@@ -797,7 +693,7 @@ def doSubmitHunyuanTo3DJob(args, parsed_globals):
|
|
797
693
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
798
694
|
|
799
695
|
|
800
|
-
def
|
696
|
+
def doChatCompletions(args, parsed_globals):
|
801
697
|
g_param = parse_global_arg(parsed_globals)
|
802
698
|
|
803
699
|
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
@@ -826,11 +722,11 @@ def doFilesUploads(args, parsed_globals):
|
|
826
722
|
client = mod.HunyuanClient(cred, g_param[OptionsDefine.Region], profile)
|
827
723
|
client._sdkVersion += ("_CLI_" + __version__)
|
828
724
|
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
829
|
-
model = models.
|
725
|
+
model = models.ChatCompletionsRequest()
|
830
726
|
model.from_json_string(json.dumps(args))
|
831
727
|
start_time = time.time()
|
832
728
|
while True:
|
833
|
-
rsp = client.
|
729
|
+
rsp = client.ChatCompletions(model)
|
834
730
|
result = rsp.to_json_string()
|
835
731
|
try:
|
836
732
|
json_obj = json.loads(result)
|
@@ -849,7 +745,7 @@ def doFilesUploads(args, parsed_globals):
|
|
849
745
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
850
746
|
|
851
747
|
|
852
|
-
def
|
748
|
+
def doQueryHunyuanImageChatJob(args, parsed_globals):
|
853
749
|
g_param = parse_global_arg(parsed_globals)
|
854
750
|
|
855
751
|
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
@@ -878,11 +774,11 @@ def doActivateService(args, parsed_globals):
|
|
878
774
|
client = mod.HunyuanClient(cred, g_param[OptionsDefine.Region], profile)
|
879
775
|
client._sdkVersion += ("_CLI_" + __version__)
|
880
776
|
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
881
|
-
model = models.
|
777
|
+
model = models.QueryHunyuanImageChatJobRequest()
|
882
778
|
model.from_json_string(json.dumps(args))
|
883
779
|
start_time = time.time()
|
884
780
|
while True:
|
885
|
-
rsp = client.
|
781
|
+
rsp = client.QueryHunyuanImageChatJob(model)
|
886
782
|
result = rsp.to_json_string()
|
887
783
|
try:
|
888
784
|
json_obj = json.loads(result)
|
@@ -901,7 +797,7 @@ def doActivateService(args, parsed_globals):
|
|
901
797
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
902
798
|
|
903
799
|
|
904
|
-
def
|
800
|
+
def doChatTranslations(args, parsed_globals):
|
905
801
|
g_param = parse_global_arg(parsed_globals)
|
906
802
|
|
907
803
|
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
@@ -930,11 +826,11 @@ def doFilesList(args, parsed_globals):
|
|
930
826
|
client = mod.HunyuanClient(cred, g_param[OptionsDefine.Region], profile)
|
931
827
|
client._sdkVersion += ("_CLI_" + __version__)
|
932
828
|
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
933
|
-
model = models.
|
829
|
+
model = models.ChatTranslationsRequest()
|
934
830
|
model.from_json_string(json.dumps(args))
|
935
831
|
start_time = time.time()
|
936
832
|
while True:
|
937
|
-
rsp = client.
|
833
|
+
rsp = client.ChatTranslations(model)
|
938
834
|
result = rsp.to_json_string()
|
939
835
|
try:
|
940
836
|
json_obj = json.loads(result)
|
@@ -953,7 +849,7 @@ def doFilesList(args, parsed_globals):
|
|
953
849
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
954
850
|
|
955
851
|
|
956
|
-
def
|
852
|
+
def doActivateService(args, parsed_globals):
|
957
853
|
g_param = parse_global_arg(parsed_globals)
|
958
854
|
|
959
855
|
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
@@ -982,11 +878,11 @@ def doQueryHunyuanTo3DJob(args, parsed_globals):
|
|
982
878
|
client = mod.HunyuanClient(cred, g_param[OptionsDefine.Region], profile)
|
983
879
|
client._sdkVersion += ("_CLI_" + __version__)
|
984
880
|
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
985
|
-
model = models.
|
881
|
+
model = models.ActivateServiceRequest()
|
986
882
|
model.from_json_string(json.dumps(args))
|
987
883
|
start_time = time.time()
|
988
884
|
while True:
|
989
|
-
rsp = client.
|
885
|
+
rsp = client.ActivateService(model)
|
990
886
|
result = rsp.to_json_string()
|
991
887
|
try:
|
992
888
|
json_obj = json.loads(result)
|
@@ -1005,7 +901,7 @@ def doQueryHunyuanTo3DJob(args, parsed_globals):
|
|
1005
901
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
1006
902
|
|
1007
903
|
|
1008
|
-
def
|
904
|
+
def doGetThreadMessageList(args, parsed_globals):
|
1009
905
|
g_param = parse_global_arg(parsed_globals)
|
1010
906
|
|
1011
907
|
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
@@ -1034,11 +930,11 @@ def doSubmitHunyuanImageChatJob(args, parsed_globals):
|
|
1034
930
|
client = mod.HunyuanClient(cred, g_param[OptionsDefine.Region], profile)
|
1035
931
|
client._sdkVersion += ("_CLI_" + __version__)
|
1036
932
|
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
1037
|
-
model = models.
|
933
|
+
model = models.GetThreadMessageListRequest()
|
1038
934
|
model.from_json_string(json.dumps(args))
|
1039
935
|
start_time = time.time()
|
1040
936
|
while True:
|
1041
|
-
rsp = client.
|
937
|
+
rsp = client.GetThreadMessageList(model)
|
1042
938
|
result = rsp.to_json_string()
|
1043
939
|
try:
|
1044
940
|
json_obj = json.loads(result)
|
@@ -1057,7 +953,7 @@ def doSubmitHunyuanImageChatJob(args, parsed_globals):
|
|
1057
953
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
1058
954
|
|
1059
955
|
|
1060
|
-
def
|
956
|
+
def doSetPayMode(args, parsed_globals):
|
1061
957
|
g_param = parse_global_arg(parsed_globals)
|
1062
958
|
|
1063
959
|
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
@@ -1086,11 +982,11 @@ def doChatCompletions(args, parsed_globals):
|
|
1086
982
|
client = mod.HunyuanClient(cred, g_param[OptionsDefine.Region], profile)
|
1087
983
|
client._sdkVersion += ("_CLI_" + __version__)
|
1088
984
|
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
1089
|
-
model = models.
|
985
|
+
model = models.SetPayModeRequest()
|
1090
986
|
model.from_json_string(json.dumps(args))
|
1091
987
|
start_time = time.time()
|
1092
988
|
while True:
|
1093
|
-
rsp = client.
|
989
|
+
rsp = client.SetPayMode(model)
|
1094
990
|
result = rsp.to_json_string()
|
1095
991
|
try:
|
1096
992
|
json_obj = json.loads(result)
|
@@ -1109,7 +1005,7 @@ def doChatCompletions(args, parsed_globals):
|
|
1109
1005
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
1110
1006
|
|
1111
1007
|
|
1112
|
-
def
|
1008
|
+
def doTextToImageLite(args, parsed_globals):
|
1113
1009
|
g_param = parse_global_arg(parsed_globals)
|
1114
1010
|
|
1115
1011
|
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
@@ -1138,11 +1034,11 @@ def doGetTokenCount(args, parsed_globals):
|
|
1138
1034
|
client = mod.HunyuanClient(cred, g_param[OptionsDefine.Region], profile)
|
1139
1035
|
client._sdkVersion += ("_CLI_" + __version__)
|
1140
1036
|
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
1141
|
-
model = models.
|
1037
|
+
model = models.TextToImageLiteRequest()
|
1142
1038
|
model.from_json_string(json.dumps(args))
|
1143
1039
|
start_time = time.time()
|
1144
1040
|
while True:
|
1145
|
-
rsp = client.
|
1041
|
+
rsp = client.TextToImageLite(model)
|
1146
1042
|
result = rsp.to_json_string()
|
1147
1043
|
try:
|
1148
1044
|
json_obj = json.loads(result)
|
@@ -1161,7 +1057,7 @@ def doGetTokenCount(args, parsed_globals):
|
|
1161
1057
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
1162
1058
|
|
1163
1059
|
|
1164
|
-
def
|
1060
|
+
def doGetEmbedding(args, parsed_globals):
|
1165
1061
|
g_param = parse_global_arg(parsed_globals)
|
1166
1062
|
|
1167
1063
|
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
@@ -1190,11 +1086,11 @@ def doTextToImageLite(args, parsed_globals):
|
|
1190
1086
|
client = mod.HunyuanClient(cred, g_param[OptionsDefine.Region], profile)
|
1191
1087
|
client._sdkVersion += ("_CLI_" + __version__)
|
1192
1088
|
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
1193
|
-
model = models.
|
1089
|
+
model = models.GetEmbeddingRequest()
|
1194
1090
|
model.from_json_string(json.dumps(args))
|
1195
1091
|
start_time = time.time()
|
1196
1092
|
while True:
|
1197
|
-
rsp = client.
|
1093
|
+
rsp = client.GetEmbedding(model)
|
1198
1094
|
result = rsp.to_json_string()
|
1199
1095
|
try:
|
1200
1096
|
json_obj = json.loads(result)
|
@@ -1224,29 +1120,27 @@ MODELS_MAP = {
|
|
1224
1120
|
}
|
1225
1121
|
|
1226
1122
|
ACTION_MAP = {
|
1123
|
+
"ImageQuestion": doImageQuestion,
|
1124
|
+
"FilesList": doFilesList,
|
1227
1125
|
"GetThread": doGetThread,
|
1228
1126
|
"SubmitHunyuanImageJob": doSubmitHunyuanImageJob,
|
1229
|
-
"QueryHunyuanImageJob": doQueryHunyuanImageJob,
|
1230
|
-
"ChatTranslations": doChatTranslations,
|
1231
|
-
"GetThreadMessageList": doGetThreadMessageList,
|
1232
|
-
"GetEmbedding": doGetEmbedding,
|
1233
|
-
"ImageQuestion": doImageQuestion,
|
1234
1127
|
"CreateThread": doCreateThread,
|
1235
|
-
"
|
1236
|
-
"SetPayMode": doSetPayMode,
|
1237
|
-
"QueryHunyuanImageChatJob": doQueryHunyuanImageChatJob,
|
1238
|
-
"GroupChatCompletions": doGroupChatCompletions,
|
1128
|
+
"QueryHunyuanImageJob": doQueryHunyuanImageJob,
|
1239
1129
|
"FilesDeletions": doFilesDeletions,
|
1240
|
-
"GetThreadMessage": doGetThreadMessage,
|
1241
|
-
"SubmitHunyuanTo3DJob": doSubmitHunyuanTo3DJob,
|
1242
1130
|
"FilesUploads": doFilesUploads,
|
1243
|
-
"
|
1244
|
-
"
|
1245
|
-
"QueryHunyuanTo3DJob": doQueryHunyuanTo3DJob,
|
1131
|
+
"GetTokenCount": doGetTokenCount,
|
1132
|
+
"GroupChatCompletions": doGroupChatCompletions,
|
1246
1133
|
"SubmitHunyuanImageChatJob": doSubmitHunyuanImageChatJob,
|
1134
|
+
"RunThread": doRunThread,
|
1135
|
+
"GetThreadMessage": doGetThreadMessage,
|
1247
1136
|
"ChatCompletions": doChatCompletions,
|
1248
|
-
"
|
1137
|
+
"QueryHunyuanImageChatJob": doQueryHunyuanImageChatJob,
|
1138
|
+
"ChatTranslations": doChatTranslations,
|
1139
|
+
"ActivateService": doActivateService,
|
1140
|
+
"GetThreadMessageList": doGetThreadMessageList,
|
1141
|
+
"SetPayMode": doSetPayMode,
|
1249
1142
|
"TextToImageLite": doTextToImageLite,
|
1143
|
+
"GetEmbedding": doGetEmbedding,
|
1250
1144
|
|
1251
1145
|
}
|
1252
1146
|
|