itam-assistant 0.1.10__tar.gz → 0.1.12__tar.gz
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.
- {itam_assistant-0.1.10 → itam_assistant-0.1.12}/PKG-INFO +2 -2
- {itam_assistant-0.1.10 → itam_assistant-0.1.12}/itam_assistant/do_ai.py +177 -104
- {itam_assistant-0.1.10 → itam_assistant-0.1.12}/itam_assistant/openapi.py +135 -2
- {itam_assistant-0.1.10 → itam_assistant-0.1.12}/itam_assistant.egg-info/PKG-INFO +2 -2
- {itam_assistant-0.1.10 → itam_assistant-0.1.12}/setup.py +2 -2
- {itam_assistant-0.1.10 → itam_assistant-0.1.12}/README.md +0 -0
- {itam_assistant-0.1.10 → itam_assistant-0.1.12}/itam_assistant/__init__.py +0 -0
- {itam_assistant-0.1.10 → itam_assistant-0.1.12}/itam_assistant/ailyapp_client.py +0 -0
- {itam_assistant-0.1.10 → itam_assistant-0.1.12}/itam_assistant/config.py +0 -0
- {itam_assistant-0.1.10 → itam_assistant-0.1.12}/itam_assistant/intent_detail.py +0 -0
- {itam_assistant-0.1.10 → itam_assistant-0.1.12}/itam_assistant/lark_client.py +0 -0
- {itam_assistant-0.1.10 → itam_assistant-0.1.12}/itam_assistant/logger.py +0 -0
- {itam_assistant-0.1.10 → itam_assistant-0.1.12}/itam_assistant/test.py +0 -0
- {itam_assistant-0.1.10 → itam_assistant-0.1.12}/itam_assistant.egg-info/SOURCES.txt +0 -0
- {itam_assistant-0.1.10 → itam_assistant-0.1.12}/itam_assistant.egg-info/dependency_links.txt +0 -0
- {itam_assistant-0.1.10 → itam_assistant-0.1.12}/itam_assistant.egg-info/requires.txt +0 -0
- {itam_assistant-0.1.10 → itam_assistant-0.1.12}/itam_assistant.egg-info/top_level.txt +0 -0
- {itam_assistant-0.1.10 → itam_assistant-0.1.12}/setup.cfg +0 -0
- {itam_assistant-0.1.10 → itam_assistant-0.1.12}/test/test.py +0 -0
|
@@ -102,6 +102,7 @@ def do_ai_auto(Testk_data, clientinfo):
|
|
|
102
102
|
runs = AilyLarkClient(clientinfo).create_ailysession_run(tenant_access_token, seseion_id)
|
|
103
103
|
time.sleep(4)
|
|
104
104
|
num = num + 1
|
|
105
|
+
time.sleep(4)
|
|
105
106
|
return startAt, num
|
|
106
107
|
except KeyError as ke:
|
|
107
108
|
print(f"KeyError 发生: 数据中缺少必要的键,错误详情: {ke}")
|
|
@@ -212,39 +213,61 @@ def do_waterlevellineres_listassetspu(res, info,hardtype):
|
|
|
212
213
|
info['label'] = [{'label': '', 'score': 0}]
|
|
213
214
|
info['rt'] = False
|
|
214
215
|
return info
|
|
215
|
-
if
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
info['
|
|
216
|
+
if hardtype != 100:
|
|
217
|
+
if res["data"].get("AiBorrowAndUseResponseList") == None:
|
|
218
|
+
info['label'] = [{'label': '', 'score': 0}, {'label': '', 'score': 0.8}]
|
|
219
|
+
info['rt'] = False
|
|
220
|
+
if info['exp'] == []:
|
|
221
|
+
info['rt'] = True
|
|
222
|
+
return info
|
|
223
|
+
reslist = res["data"]["AiBorrowAndUseResponseList"]
|
|
224
|
+
info['output']['用户输入/output'] = 'requestId:' + res['requestId']
|
|
225
|
+
aaa = {}
|
|
226
|
+
# 判断res["body"]["Results"]不为空,空则:label0 label1 为空,label默认2级
|
|
227
|
+
if reslist:
|
|
228
|
+
# 取["Results"]下前2个结果,若只有1个结果,label1为空
|
|
229
|
+
if len(reslist) > 0:
|
|
230
|
+
for j in range(len(reslist)):
|
|
231
|
+
if hardtype == 2:
|
|
232
|
+
aaa = {'label': reslist[j]['AccessoryModelScope']['AccessoryModelInfo']['Name']['ValueZh'],
|
|
233
|
+
'score': reslist[j]['Score']}
|
|
234
|
+
info['label'].append(copy.deepcopy(aaa))
|
|
235
|
+
if hardtype == 1:
|
|
236
|
+
aaa = {'label': reslist[j]['AssetModelScope']['SpuNameZh'] or reslist[j]['AssetModelScope'][
|
|
237
|
+
'NameZh'] + reslist[j]['AssetModelScope']['ModelZh'] + reslist[j]['AssetModelScope'][
|
|
238
|
+
'SpecificationZh'],
|
|
239
|
+
'score': reslist[j]['Score']}
|
|
240
|
+
info['label'].append(copy.deepcopy(aaa))
|
|
241
|
+
# 判断label0和label1是否为空,为空则:label默认2级
|
|
242
|
+
else:
|
|
243
|
+
info['label'] = [{'label': '', 'score': 0}, {'label': '', 'score': 0}]
|
|
244
|
+
info['rt'] = False
|
|
220
245
|
return info
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
# 取["Results"]下前2个结果,若只有1个结果,label1为空
|
|
227
|
-
if len(reslist) > 0:
|
|
228
|
-
for j in range(len(reslist)):
|
|
229
|
-
if hardtype==2:
|
|
230
|
-
aaa = {'label': reslist[j]['AccessoryModelScope']['AccessoryModelInfo']['Name']['ValueZh'],
|
|
231
|
-
'score': reslist[j]['Score']}
|
|
232
|
-
info['label'].append(copy.deepcopy(aaa))
|
|
233
|
-
if hardtype == 1:
|
|
234
|
-
aaa = {'label': reslist[j]['AssetModelScope']['SpuNameZh'] or reslist[j]['AssetModelScope']['NameZh']+reslist[j]['AssetModelScope']['ModelZh']+reslist[j]['AssetModelScope']['SpecificationZh'],
|
|
235
|
-
'score': reslist[j]['Score']}
|
|
236
|
-
info['label'].append(copy.deepcopy(aaa))
|
|
237
|
-
# 判断label0和label1是否为空,为空则:label默认2级
|
|
238
|
-
for a in range(len(info['exp'])):
|
|
239
|
-
if info['exp'][a]['label'] == info['label'][a]['label']:
|
|
246
|
+
elif hardtype == 100:
|
|
247
|
+
if res["data"].get("SoftwareApplyRecommendList") == None:
|
|
248
|
+
info['label'] = [{'label': '', 'score': 0}, {'label': '', 'score': 0.8}]
|
|
249
|
+
info['rt'] = False
|
|
250
|
+
if info['exp'] == []:
|
|
240
251
|
info['rt'] = True
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
252
|
+
return info
|
|
253
|
+
reslist = res["data"]["SoftwareApplyRecommendList"]
|
|
254
|
+
info['output']['用户输出/output'] = 'requestId:' + res['requestId']
|
|
255
|
+
aaa = {}
|
|
256
|
+
# 判断res["body"]["Results"]不为空,空则:label0 label1 为空,label默认2级
|
|
257
|
+
if reslist:
|
|
258
|
+
# 取["Results"]下前2个结果,若只有1个结果,label1为空
|
|
259
|
+
if len(reslist) > 0:
|
|
260
|
+
for j in range(len(reslist)):
|
|
261
|
+
aaa = {'label': reslist[j]['Data']['Name']['ValueZh'],
|
|
262
|
+
'score': reslist[j]['Score']}
|
|
263
|
+
info['label'].append(copy.deepcopy(aaa))
|
|
264
|
+
# 判断label0和label1是否为空,为空则:label默认2级
|
|
265
|
+
info['rt'] = do_businessassertionrules(info['label'], info['exp'])
|
|
266
|
+
else:
|
|
267
|
+
info['label'] = [{'label': '', 'score': 0}, {'label': '', 'score': 0}]
|
|
268
|
+
info['rt'] = False
|
|
269
|
+
return info
|
|
270
|
+
|
|
248
271
|
|
|
249
272
|
def do_waterlevellineres_listassetspu_pre(res, info,hardtype):
|
|
250
273
|
"""
|
|
@@ -302,7 +325,8 @@ def do_waterlevellineres_sr(res, info,hardtype):
|
|
|
302
325
|
if info['exp'][0]['label']=='':
|
|
303
326
|
info['rt'] = True
|
|
304
327
|
return info
|
|
305
|
-
reslist=res["data"]["AssetModels"]
|
|
328
|
+
# reslist=res["data"]["AssetModels"]
|
|
329
|
+
reslist = res["data"]["AiBorrowAndUseResponseList"]
|
|
306
330
|
aaa ={}
|
|
307
331
|
# 判断res["body"]["Results"]不为空,空则:label0 label1 为空,label默认2级
|
|
308
332
|
if reslist:
|
|
@@ -400,13 +424,13 @@ def do_scenereview_list(collections,data,score_threshold):
|
|
|
400
424
|
if i['content'] == j['用户输入/userInput']:
|
|
401
425
|
info['input']['用户输入/userInput'] = i['ext']['output']
|
|
402
426
|
info['output']['用户输入/output'] = j['用户输入/userInput']
|
|
403
|
-
if i['ext']['
|
|
427
|
+
if i['ext']['资产名称'] == j['llm关键词']:
|
|
404
428
|
info['rt'] = True
|
|
405
429
|
info['label'] = [{'label': str(j['llm关键词']), 'score': score_threshold}]
|
|
406
430
|
else:
|
|
407
431
|
info['rt'] = False
|
|
408
|
-
info['label'] = [{'label': str(i['ext']['
|
|
409
|
-
info['exp'] = [{'label': str(i['ext']['
|
|
432
|
+
info['label'] = [{'label': str(i['ext']['资产名称']), 'score': score_threshold}]
|
|
433
|
+
info['exp'] = [{'label': str(i['ext']['资产名称']), 'score': score_threshold}]
|
|
410
434
|
info['artificial'] = info['exp']
|
|
411
435
|
info_list.append(copy.deepcopy(info))
|
|
412
436
|
return info_list
|
|
@@ -432,15 +456,15 @@ def do_waterlevelline_autotest(collections, clientinfo, score_threshold):
|
|
|
432
456
|
}
|
|
433
457
|
a =0
|
|
434
458
|
for i in collections:
|
|
435
|
-
info['input']['用户输入/userInput'] = i['ext']['
|
|
436
|
-
info['output']['用户输入/output'] = i['ext']['
|
|
459
|
+
info['input']['用户输入/userInput'] = i['ext']['资产名称']
|
|
460
|
+
info['output']['用户输入/output'] = i['ext']['资产名称']
|
|
437
461
|
info['exp'] = []
|
|
438
|
-
for j in [i['ext']['
|
|
462
|
+
for j in [i['ext']['资产型号'], i['ext'].get('资产型号1'),i['ext'].get('资产型号2'),i['ext'].get('资产型号3'),i['ext'].get('资产型号4'),i['ext'].get('资产型号5'),i['ext'].get('资产型号6'),i['ext'].get('资产型号7'),i['ext'].get('资产型号8'),i['ext'].get('资产型号9'),i['ext'].get('资产型号10')]:
|
|
439
463
|
if j:
|
|
440
464
|
info['exp'].append({'label': j, 'score': score_threshold})
|
|
441
|
-
#判断i['ext']['
|
|
442
|
-
if i['ext']['
|
|
443
|
-
asset_name = i['ext']['
|
|
465
|
+
#判断i['ext']['资产型号']是否为空,为空就不用读取,不为空就读取
|
|
466
|
+
if i['ext']['资产型号']:
|
|
467
|
+
asset_name = i['ext']['资产名称']
|
|
444
468
|
try:
|
|
445
469
|
if isinstance(asset_name, str):
|
|
446
470
|
asset_name = json.loads(asset_name)
|
|
@@ -448,18 +472,18 @@ def do_waterlevelline_autotest(collections, clientinfo, score_threshold):
|
|
|
448
472
|
# 若解析失败,说明不是 JSON 格式,保持原样
|
|
449
473
|
pass
|
|
450
474
|
info['artificial'] = info['exp']
|
|
451
|
-
if i['ext']['
|
|
452
|
-
asset_name = i['ext']['
|
|
475
|
+
if i['ext']['资产名称']:
|
|
476
|
+
asset_name = i['ext']['资产名称']
|
|
453
477
|
try:
|
|
454
478
|
if isinstance(asset_name, str):
|
|
455
479
|
asset_name = json.loads(asset_name)
|
|
456
480
|
except json.JSONDecodeError:
|
|
457
481
|
# 若解析失败,说明不是 JSON 格式,保持原样
|
|
458
482
|
pass
|
|
459
|
-
if "软件申请" in i['ext']['
|
|
483
|
+
if "软件申请" in i['ext']['分发技能']:
|
|
460
484
|
keywprd = software_asset_sku_structure(asset_name)
|
|
461
485
|
res = json.loads(get_query_vector(keywprd, clientinfo))
|
|
462
|
-
if "设备/配件申请" in i['ext']['
|
|
486
|
+
if "设备/配件申请" in i['ext']['分发技能']:
|
|
463
487
|
#keywprd = equipmentrequest_structure(asset_name, i['ext']['asset_type'])
|
|
464
488
|
keywprd = {
|
|
465
489
|
"From": 0,
|
|
@@ -481,7 +505,7 @@ def do_waterlevelline_autotest(collections, clientinfo, score_threshold):
|
|
|
481
505
|
}
|
|
482
506
|
res = json.loads(get_query_vector(keywprd, clientinfo))
|
|
483
507
|
#res = get_by_AssetModelBizTypes(keywprd,res0)
|
|
484
|
-
if "设备/配件退还" in i['ext']['
|
|
508
|
+
if "设备/配件退还" in i['ext']['分发技能']:
|
|
485
509
|
keywprd = equipmentreturn_structure0(asset_name, i['ext']['asset_type'])
|
|
486
510
|
res0 = json.loads(get_query_vector(keywprd, clientinfo))
|
|
487
511
|
res = get_by_AssetModelBizTypes(keywprd, res0)
|
|
@@ -515,22 +539,21 @@ def do_waterlevelline_autotest_aseetspu(collections, clientinfo, score_threshold
|
|
|
515
539
|
}
|
|
516
540
|
a =0
|
|
517
541
|
for i in collections:
|
|
518
|
-
info['input']['用户输入/userInput'] = i['ext']['
|
|
519
|
-
info['output']['用户输入/output'] = i['ext']['
|
|
542
|
+
info['input']['用户输入/userInput'] = i['ext']['资产名称']
|
|
543
|
+
info['output']['用户输入/output'] = i['ext']['资产名称']
|
|
520
544
|
info['exp'] = []
|
|
521
|
-
for j in [i['ext']['
|
|
522
|
-
i['ext'].get('
|
|
523
|
-
i['ext'].get('
|
|
524
|
-
i['ext'].get('
|
|
525
|
-
i['ext'].get('
|
|
526
|
-
i['ext'].get('BPO标注-AP-资产型号10')]:
|
|
545
|
+
for j in [i['ext']['匹配型号1'], i['ext'].get('匹配型号2'),
|
|
546
|
+
i['ext'].get('匹配型号3'), i['ext'].get('匹配型号4'),
|
|
547
|
+
i['ext'].get('匹配型号5'), i['ext'].get('匹配型号6'),
|
|
548
|
+
i['ext'].get('匹配型号7'), i['ext'].get('匹配型号8'),
|
|
549
|
+
i['ext'].get('匹配型号9'), i['ext'].get('匹配型号10')]:
|
|
527
550
|
if j:
|
|
528
551
|
info['exp'].append({'label': j, 'score': score_threshold})
|
|
529
552
|
info['artificial'] = info['exp']
|
|
530
553
|
info['label']=[]
|
|
531
|
-
if i['ext']['
|
|
532
|
-
if "
|
|
533
|
-
asset_name = i['ext']['
|
|
554
|
+
if i['ext']['资产名称']:
|
|
555
|
+
if "设备&配件领用" in i['ext']['分发技能']:
|
|
556
|
+
asset_name = i['ext']['资产名称']
|
|
534
557
|
try:
|
|
535
558
|
# 尝试将其解析为 JSON 对象
|
|
536
559
|
if isinstance(asset_name, str):
|
|
@@ -540,11 +563,40 @@ def do_waterlevelline_autotest_aseetspu(collections, clientinfo, score_threshold
|
|
|
540
563
|
# 若解析失败,说明不是 JSON 格式,保持原样
|
|
541
564
|
pass
|
|
542
565
|
key = asset_name.get('asset_name') if isinstance(asset_name, dict) else asset_name
|
|
543
|
-
if i['ext']['
|
|
566
|
+
if i['ext']['资产类型'] == "设备":
|
|
544
567
|
hardtype = 1
|
|
545
|
-
elif i['ext']['
|
|
568
|
+
elif i['ext']['资产类型'] == "配件":
|
|
546
569
|
hardtype = 2
|
|
547
570
|
res = GetBestMatchItemonline(key,hardtype,clientinfo)
|
|
571
|
+
if "设备借用" in i['ext']['分发技能'] or "配件借用" in i['ext']['分发技能']:
|
|
572
|
+
asset_name = i['ext']['资产名称']
|
|
573
|
+
try:
|
|
574
|
+
# 尝试将其解析为 JSON 对象
|
|
575
|
+
if isinstance(asset_name, str):
|
|
576
|
+
asset_name0 = json.loads(asset_name)
|
|
577
|
+
asset_name = asset_name0['asset_name']
|
|
578
|
+
except json.JSONDecodeError:
|
|
579
|
+
# 若解析失败,说明不是 JSON 格式,保持原样
|
|
580
|
+
pass
|
|
581
|
+
key = asset_name.get('asset_name') if isinstance(asset_name, dict) else asset_name
|
|
582
|
+
if i['ext']['资产类型'] == "设备":
|
|
583
|
+
hardtype = 1
|
|
584
|
+
elif i['ext']['资产类型'] == "配件" or i['ext']['资产类型'] == '2.0' :
|
|
585
|
+
hardtype = 2
|
|
586
|
+
res = GetBestMatchItemonline_(key,hardtype,clientinfo)
|
|
587
|
+
if "软件申请" in i['ext']['分发技能']:
|
|
588
|
+
user_input_parts = [
|
|
589
|
+
"用户对话:"+i['ext'].get('用户输入', ''),
|
|
590
|
+
"资产名称:"+i['ext'].get('资产名称', ''),
|
|
591
|
+
"版本:"+i['ext'].get('版本', ''),
|
|
592
|
+
"用途:"+i['ext'].get('用途', '')
|
|
593
|
+
]
|
|
594
|
+
info['input']['用户输入/userInput'] = ','.join(filter(None, user_input_parts))
|
|
595
|
+
key = asset_name = i['ext'].get('资产名称')
|
|
596
|
+
Description = i['ext'].get('版本') + i['ext'].get('用途')
|
|
597
|
+
res = GetBestMatchItemonline_software(key, Description, clientinfo)
|
|
598
|
+
hardtype = 100
|
|
599
|
+
|
|
548
600
|
else:
|
|
549
601
|
res = ""
|
|
550
602
|
infoout = do_waterlevellineres_listassetspu(res, info,hardtype)
|
|
@@ -575,17 +627,17 @@ def do_waterlevelline_autotest_aseetspu_old(collections, clientinfo, score_thres
|
|
|
575
627
|
}
|
|
576
628
|
a =0
|
|
577
629
|
for i in collections:
|
|
578
|
-
info['input']['用户输入/userInput'] = i['ext']['
|
|
579
|
-
info['output']['用户输入/output'] = i['ext']['
|
|
630
|
+
info['input']['用户输入/userInput'] = i['ext']['资产名称']
|
|
631
|
+
info['output']['用户输入/output'] = i['ext']['资产名称']
|
|
580
632
|
info['exp'] = [
|
|
581
|
-
{'label': i['ext']['
|
|
582
|
-
{'label': i['ext'].get('
|
|
633
|
+
{'label': i['ext']['资产型号'], 'score': score_threshold},
|
|
634
|
+
{'label': i['ext'].get('资产型号1', ''), 'score': score_threshold}]
|
|
583
635
|
info['artificial'] = info['exp']
|
|
584
636
|
info['label']=[]
|
|
585
|
-
if i['ext']['
|
|
586
|
-
if "设备" in i['ext']['
|
|
587
|
-
asset_name = i['ext']['
|
|
588
|
-
asset_name = i['ext']['
|
|
637
|
+
if i['ext']['资产名称']:
|
|
638
|
+
if "设备" in i['ext']['分发技能'] or "配件" in i['ext']['分发技能']:
|
|
639
|
+
asset_name = i['ext']['资产名称']
|
|
640
|
+
asset_name = i['ext']['资产类型']
|
|
589
641
|
try:
|
|
590
642
|
# 尝试将其解析为 JSON 对象
|
|
591
643
|
if isinstance(asset_name, str):
|
|
@@ -594,9 +646,9 @@ def do_waterlevelline_autotest_aseetspu_old(collections, clientinfo, score_thres
|
|
|
594
646
|
# 若解析失败,说明不是 JSON 格式,保持原样
|
|
595
647
|
pass
|
|
596
648
|
key = asset_name.get('asset_name') if isinstance(asset_name, dict) else asset_name
|
|
597
|
-
if i['ext']['
|
|
649
|
+
if i['ext']['资产型号'] == "设备":
|
|
598
650
|
hardtype = 1
|
|
599
|
-
elif i['ext']['
|
|
651
|
+
elif i['ext']['资产型号'] == "配件" :
|
|
600
652
|
hardtype = 2
|
|
601
653
|
res = GetBestMatchItemonline_old(key,hardtype,clientinfo)
|
|
602
654
|
else:
|
|
@@ -630,17 +682,38 @@ def do_waterlevelline_autotest_aseetspu_pre(collections, clientinfo, score_thres
|
|
|
630
682
|
}
|
|
631
683
|
a =0
|
|
632
684
|
for i in collections:
|
|
633
|
-
info['input']['用户输入/userInput'] = i['ext']['
|
|
634
|
-
info['output']['用户输入/output'] = i['ext']['
|
|
635
|
-
info['exp'] = [
|
|
636
|
-
|
|
637
|
-
|
|
685
|
+
info['input']['用户输入/userInput'] = i['ext']['资产名称']
|
|
686
|
+
info['output']['用户输入/output'] = i['ext']['资产名称']
|
|
687
|
+
info['exp'] = []
|
|
688
|
+
for j in [i['ext']['匹配型号1'], i['ext'].get('匹配型号2'), i['ext'].get('匹配型号3'),
|
|
689
|
+
i['ext'].get('匹配型号4'), i['ext'].get('匹配型号5'), i['ext'].get('匹配型号6'),
|
|
690
|
+
i['ext'].get('匹配型号7'), i['ext'].get('匹配型号8'), i['ext'].get('匹配型号9'),
|
|
691
|
+
i['ext'].get('匹配型号10')]:
|
|
692
|
+
if j:
|
|
693
|
+
info['exp'].append({'label': j, 'score': score_threshold})
|
|
638
694
|
info['artificial'] = info['exp']
|
|
639
695
|
info['label']=[]
|
|
640
|
-
if i['ext']['
|
|
641
|
-
if "
|
|
642
|
-
asset_name = i['ext']['
|
|
643
|
-
asset_name = i['ext']['
|
|
696
|
+
if i['ext']['资产名称']:
|
|
697
|
+
if "设备&配件领用" in i['ext']['分发技能']:
|
|
698
|
+
asset_name = i['ext']['资产名称']
|
|
699
|
+
#asset_name = i['ext']['资产类型']
|
|
700
|
+
try:
|
|
701
|
+
# 尝试将其解析为 JSON 对象
|
|
702
|
+
if isinstance(asset_name, str):
|
|
703
|
+
asset_name = json.loads(asset_name)
|
|
704
|
+
except json.JSONDecodeError:
|
|
705
|
+
# 若解析失败,说明不是 JSON 格式,保持原样
|
|
706
|
+
pass
|
|
707
|
+
key = asset_name.get('asset_name') if isinstance(asset_name, dict) else asset_name
|
|
708
|
+
if i['ext']['资产类型'] == "设备":
|
|
709
|
+
hardtype = 1
|
|
710
|
+
elif i['ext']['资产类型'] == "配件" :
|
|
711
|
+
hardtype = 2
|
|
712
|
+
res = GetBestMatchItemoff(key,hardtype,clientinfo)
|
|
713
|
+
|
|
714
|
+
if "设备借用" in i['ext']['分发技能']:
|
|
715
|
+
asset_name = i['ext']['资产名称']
|
|
716
|
+
#asset_name = i['ext']['资产类型']
|
|
644
717
|
try:
|
|
645
718
|
# 尝试将其解析为 JSON 对象
|
|
646
719
|
if isinstance(asset_name, str):
|
|
@@ -649,14 +722,14 @@ def do_waterlevelline_autotest_aseetspu_pre(collections, clientinfo, score_thres
|
|
|
649
722
|
# 若解析失败,说明不是 JSON 格式,保持原样
|
|
650
723
|
pass
|
|
651
724
|
key = asset_name.get('asset_name') if isinstance(asset_name, dict) else asset_name
|
|
652
|
-
if i['ext']['
|
|
725
|
+
if i['ext']['资产类型'] == "设备":
|
|
653
726
|
hardtype = 1
|
|
654
|
-
elif i['ext']['
|
|
727
|
+
elif i['ext']['资产类型'] == "配件" :
|
|
655
728
|
hardtype = 2
|
|
656
|
-
res =
|
|
729
|
+
res = GetBestMatchItemoff0(key,hardtype,clientinfo)
|
|
657
730
|
else:
|
|
658
731
|
res = ""
|
|
659
|
-
infoout =
|
|
732
|
+
infoout = do_waterlevellineres_listassetspu(res, info,hardtype)
|
|
660
733
|
info_list.append(copy.deepcopy(infoout))
|
|
661
734
|
a = a+1
|
|
662
735
|
print("这是"+str(a))
|
|
@@ -684,17 +757,17 @@ def do_waterlevelline_autotest_search(collections, clientinfo, score_threshold):
|
|
|
684
757
|
}
|
|
685
758
|
a =0
|
|
686
759
|
for i in collections:
|
|
687
|
-
info['input']['用户输入/userInput'] = i['ext']['
|
|
688
|
-
info['output']['用户输入/output'] = i['ext']['
|
|
760
|
+
info['input']['用户输入/userInput'] = i['ext']['资产名称']
|
|
761
|
+
info['output']['用户输入/output'] = i['ext']['资产名称']
|
|
689
762
|
info['exp'] = [
|
|
690
|
-
{'label': i['ext']['
|
|
691
|
-
{'label': i['ext'].get('
|
|
763
|
+
{'label': i['ext']['资产型号'], 'score': score_threshold},
|
|
764
|
+
{'label': i['ext'].get('资产型号1', ''), 'score': score_threshold}]
|
|
692
765
|
info['artificial'] = info['exp']
|
|
693
766
|
info['label']=[]
|
|
694
|
-
if i['ext']['
|
|
695
|
-
if "设备" in i['ext']['
|
|
696
|
-
asset_name = i['ext']['
|
|
697
|
-
asset_name = i['ext']['
|
|
767
|
+
if i['ext']['资产名称']:
|
|
768
|
+
if "设备" in i['ext']['分发技能'] or "配件" in i['ext']['分发技能']:
|
|
769
|
+
asset_name = i['ext']['资产名称']
|
|
770
|
+
asset_name = i['ext']['资产类型']
|
|
698
771
|
try:
|
|
699
772
|
# 尝试将其解析为 JSON 对象
|
|
700
773
|
if isinstance(asset_name, str):
|
|
@@ -703,9 +776,9 @@ def do_waterlevelline_autotest_search(collections, clientinfo, score_threshold):
|
|
|
703
776
|
# 若解析失败,说明不是 JSON 格式,保持原样
|
|
704
777
|
pass
|
|
705
778
|
key = asset_name.get('asset_name') if isinstance(asset_name, dict) else asset_name
|
|
706
|
-
if i['ext']['
|
|
779
|
+
if i['ext']['资产型号'] == "设备":
|
|
707
780
|
hardtype = 1
|
|
708
|
-
elif i['ext']['
|
|
781
|
+
elif i['ext']['资产型号'] == "配件" :
|
|
709
782
|
hardtype = 2
|
|
710
783
|
res = searchListAssetModelScope(key,hardtype,clientinfo)
|
|
711
784
|
else:
|
|
@@ -739,24 +812,24 @@ def do_waterlevelline_autotest_SoftwareApplyRecommendList(collections, clientinf
|
|
|
739
812
|
}
|
|
740
813
|
a =0
|
|
741
814
|
for i in collections:
|
|
742
|
-
info['input']['用户输入/userInput'] = i['ext'].get('
|
|
743
|
-
info['output']['实际输出/output'] = i['ext']['
|
|
815
|
+
info['input']['用户输入/userInput'] = i['ext'].get('资产名称') or i['ext'].get('资产名称')
|
|
816
|
+
info['output']['实际输出/output'] = i['ext']['资产名称']
|
|
744
817
|
info['exp'] = []
|
|
745
|
-
for j in [i['ext']['
|
|
746
|
-
i['ext'].get('
|
|
747
|
-
i['ext'].get('
|
|
748
|
-
i['ext'].get('
|
|
749
|
-
i['ext'].get('
|
|
750
|
-
i['ext'].get('
|
|
818
|
+
for j in [i['ext']['资产型号'], i['ext'].get('资产型号1'),
|
|
819
|
+
i['ext'].get('资产型号2'), i['ext'].get('资产型号3'),
|
|
820
|
+
i['ext'].get('资产型号4'), i['ext'].get('资产型号5'),
|
|
821
|
+
i['ext'].get('资产型号6'), i['ext'].get('资产型号7'),
|
|
822
|
+
i['ext'].get('资产型号8'), i['ext'].get('资产型号9'),
|
|
823
|
+
i['ext'].get('资产型号10')]:
|
|
751
824
|
if j:
|
|
752
825
|
info['exp'].append({'label': j, 'score': score_threshold})
|
|
753
826
|
if info['exp'] == '':
|
|
754
827
|
break
|
|
755
828
|
info['artificial'] = info['exp']
|
|
756
829
|
info['label']=[]
|
|
757
|
-
if i['ext']['
|
|
758
|
-
if "软件" in i['ext']['
|
|
759
|
-
asset_name = i['ext']['
|
|
830
|
+
if i['ext']['资产名称']:
|
|
831
|
+
if "软件" in i['ext']['分发技能']:
|
|
832
|
+
asset_name = i['ext']['资产名称']
|
|
760
833
|
try:
|
|
761
834
|
# 尝试将其解析为 JSON 对象
|
|
762
835
|
if isinstance(asset_name, str):
|
|
@@ -997,7 +1070,7 @@ def do_waterlevelline_autotest_fix(collections, clientinfo, score_threshold):
|
|
|
997
1070
|
for j in [i['ext']['匹配型号1'], i['ext'].get('匹配型号2'),i['ext'].get('匹配型号3'),i['ext'].get('匹配型号4'),i['ext'].get('匹配型号5'),i['ext'].get('匹配型号6'),i['ext'].get('匹配型号7'),i['ext'].get('匹配型号8'),i['ext'].get('匹配型号9'),i['ext'].get('匹配型号10')]:
|
|
998
1071
|
if j:
|
|
999
1072
|
info['exp'].append({'label': j, 'score': score_threshold})
|
|
1000
|
-
#判断i['ext']['
|
|
1073
|
+
#判断i['ext']['资产型号']是否为空,为空就不用读取,不为空就读取
|
|
1001
1074
|
if i['ext']['资产名称']:
|
|
1002
1075
|
asset_name = i['ext']['资产名称']
|
|
1003
1076
|
try:
|
|
@@ -508,14 +508,47 @@ def equipmentreturn_structure(QueryValue):
|
|
|
508
508
|
|
|
509
509
|
|
|
510
510
|
def GetBestMatchItemonline(SearchKey, HardwareMatchType, clientinfo):
|
|
511
|
+
url = "https://it.bytedance.com/itam-byte/api/itservice/common/GetBestMatchItem"
|
|
512
|
+
payload = json.dumps({
|
|
513
|
+
"SearchKey": SearchKey,
|
|
514
|
+
"TopN": 10,
|
|
515
|
+
"AiUseType": 5,
|
|
516
|
+
"QueryAssetModelScopeRequestV2": {
|
|
517
|
+
"HardwareMatchType": HardwareMatchType,
|
|
518
|
+
"TemplateType": "6883418246797986828",
|
|
519
|
+
"ApplyRegionID": "7145432241957506086",
|
|
520
|
+
"Page": {
|
|
521
|
+
"PageNum": 1,
|
|
522
|
+
"PageSize": 10
|
|
523
|
+
}
|
|
524
|
+
},
|
|
525
|
+
"psm": "athena"
|
|
526
|
+
})
|
|
527
|
+
time.sleep(5)
|
|
528
|
+
headers = {
|
|
529
|
+
'authorization': clientinfo.get(
|
|
530
|
+
'authorization') or 'Bearer eyJhbGciOiJSUzI1NiIsImtpZCI6InYyIiwidHlwIjoiSldUIn0.eyJleHAiOjE3NTEwOTI3NjksImp0aSI6ImR1M3o1UEh3ZDNla2tLUlUiLCJpYXQiOjE3NDk3OTY3NjksImlzcyI6InRhbm5hIiwic3ViIjoiMzgzMDMxOUBieXRlZGFuY2UucGVvcGxlIiwidGVuYW50X2lkIjoiYnl0ZWRhbmNlLnBlb3BsZSIsInRlbmFudF9uYW1lIjoiIiwicHJvamVjdF9rZXkiOiJjcm1TZmdIVmU1dXhIMHJyIiwidW5pdCI6ImV1X25jIiwiYXV0aF9ieSI6Mn0.GGUPJ3FzxW131PovtM_BUANXWUPIJTfG6zbNlb80ZIiPviQ3U0t4hxVMty9Dj4PYfiLfLMQ1r3E9xsIWfvQDL-CGC7EsnqBDT6Vc4_ZGvW_mx-z3YVzs7TJ8cKE0YZUI8gB-ZsAgztMJF5Jlja0zqdWNi7sdc-YnYISzrxv6aiY',
|
|
531
|
+
'cookie': clientinfo.get(
|
|
532
|
+
'cookie') or 'MONITOR_WEB_ID=ce5a3279-6ed5-4ede-9b00-29aa7c1a1311; bd_sso_3b6da9=eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHAiOjE3NTAzMzYyMzMsImlhdCI6MTc0OTczMTQzMywiaXNzIjoic3NvLmJ5dGVkYW5jZS5jb20iLCJzdWIiOiJkZWdubjk2MWtma2treW9waDd5cyIsInRlbmFudF9pZCI6ImhncTN0Y2NwM2kxc2pqbjU4emlrIn0.dMO0OWpMvIXmHGHfgxU3FRvwLOqNWAW_kiWDiHWt9wMxQd5qsi9PILBXCEYP4NVq5CaNbU_XO488CJz0vxxNh50hLdk5Jgf7n1lm-FaTJ-AtD7tqBlUl94ZB38GiAb2m7U4xC-7iHWVH2Mp-M92Z7_jgB0xJcEiDmOhlLqBviatlLGcoeAIjhpK01MA04T6Efb5M_OgeJbbqOZgl-jSdIvY6SD5my9kSzg1KE3E1caquPzYMDtgjIy9L8rkqYz0A77DXac6l0tv6daHshoPvgtc4urTV9QdT6XAYyPO_yf8ISXz03opaKkmHtZ5slIFSqgTPbLJ9Y_dmaZuX9D_NRg; MONITOR_WEB_ID=ce5a3279-6ed5-4ede-9b00-29aa7c1a1311; _tea_utm_cache_1508={%22utm_source%22:%22startup%22%2C%22utm_medium%22:%22chrome%22}; _tea_utm_cache_1229=undefined; amuserid=7036392@bytedance.people',
|
|
533
|
+
'Content-Type': 'application/json',
|
|
534
|
+
}
|
|
535
|
+
if clientinfo.get('x_tt_env'):
|
|
536
|
+
headers['x-tt-env'] = clientinfo.get('x_tt_env')
|
|
537
|
+
headers['x-use-ppe'] = '1'
|
|
538
|
+
|
|
539
|
+
response = requests.request("POST", url, headers=headers, data=payload)
|
|
540
|
+
|
|
541
|
+
return json.loads(response.text)
|
|
542
|
+
|
|
543
|
+
def GetBestMatchItemonline_(SearchKey, HardwareMatchType, clientinfo):
|
|
511
544
|
url = "https://it.bytedance.com/itam-byte/api/itservice/common/GetBestMatchItem"
|
|
512
545
|
payload = json.dumps({
|
|
513
546
|
"SearchKey": SearchKey,
|
|
514
547
|
"TopN": 10,
|
|
515
|
-
"AiUseType":
|
|
548
|
+
"AiUseType": 7,
|
|
516
549
|
"QueryAssetModelScopeRequestV2": {
|
|
517
550
|
"HardwareMatchType": HardwareMatchType,
|
|
518
|
-
"TemplateType": "
|
|
551
|
+
"TemplateType": "6883418246797954060",
|
|
519
552
|
"ApplyRegionID": "7145432241957506086",
|
|
520
553
|
"Page": {
|
|
521
554
|
"PageNum": 1,
|
|
@@ -534,10 +567,110 @@ def GetBestMatchItemonline(SearchKey, HardwareMatchType, clientinfo):
|
|
|
534
567
|
}
|
|
535
568
|
|
|
536
569
|
response = requests.request("POST", url, headers=headers, data=payload)
|
|
570
|
+
response0 = json.loads(response.text)
|
|
571
|
+
response1 = json.loads(response.text)
|
|
572
|
+
if HardwareMatchType == 2:
|
|
573
|
+
if response0['data'].get('AiBorrowAndUseResponseList'):
|
|
574
|
+
for i in response0['data']['AiBorrowAndUseResponseList']:
|
|
575
|
+
if str(i['OutOfStock']) == 'True':
|
|
576
|
+
response1['data']['AiBorrowAndUseResponseList'].remove(i)
|
|
577
|
+
else:
|
|
578
|
+
pass
|
|
579
|
+
return response1
|
|
580
|
+
return json.loads(response.text)
|
|
537
581
|
|
|
582
|
+
def GetBestMatchItemonline_software(SearchKey, Description, clientinfo):
|
|
583
|
+
url = "https://it.bytedance.com/itam-byte/api/itservice/common/GetBestMatchItem"
|
|
584
|
+
payload = json.dumps({
|
|
585
|
+
"SearchKey":"","TopN":5,"AiUseType":100,
|
|
586
|
+
"SoftwareApplyRequest":{"Size":3,
|
|
587
|
+
"Name":SearchKey,
|
|
588
|
+
"Description":""},
|
|
589
|
+
"psm":"athena"})
|
|
590
|
+
time.sleep(5)
|
|
591
|
+
headers = {
|
|
592
|
+
'authorization': clientinfo.get(
|
|
593
|
+
'authorization') or 'Bearer eyJhbGciOiJSUzI1NiIsImtpZCI6InYyIiwidHlwIjoiSldUIn0.eyJleHAiOjE3NTEwOTI3NjksImp0aSI6ImR1M3o1UEh3ZDNla2tLUlUiLCJpYXQiOjE3NDk3OTY3NjksImlzcyI6InRhbm5hIiwic3ViIjoiMzgzMDMxOUBieXRlZGFuY2UucGVvcGxlIiwidGVuYW50X2lkIjoiYnl0ZWRhbmNlLnBlb3BsZSIsInRlbmFudF9uYW1lIjoiIiwicHJvamVjdF9rZXkiOiJjcm1TZmdIVmU1dXhIMHJyIiwidW5pdCI6ImV1X25jIiwiYXV0aF9ieSI6Mn0.GGUPJ3FzxW131PovtM_BUANXWUPIJTfG6zbNlb80ZIiPviQ3U0t4hxVMty9Dj4PYfiLfLMQ1r3E9xsIWfvQDL-CGC7EsnqBDT6Vc4_ZGvW_mx-z3YVzs7TJ8cKE0YZUI8gB-ZsAgztMJF5Jlja0zqdWNi7sdc-YnYISzrxv6aiY',
|
|
594
|
+
'cookie': clientinfo.get(
|
|
595
|
+
'cookie') or 'MONITOR_WEB_ID=ce5a3279-6ed5-4ede-9b00-29aa7c1a1311; bd_sso_3b6da9=eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHAiOjE3NTAzMzYyMzMsImlhdCI6MTc0OTczMTQzMywiaXNzIjoic3NvLmJ5dGVkYW5jZS5jb20iLCJzdWIiOiJkZWdubjk2MWtma2treW9waDd5cyIsInRlbmFudF9pZCI6ImhncTN0Y2NwM2kxc2pqbjU4emlrIn0.dMO0OWpMvIXmHGHfgxU3FRvwLOqNWAW_kiWDiHWt9wMxQd5qsi9PILBXCEYP4NVq5CaNbU_XO488CJz0vxxNh50hLdk5Jgf7n1lm-FaTJ-AtD7tqBlUl94ZB38GiAb2m7U4xC-7iHWVH2Mp-M92Z7_jgB0xJcEiDmOhlLqBviatlLGcoeAIjhpK01MA04T6Efb5M_OgeJbbqOZgl-jSdIvY6SD5my9kSzg1KE3E1caquPzYMDtgjIy9L8rkqYz0A77DXac6l0tv6daHshoPvgtc4urTV9QdT6XAYyPO_yf8ISXz03opaKkmHtZ5slIFSqgTPbLJ9Y_dmaZuX9D_NRg; MONITOR_WEB_ID=ce5a3279-6ed5-4ede-9b00-29aa7c1a1311; _tea_utm_cache_1508={%22utm_source%22:%22startup%22%2C%22utm_medium%22:%22chrome%22}; _tea_utm_cache_1229=undefined; amuserid=7036392@bytedance.people',
|
|
596
|
+
'Content-Type': 'application/json',
|
|
597
|
+
|
|
598
|
+
}
|
|
599
|
+
if clientinfo.get('x_tt_env'):
|
|
600
|
+
headers['x-tt-env'] = clientinfo.get('x_tt_env')
|
|
601
|
+
headers['x-use-ppe'] = '1'
|
|
602
|
+
response = requests.request("POST", url, headers=headers, data=payload)
|
|
538
603
|
return json.loads(response.text)
|
|
539
604
|
|
|
605
|
+
def GetBestMatchItemoff0(SearchKey, HardwareMatchType, clientinfo):
|
|
606
|
+
url = "https://it-pre.bytedance.net/itam-byte/api/itservice/common/GetBestMatchItem"
|
|
540
607
|
|
|
608
|
+
if HardwareMatchType==1:
|
|
609
|
+
pr = {"SearchKey":SearchKey,"TopN":10,"AiUseType":7,
|
|
610
|
+
"QueryAssetModelScopeRequestV2":
|
|
611
|
+
{"HardwareMatchType":HardwareMatchType,
|
|
612
|
+
"TemplateType":"6848436666751798285",
|
|
613
|
+
"ApplyRegionID":"7468013511194643493",
|
|
614
|
+
"Page":{"PageNum":1,"PageSize":10}},"psm":"athena"}
|
|
615
|
+
if HardwareMatchType==2:
|
|
616
|
+
pr = {"SearchKey":SearchKey,"TopN":10,"AiUseType":7,
|
|
617
|
+
"QueryAssetModelScopeRequestV2":
|
|
618
|
+
{"HardwareMatchType":HardwareMatchType,
|
|
619
|
+
"TemplateType":"7534557229471796234",
|
|
620
|
+
"ApplyRegionID":"7509062433064029194","Page":{"PageNum":1,"PageSize":10}},"psm":"athena"}
|
|
621
|
+
|
|
622
|
+
|
|
623
|
+
|
|
624
|
+
payload = json.dumps(pr)
|
|
625
|
+
# time.sleep(5)
|
|
626
|
+
headers = {
|
|
627
|
+
'authorization': clientinfo.get(
|
|
628
|
+
'authorization') or 'Bearer eyJhbGciOiJSUzI1NiIsImtpZCI6InYyIiwidHlwIjoiSldUIn0.eyJleHAiOjE3NTk0MTc3ODEsImp0aSI6IkVXSUNmT0k5WVBCZVdKSTkiLCJpYXQiOjE3NTgxMjE3ODEsImlzcyI6InRhbm5hIiwic3ViIjoiMzgzMDMxOUBieXRlZGFuY2UucGVvcGxlIiwidGVuYW50X2lkIjoiYnl0ZWRhbmNlLnBlb3BsZSIsInRlbmFudF9uYW1lIjoiIiwicHJvamVjdF9rZXkiOiJjcm1TZmdIVmU1dXhIMHJyIiwidW5pdCI6ImV1X25jIiwiYXV0aF9ieSI6Mn0.MmENqyPY7k4KMz9ufbxzpIZXOnLaoYAAyv3J2T0OMz6tcd1IyEhYJd1cFjzqLw26NnWe4bfglki7zmIVQduftIJc8QaRcXDjDszCfG4DfH2O7zQTi7cwptt_o-CxI6E6osRhYmJ7dwaSWw1hBRlnBNJMbyzUlHRspJz-hox_oGA',
|
|
629
|
+
'cookie': clientinfo.get(
|
|
630
|
+
'cookie') or '_ga=GA1.1.1854125625.1750232273; _ga_FVWC4GKEYS=GS2.1.s1750301537$o2$g1$t1750301683$j60$l0$h0; X-Risk-Browser-Id=8f55035c3e943940f7e4eea73ae96e203e00887d4e38ec8b0f918e6477c34ef8; people-lang=zh; _tea_utm_cache_1508={%22utm_source%22:%22startup%22%2C%22utm_medium%22:%22chrome%22}; MONITOR_WEB_ID=ce5a3279-6ed5-4ede-9b00-29aa7c1a1311; email=liujunmei@bytedance.com; user_token=JTdCJTIybmFtZSUyMiUzQSUyMiVFNSU4OCU5OCVFNCVCRiU4QSVFNiVBMiU4NSUyMiUyQyUyMmZ1bGxfbmFtZSUyMiUzQSUyMiVFNSU4OCU5OCVFNCVCRiU4QSVFNiVBMiU4NSUyMDM4MzAzMTklMjIlMkMlMjJlbWFpbCUyMiUzQSUyMmxpdWp1bm1laSU0MGJ5dGVkYW5jZS5jb20lMjIlMkMlMjJwaWN0dXJlJTIyJTNBJTIyaHR0cHMlM0ElMkYlMkZzMS1pbWZpbGUuZmVpc2h1Y2RuLmNvbSUyRnN0YXRpYy1yZXNvdXJjZSUyRnYxJTJGdjNfMDBrOF81ZDBhNDk4MS0zMDJkLTQwMTEtOGJmMy0yNDYzZDhkY2IxMWd+JTNGaW1hZ2Vfc2l6ZSUzRDI0MHgyNDAlMjZjdXRfdHlwZSUzRCUyNnF1YWxpdHklM0QlMjZmb3JtYXQlM0RwbmclMjZzdGlja2VyX2Zvcm1hdCUzRC53ZWJwJTIyJTJDJTIyZW1wbG95ZWVfaWQlMjIlM0ElMjIzODMwMzE5JTIyJTJDJTIyZW1wbG95ZWVfbnVtYmVyJTIyJTNBJTIyMzgzMDMxOSUyMiUyQyUyMnRlbmFudF9hbGlhcyUyMiUzQSUyMmJ5dGVkYW5jZSUyMiUyQyUyMnVzZXJfaWQlMjIlM0ElMjJkZWdubjk2MWtma2treW9waDd5cyUyMiU3RA==; amuserid=3830319@bytedance.people; titan_passport_id=cn/bytedance/89511df1-02a0-412c-907d-fd5079b66ebe; MONITOR_WEB_ID=ce5a3279-6ed5-4ede-9b00-29aa7c1a1311; _tea_utm_cache_1229=undefined; bd_sso_3b6da9=eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHAiOjE3NTg4MTU4NzQsImlhdCI6MTc1ODIxMTA3NCwiaXNzIjoic3NvLmJ5dGVkYW5jZS5jb20iLCJzdWIiOiJkZWdubjk2MWtma2treW9waDd5cyIsInRlbmFudF9pZCI6ImhncTN0Y2NwM2kxc2pqbjU4emlrIn0.IkLCCJrY4uuskameDvQpPgArxbEpS7P202Q46tGJkqNm5JrV73SvAeRtU9jNtbBRruTwQnlyuZYpIcGy2CJq1UiBLLb34jGhnoqw6-v6C2s3sKu5OYuHNcPYHvYTbUi7aqVxYeJWA7ag0Wx0rmdjb250oZkmurQKbdVFq8mihfHUumm55LskBcsA2ai5WHX4fNPzJ63GNJt0CvWnAOIPT7cvY8qZWZhbqqyfVL6gdkPAxiCR6mLmjkg0Jrrl84jbPM3LQxaySGZ91vU5WuRpnpn_ITBXDtvySTEN63lFj0IkaiNxgjQQXonPEnndgoDI3Q1N-Jif-MFlucgy8a04MA',
|
|
631
|
+
'Content-Type': 'application/json',
|
|
632
|
+
'x-use-ppe': '1',
|
|
633
|
+
'x-tt-env': 'ppe_itam_feat_vector_opt_nym'
|
|
634
|
+
}
|
|
635
|
+
|
|
636
|
+
response = requests.request("POST", url, headers=headers, data=payload)
|
|
637
|
+
|
|
638
|
+
return json.loads(response.text)
|
|
639
|
+
|
|
640
|
+
def GetBestMatchItemoff(SearchKey, HardwareMatchType, clientinfo):
|
|
641
|
+
url = "https://it-pre.bytedance.net/itam-byte/api/itservice/common/GetBestMatchItem"
|
|
642
|
+
|
|
643
|
+
if HardwareMatchType==1:
|
|
644
|
+
pr = {"SearchKey":SearchKey,"TopN":10,"AiUseType":5,
|
|
645
|
+
"QueryAssetModelScopeRequestV2":
|
|
646
|
+
{"HardwareMatchType":HardwareMatchType,
|
|
647
|
+
"TemplateType":"6848436753938779140",
|
|
648
|
+
"ApplyRegionID":"7468013511194643493",
|
|
649
|
+
"Page":{"PageNum":1,"PageSize":10}},"psm":"athena"}
|
|
650
|
+
if HardwareMatchType==2:
|
|
651
|
+
pr = {"SearchKey":SearchKey,"TopN":10,"AiUseType":5,
|
|
652
|
+
"QueryAssetModelScopeRequestV2":
|
|
653
|
+
{"HardwareMatchType":HardwareMatchType,
|
|
654
|
+
"TemplateType":"6848436753938779140",
|
|
655
|
+
"ApplyRegionID":"7509062433064029194","Page":{"PageNum":1,"PageSize":10}},"psm":"athena"}
|
|
656
|
+
|
|
657
|
+
|
|
658
|
+
|
|
659
|
+
payload = json.dumps(pr)
|
|
660
|
+
# time.sleep(5)
|
|
661
|
+
headers = {
|
|
662
|
+
'authorization': clientinfo.get(
|
|
663
|
+
'authorization') or 'Bearer eyJhbGciOiJSUzI1NiIsImtpZCI6InYyIiwidHlwIjoiSldUIn0.eyJleHAiOjE3NTk0MTc3ODEsImp0aSI6IkVXSUNmT0k5WVBCZVdKSTkiLCJpYXQiOjE3NTgxMjE3ODEsImlzcyI6InRhbm5hIiwic3ViIjoiMzgzMDMxOUBieXRlZGFuY2UucGVvcGxlIiwidGVuYW50X2lkIjoiYnl0ZWRhbmNlLnBlb3BsZSIsInRlbmFudF9uYW1lIjoiIiwicHJvamVjdF9rZXkiOiJjcm1TZmdIVmU1dXhIMHJyIiwidW5pdCI6ImV1X25jIiwiYXV0aF9ieSI6Mn0.MmENqyPY7k4KMz9ufbxzpIZXOnLaoYAAyv3J2T0OMz6tcd1IyEhYJd1cFjzqLw26NnWe4bfglki7zmIVQduftIJc8QaRcXDjDszCfG4DfH2O7zQTi7cwptt_o-CxI6E6osRhYmJ7dwaSWw1hBRlnBNJMbyzUlHRspJz-hox_oGA',
|
|
664
|
+
'cookie': clientinfo.get(
|
|
665
|
+
'cookie') or '_ga=GA1.1.1854125625.1750232273; _ga_FVWC4GKEYS=GS2.1.s1750301537$o2$g1$t1750301683$j60$l0$h0; X-Risk-Browser-Id=8f55035c3e943940f7e4eea73ae96e203e00887d4e38ec8b0f918e6477c34ef8; people-lang=zh; _tea_utm_cache_1508={%22utm_source%22:%22startup%22%2C%22utm_medium%22:%22chrome%22}; MONITOR_WEB_ID=ce5a3279-6ed5-4ede-9b00-29aa7c1a1311; email=liujunmei@bytedance.com; user_token=JTdCJTIybmFtZSUyMiUzQSUyMiVFNSU4OCU5OCVFNCVCRiU4QSVFNiVBMiU4NSUyMiUyQyUyMmZ1bGxfbmFtZSUyMiUzQSUyMiVFNSU4OCU5OCVFNCVCRiU4QSVFNiVBMiU4NSUyMDM4MzAzMTklMjIlMkMlMjJlbWFpbCUyMiUzQSUyMmxpdWp1bm1laSU0MGJ5dGVkYW5jZS5jb20lMjIlMkMlMjJwaWN0dXJlJTIyJTNBJTIyaHR0cHMlM0ElMkYlMkZzMS1pbWZpbGUuZmVpc2h1Y2RuLmNvbSUyRnN0YXRpYy1yZXNvdXJjZSUyRnYxJTJGdjNfMDBrOF81ZDBhNDk4MS0zMDJkLTQwMTEtOGJmMy0yNDYzZDhkY2IxMWd+JTNGaW1hZ2Vfc2l6ZSUzRDI0MHgyNDAlMjZjdXRfdHlwZSUzRCUyNnF1YWxpdHklM0QlMjZmb3JtYXQlM0RwbmclMjZzdGlja2VyX2Zvcm1hdCUzRC53ZWJwJTIyJTJDJTIyZW1wbG95ZWVfaWQlMjIlM0ElMjIzODMwMzE5JTIyJTJDJTIyZW1wbG95ZWVfbnVtYmVyJTIyJTNBJTIyMzgzMDMxOSUyMiUyQyUyMnRlbmFudF9hbGlhcyUyMiUzQSUyMmJ5dGVkYW5jZSUyMiUyQyUyMnVzZXJfaWQlMjIlM0ElMjJkZWdubjk2MWtma2treW9waDd5cyUyMiU3RA==; amuserid=3830319@bytedance.people; titan_passport_id=cn/bytedance/89511df1-02a0-412c-907d-fd5079b66ebe; MONITOR_WEB_ID=ce5a3279-6ed5-4ede-9b00-29aa7c1a1311; _tea_utm_cache_1229=undefined; bd_sso_3b6da9=eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHAiOjE3NTg4MTU4NzQsImlhdCI6MTc1ODIxMTA3NCwiaXNzIjoic3NvLmJ5dGVkYW5jZS5jb20iLCJzdWIiOiJkZWdubjk2MWtma2treW9waDd5cyIsInRlbmFudF9pZCI6ImhncTN0Y2NwM2kxc2pqbjU4emlrIn0.IkLCCJrY4uuskameDvQpPgArxbEpS7P202Q46tGJkqNm5JrV73SvAeRtU9jNtbBRruTwQnlyuZYpIcGy2CJq1UiBLLb34jGhnoqw6-v6C2s3sKu5OYuHNcPYHvYTbUi7aqVxYeJWA7ag0Wx0rmdjb250oZkmurQKbdVFq8mihfHUumm55LskBcsA2ai5WHX4fNPzJ63GNJt0CvWnAOIPT7cvY8qZWZhbqqyfVL6gdkPAxiCR6mLmjkg0Jrrl84jbPM3LQxaySGZ91vU5WuRpnpn_ITBXDtvySTEN63lFj0IkaiNxgjQQXonPEnndgoDI3Q1N-Jif-MFlucgy8a04MA',
|
|
666
|
+
'Content-Type': 'application/json',
|
|
667
|
+
'x-use-ppe': '1',
|
|
668
|
+
'x-tt-env': 'ppe_itam_feat_vector_opt_nym'
|
|
669
|
+
}
|
|
670
|
+
|
|
671
|
+
response = requests.request("POST", url, headers=headers, data=payload)
|
|
672
|
+
|
|
673
|
+
return json.loads(response.text)
|
|
541
674
|
def GetBestMatchItemonline_old(SearchKey, HardwareMatchType, clientinfo):
|
|
542
675
|
url = "https://it.bytedance.com/itam-byte/api/itservice/common/GetBestMatchItem"
|
|
543
676
|
payload = json.dumps({
|
|
@@ -2,10 +2,10 @@ from setuptools import setup, find_packages
|
|
|
2
2
|
|
|
3
3
|
setup(
|
|
4
4
|
name="itam_assistant", # 包名称
|
|
5
|
-
version="0.1.
|
|
5
|
+
version="0.1.12", # 版本号
|
|
6
6
|
author="liujunmeiD",
|
|
7
7
|
author_email="1105030421@qq.com",
|
|
8
|
-
description="
|
|
8
|
+
description="优化版本--算法-水位线",
|
|
9
9
|
long_description=open("README.md").read(),
|
|
10
10
|
long_description_content_type="text/markdown",
|
|
11
11
|
url="https://github.com/liujunmeiD/itam_assistant",
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{itam_assistant-0.1.10 → itam_assistant-0.1.12}/itam_assistant.egg-info/dependency_links.txt
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|