itam-assistant 0.1.16__tar.gz → 0.1.17__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.16 → itam_assistant-0.1.17}/PKG-INFO +2 -2
  2. {itam_assistant-0.1.16 → itam_assistant-0.1.17}/itam_assistant/do_ai.py +1 -0
  3. {itam_assistant-0.1.16 → itam_assistant-0.1.17}/itam_assistant/intent_detail.py +28 -2
  4. {itam_assistant-0.1.16 → itam_assistant-0.1.17}/itam_assistant.egg-info/PKG-INFO +2 -2
  5. {itam_assistant-0.1.16 → itam_assistant-0.1.17}/setup.py +2 -2
  6. {itam_assistant-0.1.16 → itam_assistant-0.1.17}/README.md +0 -0
  7. {itam_assistant-0.1.16 → itam_assistant-0.1.17}/itam_assistant/__init__.py +0 -0
  8. {itam_assistant-0.1.16 → itam_assistant-0.1.17}/itam_assistant/ailyapp_client.py +0 -0
  9. {itam_assistant-0.1.16 → itam_assistant-0.1.17}/itam_assistant/config.py +0 -0
  10. {itam_assistant-0.1.16 → itam_assistant-0.1.17}/itam_assistant/lark_client.py +0 -0
  11. {itam_assistant-0.1.16 → itam_assistant-0.1.17}/itam_assistant/logger.py +0 -0
  12. {itam_assistant-0.1.16 → itam_assistant-0.1.17}/itam_assistant/openapi.py +0 -0
  13. {itam_assistant-0.1.16 → itam_assistant-0.1.17}/itam_assistant/test.py +0 -0
  14. {itam_assistant-0.1.16 → itam_assistant-0.1.17}/itam_assistant.egg-info/SOURCES.txt +0 -0
  15. {itam_assistant-0.1.16 → itam_assistant-0.1.17}/itam_assistant.egg-info/dependency_links.txt +0 -0
  16. {itam_assistant-0.1.16 → itam_assistant-0.1.17}/itam_assistant.egg-info/requires.txt +0 -0
  17. {itam_assistant-0.1.16 → itam_assistant-0.1.17}/itam_assistant.egg-info/top_level.txt +0 -0
  18. {itam_assistant-0.1.16 → itam_assistant-0.1.17}/setup.cfg +0 -0
  19. {itam_assistant-0.1.16 → itam_assistant-0.1.17}/test/test.py +0 -0
@@ -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.17
4
+ Summary: 新增功能:检查接口授权是否过期
5
5
  Home-page: https://github.com/liujunmeiD/itam_assistant
6
6
  Author: liujunmeiD
7
7
  Author-email: 1105030421@qq.com
@@ -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://
@@ -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.17
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.16", # 版本号
5
+ version="0.1.17", # 版本号
6
6
  author="liujunmeiD",
7
7
  author_email="1105030421@qq.com",
8
- description="新增功能:1. 支持自定义模型路径 2. 支持自定义模型参数",
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",