itam-assistant 0.1.9__tar.gz → 0.1.11__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.
Files changed (19) hide show
  1. {itam_assistant-0.1.9 → itam_assistant-0.1.11}/PKG-INFO +2 -2
  2. {itam_assistant-0.1.9 → itam_assistant-0.1.11}/itam_assistant/do_ai.py +92 -3
  3. {itam_assistant-0.1.9 → itam_assistant-0.1.11}/itam_assistant.egg-info/PKG-INFO +2 -2
  4. {itam_assistant-0.1.9 → itam_assistant-0.1.11}/setup.py +2 -2
  5. {itam_assistant-0.1.9 → itam_assistant-0.1.11}/README.md +0 -0
  6. {itam_assistant-0.1.9 → itam_assistant-0.1.11}/itam_assistant/__init__.py +0 -0
  7. {itam_assistant-0.1.9 → itam_assistant-0.1.11}/itam_assistant/ailyapp_client.py +0 -0
  8. {itam_assistant-0.1.9 → itam_assistant-0.1.11}/itam_assistant/config.py +0 -0
  9. {itam_assistant-0.1.9 → itam_assistant-0.1.11}/itam_assistant/intent_detail.py +0 -0
  10. {itam_assistant-0.1.9 → itam_assistant-0.1.11}/itam_assistant/lark_client.py +0 -0
  11. {itam_assistant-0.1.9 → itam_assistant-0.1.11}/itam_assistant/logger.py +0 -0
  12. {itam_assistant-0.1.9 → itam_assistant-0.1.11}/itam_assistant/openapi.py +0 -0
  13. {itam_assistant-0.1.9 → itam_assistant-0.1.11}/itam_assistant/test.py +0 -0
  14. {itam_assistant-0.1.9 → itam_assistant-0.1.11}/itam_assistant.egg-info/SOURCES.txt +0 -0
  15. {itam_assistant-0.1.9 → itam_assistant-0.1.11}/itam_assistant.egg-info/dependency_links.txt +0 -0
  16. {itam_assistant-0.1.9 → itam_assistant-0.1.11}/itam_assistant.egg-info/requires.txt +0 -0
  17. {itam_assistant-0.1.9 → itam_assistant-0.1.11}/itam_assistant.egg-info/top_level.txt +0 -0
  18. {itam_assistant-0.1.9 → itam_assistant-0.1.11}/setup.cfg +0 -0
  19. {itam_assistant-0.1.9 → itam_assistant-0.1.11}/test/test.py +0 -0
@@ -1,7 +1,7 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: itam_assistant
3
- Version: 0.1.9
4
- Summary: 优化版本--技能分发的结果展示
3
+ Version: 0.1.11
4
+ Summary: 优化版本--技能分发的结果展示-新增时间控制 14s
5
5
  Home-page: https://github.com/liujunmeiD/itam_assistant
6
6
  Author: liujunmeiD
7
7
  Author-email: 1105030421@qq.com
@@ -89,19 +89,20 @@ def do_ai_auto(Testk_data, clientinfo):
89
89
  startAt = int(time.time())
90
90
  # 创建会话
91
91
  seseion_id = AilyLarkClient(clientinfo).create_ailysession(tenant_access_token)
92
- time.sleep(2)
92
+ time.sleep(3)
93
93
  if not seseion_id:
94
94
  raise ValueError("未能成功创建会话")
95
95
  # 创建消息
96
96
  message_id = AilyLarkClient(clientinfo).create_ailysessionaily_message(tenant_access_token, seseion_id,
97
97
  aa)
98
- time.sleep(2)
98
+ time.sleep(3)
99
99
  if not message_id:
100
100
  raise ValueError("未能成功创建消息")
101
101
  # 创建运行实例
102
102
  runs = AilyLarkClient(clientinfo).create_ailysession_run(tenant_access_token, seseion_id)
103
- time.sleep(2)
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}")
@@ -970,3 +971,91 @@ def write_excletolist(data_name):
970
971
 
971
972
 
972
973
 
974
+ def do_waterlevelline_autotest_fix(collections, clientinfo, score_threshold):
975
+ """
976
+ 水位线评测- 返回 符合报告模式的结果
977
+ """
978
+ keywprd= []
979
+ info_list = []
980
+ info = {
981
+ "input": {
982
+ "用户输入/userInput": "我要申请软件,名字叫:ai_xzh_all_restricted_software完全受限软件"
983
+ },
984
+ "output": {
985
+ "用户输入/output": "我要申请软件,名字叫:ai_xzh_all_restricted_software完全受限软件"
986
+ },
987
+ "rt": True,
988
+ "label": [{"label": "GUI 软件申请", "score": 0.6}, {"label": "软件申请", "score": 0.5}],
989
+ "exp": [{"label": "GUI 软件申请", " score": 0.9}, {"label": "软件申请", "score": 0.8
990
+ }],
991
+ "artificial": []
992
+ }
993
+ a =0
994
+ for i in collections:
995
+ info['input']['用户输入/userInput'] = i['ext']['资产名称']
996
+ info['output']['用户输入/output'] = i['ext']['资产名称']
997
+ info['exp'] = []
998
+ 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')]:
999
+ if j:
1000
+ info['exp'].append({'label': j, 'score': score_threshold})
1001
+ #判断i['ext']['BPO标注-AP-资产型号']是否为空,为空就不用读取,不为空就读取
1002
+ if i['ext']['资产名称']:
1003
+ asset_name = i['ext']['资产名称']
1004
+ try:
1005
+ if isinstance(asset_name, str):
1006
+ asset_name = json.loads(asset_name)
1007
+ except json.JSONDecodeError:
1008
+ # 若解析失败,说明不是 JSON 格式,保持原样
1009
+ pass
1010
+ info['artificial'] = info['exp']
1011
+ if i['ext']['资产名称']:
1012
+ asset_name = i['ext']['资产名称']
1013
+ try:
1014
+ if isinstance(asset_name, str):
1015
+ asset_name = json.loads(asset_name)
1016
+ except json.JSONDecodeError:
1017
+ # 若解析失败,说明不是 JSON 格式,保持原样
1018
+ pass
1019
+ if "设备领用" in i['ext']['评测集标签']:
1020
+ keywprd = GetBestMatchItemandres_new(asset_name, i['ext']['资产类型'], clientinfo)
1021
+
1022
+ else:
1023
+ res = ""
1024
+ infoout = do_waterlevellineres_listv3(keywprd, info)
1025
+ info_list.append(copy.deepcopy(infoout))
1026
+ a = a+1
1027
+ print("这是"+str(a))
1028
+ bbb = a
1029
+ return info_list
1030
+
1031
+
1032
+ def do_waterlevellineres_listv3(res, info):
1033
+ """
1034
+ 获取结果,并组装水位线info
1035
+ """
1036
+ if res == '':
1037
+ info['label'] = [{'label': '', 'score': 0}, {'label': '', 'score': 0}]
1038
+ info['rt'] = False
1039
+ return info
1040
+ reslist = res['res']
1041
+ info['output']['用户输入/output'] = 'log_id:' + res.get('log')
1042
+ if reslist:
1043
+ #取所有结果并追加到info['label']
1044
+ info['label'] = []
1045
+ if len(reslist) > 0:
1046
+ for j in range(len(reslist)):
1047
+ aaa = {'label': reslist[j]['Name'],
1048
+ 'score': reslist[j]['Score']}
1049
+ info['label'].append(copy.deepcopy(aaa))
1050
+ # 判断exp和label是否一致,一致则:rt=True,不一致则:rt=False
1051
+ for a in range(len(info['exp'])):
1052
+ if info['exp'][a]['label']== info['label'][a]['label']:
1053
+ info['rt'] = True
1054
+ else:
1055
+ info['rt'] = False
1056
+ break
1057
+ else:
1058
+ info['label'] = info['label'] = [{'label': '', 'score': 0}, {'label': '', 'score': 0}]
1059
+ info['rt'] = False
1060
+
1061
+ return info
@@ -1,7 +1,7 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: itam_assistant
3
- Version: 0.1.9
4
- Summary: 优化版本--技能分发的结果展示
3
+ Version: 0.1.11
4
+ Summary: 优化版本--技能分发的结果展示-新增时间控制 14s
5
5
  Home-page: https://github.com/liujunmeiD/itam_assistant
6
6
  Author: liujunmeiD
7
7
  Author-email: 1105030421@qq.com
@@ -2,10 +2,10 @@ from setuptools import setup, find_packages
2
2
 
3
3
  setup(
4
4
  name="itam_assistant", # 包名称
5
- version="0.1.9", # 版本号
5
+ version="0.1.11", # 版本号
6
6
  author="liujunmeiD",
7
7
  author_email="1105030421@qq.com",
8
- description="优化版本--技能分发的结果展示",
8
+ description="优化版本--技能分发的结果展示-新增时间控制 14s",
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",