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