itam-assistant 0.1.16__py3-none-any.whl → 0.1.18__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.
itam_assistant/do_ai.py CHANGED
@@ -19,6 +19,7 @@ def do_ai_auto(Testk_data, clientinfo):
19
19
  自动化执行AI测试用例
20
20
  """
21
21
  startAt = 0
22
+ webapiClient(clientinfo).intentdetaillist_cookiecheck()
22
23
  try:
23
24
 
24
25
  # 判断Testsuitelink中是否包含https://
@@ -103,6 +104,7 @@ def do_ai_auto(Testk_data, clientinfo):
103
104
  time.sleep(4)
104
105
  num = num + 1
105
106
  time.sleep(4)
107
+ print(f"已处理{num}/{len(Testk_data)}条数据,用户输入为:{aa}")
106
108
  return startAt, num
107
109
  except KeyError as ke:
108
110
  print(f"KeyError 发生: 数据中缺少必要的键,错误详情: {ke}")
@@ -31,7 +31,33 @@ class webapiClient():
31
31
  self.conn = http.client.HTTPSConnection("apaas-spring-3bf03.aedev.feishuapp.cn")
32
32
  headers['x-kunlun-switchctxtoprod'] = True
33
33
 
34
-
34
+ def intentdetaillist_cookiecheck(self):
35
+ #检查接口的授权信息是否有效
36
+ # 输入参数类型和范围检查
37
+ startAt = int(time.time()) - 30 * 24 * 60 * 60
38
+ endAt = int(time.time())
39
+ payload = json.dumps({
40
+ "startAt": startAt,
41
+ "endAt": endAt,
42
+ "matchIntentID": "",
43
+ "matchStatus": [],
44
+ "pageSize": 50
45
+ })
46
+ try:
47
+ self.conn.request("POST",
48
+ f"/ai/api/v1/conversational_runtime/namespaces/{self.aily_app_id}/stats/intent_detail_list",
49
+ payload, self.headers)
50
+ res = self.conn.getresponse()
51
+ # 检查响应状态码
52
+ if res.status != 200:
53
+ raise http.client.HTTPException(f"请求失败,状态码: {res.status}, 原因: {res.reason}")
54
+ data = res.read()
55
+ data_str = data.decode('utf-8')
56
+ data_dict = json.loads(data_str)
57
+ if data_dict.get('error_msg'):
58
+ raise ValueError(f"接口intent_detail_list,报错{data_str},可能是cookie/x-kunlun-token无效请检查")
59
+ except http.client.HTTPException as http_err:
60
+ print(f"HTTP 请求错误: {http_err}")
35
61
 
36
62
  def get_intent_detail_list(self, startAt, pageSize):
37
63
  """
@@ -59,7 +85,7 @@ class webapiClient():
59
85
  "endAt": endAt,
60
86
  "matchIntentID": "",
61
87
  "matchStatus": [],
62
- "pageSize": pageSize+1000
88
+ "pageSize": pageSize+500
63
89
  })
64
90
  try:
65
91
  self.conn.request("POST",f"/ai/api/v1/conversational_runtime/namespaces/{self.aily_app_id}/stats/intent_detail_list",payload, self.headers)
@@ -1,7 +1,7 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: itam_assistant
3
- Version: 0.1.16
4
- Summary: 新增功能:1. 支持自定义模型路径 2. 支持自定义模型参数
3
+ Version: 0.1.18
4
+ Summary: 新增功能:打印出记录
5
5
  Home-page: https://github.com/liujunmeiD/itam_assistant
6
6
  Author: liujunmeiD
7
7
  Author-email: 1105030421@qq.com
@@ -1,13 +1,13 @@
1
1
  itam_assistant/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
2
2
  itam_assistant/ailyapp_client.py,sha256=w-ihtcmRgOQCgWK0jB8eHGCikjo1tbre3xCiEKhLrUA,6357
3
3
  itam_assistant/config.py,sha256=L_5grm2ZWwg_S1JTOU6XLhQ5GPeYJaBFBLwzP2JA5Ys,5498
4
- itam_assistant/do_ai.py,sha256=KNvUKpf8LdaUkI2AmHokKd74rhbbxGY3-pfDE7xphH8,49680
5
- itam_assistant/intent_detail.py,sha256=MQCOhy1Z5iNB4jRjt7IALRDBVvujbOTBV7JJo9dwi00,17115
4
+ itam_assistant/do_ai.py,sha256=fxhZKJs6UMmTkTwRNh-8JS8lcbgxVK5IthI26oXjMPM,49829
5
+ itam_assistant/intent_detail.py,sha256=xeQcUa5fDzEWxEV7pudmWMTKFiR_6-zH7hpDC6D7B3I,18378
6
6
  itam_assistant/lark_client.py,sha256=ZVDsdt7ucQvJN1-khC3TR-0IMeYaQXfdWF5DxRrkBH4,6665
7
7
  itam_assistant/logger.py,sha256=W3-tbQ4J-QKSrQSpaNBruzoyMuWYrUkrIY0uBZ1o-lw,1583
8
8
  itam_assistant/openapi.py,sha256=xLNLB5Tui_nfDsa95VwASHWa5TMq_oRcFgSOGRaTbyU,50383
9
9
  itam_assistant/test.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
10
- itam_assistant-0.1.16.dist-info/METADATA,sha256=W8uquW-IMAD9QxORaZqUdfIkRUThCmx0KhFv8y5K-9k,787
11
- itam_assistant-0.1.16.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
12
- itam_assistant-0.1.16.dist-info/top_level.txt,sha256=KpZA4H04XBVAB3NLq0AAEOrAGEurwMnWw41AhJVqVFI,15
13
- itam_assistant-0.1.16.dist-info/RECORD,,
10
+ itam_assistant-0.1.18.dist-info/METADATA,sha256=_jfLT2PWH1MjoNwhbNDIITUztXHfZ1WwfKdoWJkE6fQ,741
11
+ itam_assistant-0.1.18.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
12
+ itam_assistant-0.1.18.dist-info/top_level.txt,sha256=KpZA4H04XBVAB3NLq0AAEOrAGEurwMnWw41AhJVqVFI,15
13
+ itam_assistant-0.1.18.dist-info/RECORD,,