itam-assistant 0.1.15__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.
- {itam_assistant-0.1.15 → itam_assistant-0.1.17}/PKG-INFO +2 -2
- {itam_assistant-0.1.15 → itam_assistant-0.1.17}/itam_assistant/do_ai.py +1 -0
- {itam_assistant-0.1.15 → itam_assistant-0.1.17}/itam_assistant/intent_detail.py +40 -6
- itam_assistant-0.1.17/itam_assistant/test.py +0 -0
- {itam_assistant-0.1.15 → itam_assistant-0.1.17}/itam_assistant.egg-info/PKG-INFO +2 -2
- {itam_assistant-0.1.15 → itam_assistant-0.1.17}/setup.py +2 -2
- itam_assistant-0.1.15/itam_assistant/test.py +0 -1
- {itam_assistant-0.1.15 → itam_assistant-0.1.17}/README.md +0 -0
- {itam_assistant-0.1.15 → itam_assistant-0.1.17}/itam_assistant/__init__.py +0 -0
- {itam_assistant-0.1.15 → itam_assistant-0.1.17}/itam_assistant/ailyapp_client.py +0 -0
- {itam_assistant-0.1.15 → itam_assistant-0.1.17}/itam_assistant/config.py +0 -0
- {itam_assistant-0.1.15 → itam_assistant-0.1.17}/itam_assistant/lark_client.py +0 -0
- {itam_assistant-0.1.15 → itam_assistant-0.1.17}/itam_assistant/logger.py +0 -0
- {itam_assistant-0.1.15 → itam_assistant-0.1.17}/itam_assistant/openapi.py +0 -0
- {itam_assistant-0.1.15 → itam_assistant-0.1.17}/itam_assistant.egg-info/SOURCES.txt +0 -0
- {itam_assistant-0.1.15 → itam_assistant-0.1.17}/itam_assistant.egg-info/dependency_links.txt +0 -0
- {itam_assistant-0.1.15 → itam_assistant-0.1.17}/itam_assistant.egg-info/requires.txt +0 -0
- {itam_assistant-0.1.15 → itam_assistant-0.1.17}/itam_assistant.egg-info/top_level.txt +0 -0
- {itam_assistant-0.1.15 → itam_assistant-0.1.17}/setup.cfg +0 -0
- {itam_assistant-0.1.15 → itam_assistant-0.1.17}/test/test.py +0 -0
|
@@ -20,10 +20,44 @@ class webapiClient():
|
|
|
20
20
|
headers = {
|
|
21
21
|
'cookie': clientin['cookie'],
|
|
22
22
|
'x-kunlun-token': clientin['x-kunlun-token'],
|
|
23
|
-
'Content-Type': "application/json"
|
|
23
|
+
'Content-Type': "application/json"
|
|
24
|
+
}
|
|
24
25
|
self.headers = headers
|
|
25
26
|
self.itamheaders = headers
|
|
26
27
|
self.conn = http.client.HTTPSConnection("apaas.feishu.cn")
|
|
28
|
+
#spring_be31ab47e7__c 新
|
|
29
|
+
self.aily_app_id = clientin['aily_app_id']
|
|
30
|
+
if self.aily_app_id == "spring_be31ab47e7__c":
|
|
31
|
+
self.conn = http.client.HTTPSConnection("apaas-spring-3bf03.aedev.feishuapp.cn")
|
|
32
|
+
headers['x-kunlun-switchctxtoprod'] = True
|
|
33
|
+
|
|
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}")
|
|
27
61
|
|
|
28
62
|
def get_intent_detail_list(self, startAt, pageSize):
|
|
29
63
|
"""
|
|
@@ -51,10 +85,10 @@ class webapiClient():
|
|
|
51
85
|
"endAt": endAt,
|
|
52
86
|
"matchIntentID": "",
|
|
53
87
|
"matchStatus": [],
|
|
54
|
-
"pageSize": pageSize
|
|
88
|
+
"pageSize": pageSize+500
|
|
55
89
|
})
|
|
56
90
|
try:
|
|
57
|
-
self.conn.request("POST","/ai/api/v1/conversational_runtime/namespaces/
|
|
91
|
+
self.conn.request("POST",f"/ai/api/v1/conversational_runtime/namespaces/{self.aily_app_id}/stats/intent_detail_list",payload, self.headers)
|
|
58
92
|
res = self.conn.getresponse()
|
|
59
93
|
# 检查响应状态码
|
|
60
94
|
if res.status != 200:
|
|
@@ -107,7 +141,7 @@ class webapiClient():
|
|
|
107
141
|
while retries < max_retries:
|
|
108
142
|
try:
|
|
109
143
|
payload = ''
|
|
110
|
-
urlintentID = f'https://apaas.feishu.cn/ai/api/v1/conversational_runtime/namespaces/
|
|
144
|
+
urlintentID = f'https://apaas.feishu.cn/ai/api/v1/conversational_runtime/namespaces/{self.aily_app_id}/intent/{intentID}?pageSize=20&statusFilter=%5B%5D&fieldFilter=_node_id&fieldFilter=status&fieldFilter=usages&fieldFilter=_node_name&fieldFilter=_node_type&fieldFilter=title_for_maker&fieldFilter=associate_id'
|
|
111
145
|
response = requests.request("GET", urlintentID, headers=self.headers, data=payload)
|
|
112
146
|
# 检查响应状态码
|
|
113
147
|
response.raise_for_status()
|
|
@@ -140,7 +174,7 @@ class webapiClient():
|
|
|
140
174
|
while retries < max_retries:
|
|
141
175
|
try:
|
|
142
176
|
payload = ''
|
|
143
|
-
urlnodeid = f'https://apaas.feishu.cn/ai/api/v1/conversational_runtime/namespaces/
|
|
177
|
+
urlnodeid = f'https://apaas.feishu.cn/ai/api/v1/conversational_runtime/namespaces/{self.aily_app_id}/association/{intentID}/node/{nodeid}?intentID={intentID}'
|
|
144
178
|
response = requests.request("GET", urlnodeid, headers=self.headers, data=payload)
|
|
145
179
|
# 检查响应状态码
|
|
146
180
|
response.raise_for_status()
|
|
@@ -275,7 +309,7 @@ class webapiClient():
|
|
|
275
309
|
""""""
|
|
276
310
|
if __name__ == '__main__':
|
|
277
311
|
clientin = {
|
|
278
|
-
'cookie': 'X-Kunlun-SessionId=L%3A028d306c70a340a69fe9.eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ2YWwiOnsidGVuYW50X2lkIjozOTAsInVzZXJfaWQiOjE3MjIxNjYwNzMxOTk2NDUsInRlbmFudF9kb21haW5fbmFtZSI6ImFwYWFzIiwic2Vzc2lvbl92ZXJzaW9uIjoidjIwMjAtMDUtMTkiLCJ3c190b2tlbiI6Ilc6ZTU3MmJlYzNmOGIzNDE0ZDk0NDYiLCJsb2dpbl90b2tlbiI6IjE3MDE3ZmFlMWJlNjVlMzc2V1VhMzA0ZjY0N2MyZmFjY2QwZ256YmNmNGVjNzAzZDgwOWYxNHJPWTY0MzY1ZjEyNWI0YmZlZDhreUciLCJzb3VyY2VfY2hhbm5lbCI6ImZlaXNodSIsInRlbmFudF9rZXkiOiI3MzY1ODhjOTI2MGYxNzVkIiwiZXh0ZXJuYWxfZG9tYWluX25hbWUiOiJieXRlZGFuY2UiLCJvcmlnaW5hbF90ZW5hbnRfaWQiOjAsIm9yaWdpbmFsX3VzZXJfaWQiOjAsImlkcF9jaGFubmVsIjoiIn0sImV4cCI6MTc2Mzg4MzY0NX0.VWyqct9gPOSXiX_72IqCRAknHsJK1aaZLIZ4gICbH5U; gd_random=eyJwZXJjZW50IjowLjY4NTgwODU2NDE4ODc2MjcsIm1hdGNoIjpmYWxzZX0=.iBiK3be8U+wA12/YghnWQbmDRz/vrBS/OQJpAvYx4XY=; trust_browser_id=3686a9b0-ce48-4e07-a0ce-e6928dc2bd6a; X-Kunlun-LoginTag=feishu; passport_trace_id=7389204030662426627; passport_web_did=7424353640858812419; QXV0aHpDb250ZXh0=9bcf0657fb6e47d497625011ffcd73e7; lark_sso_session=XN0YXJ0-488md350-54b2-433e-9eeb-b7a5c700ea26-WVuZA; X-Larkgw-Web-DID=3439857258174095984; X-Larkgw-Use-Lark-Session-119=1; __tea__ug__uid=7441424216023565850; is_anonymous_session=; fid=24c45ffc-f3d7-44f2-87ed-421f54ee78fb; lang=zh; i18n_locale=zh; locale=zh-CN; _gcl_au=1.1.2073766041.1742190427; _uetvid=44545540063311f08ed91353a6123699; _ga_7PY069DX7K=GS1.1.1742549605.1.0.1742549605.60.0.0; s_v_web_id=verify_m8cn771e_wyNgDZJ9_u4vt_4Tcr_8GHG_aoFTRqp3UEgK; _csrf_token=8d1282b097e1c2e7aea50829b47ffb77a72db55f-1745993230; help_center_session=7b5fca25-c6c5-4106-9d93-8709981a6957; _uuid_hera_ab_path_1=7502360423243071516; Hm_lvt_a79616d9322d81f12a92402ac6ae32ea=1746779408; apaas_web_did=1832530807807051; _tea_utm_cache_1229=undefined; lgw_csrf_token=c540cf747b5b41c2f749a2e1c0bd0900c3eb71b2-1747901330; _ga=GA1.2.113646166.1700115833; _gid=GA1.2.1661485038.1748331634; landing_url=https://accounts.feishu.cn/accounts/page/login?app_id=107&no_trap=1&redirect_uri=https%3A%2F%2Fapaas.feishu.cn%2Fai%
|
|
312
|
+
'cookie': 'X-Kunlun-SessionId=L%3A028d306c70a340a69fe9.eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ2YWwiOnsidGVuYW50X2lkIjozOTAsInVzZXJfaWQiOjE3MjIxNjYwNzMxOTk2NDUsInRlbmFudF9kb21haW5fbmFtZSI6ImFwYWFzIiwic2Vzc2lvbl92ZXJzaW9uIjoidjIwMjAtMDUtMTkiLCJ3c190b2tlbiI6Ilc6ZTU3MmJlYzNmOGIzNDE0ZDk0NDYiLCJsb2dpbl90b2tlbiI6IjE3MDE3ZmFlMWJlNjVlMzc2V1VhMzA0ZjY0N2MyZmFjY2QwZ256YmNmNGVjNzAzZDgwOWYxNHJPWTY0MzY1ZjEyNWI0YmZlZDhreUciLCJzb3VyY2VfY2hhbm5lbCI6ImZlaXNodSIsInRlbmFudF9rZXkiOiI3MzY1ODhjOTI2MGYxNzVkIiwiZXh0ZXJuYWxfZG9tYWluX25hbWUiOiJieXRlZGFuY2UiLCJvcmlnaW5hbF90ZW5hbnRfaWQiOjAsIm9yaWdpbmFsX3VzZXJfaWQiOjAsImlkcF9jaGFubmVsIjoiIn0sImV4cCI6MTc2Mzg4MzY0NX0.VWyqct9gPOSXiX_72IqCRAknHsJK1aaZLIZ4gICbH5U; gd_random=eyJwZXJjZW50IjowLjY4NTgwODU2NDE4ODc2MjcsIm1hdGNoIjpmYWxzZX0=.iBiK3be8U+wA12/YghnWQbmDRz/vrBS/OQJpAvYx4XY=; trust_browser_id=3686a9b0-ce48-4e07-a0ce-e6928dc2bd6a; X-Kunlun-LoginTag=feishu; passport_trace_id=7389204030662426627; passport_web_did=7424353640858812419; QXV0aHpDb250ZXh0=9bcf0657fb6e47d497625011ffcd73e7; lark_sso_session=XN0YXJ0-488md350-54b2-433e-9eeb-b7a5c700ea26-WVuZA; X-Larkgw-Web-DID=3439857258174095984; X-Larkgw-Use-Lark-Session-119=1; __tea__ug__uid=7441424216023565850; is_anonymous_session=; fid=24c45ffc-f3d7-44f2-87ed-421f54ee78fb; lang=zh; i18n_locale=zh; locale=zh-CN; _gcl_au=1.1.2073766041.1742190427; _uetvid=44545540063311f08ed91353a6123699; _ga_7PY069DX7K=GS1.1.1742549605.1.0.1742549605.60.0.0; s_v_web_id=verify_m8cn771e_wyNgDZJ9_u4vt_4Tcr_8GHG_aoFTRqp3UEgK; _csrf_token=8d1282b097e1c2e7aea50829b47ffb77a72db55f-1745993230; help_center_session=7b5fca25-c6c5-4106-9d93-8709981a6957; _uuid_hera_ab_path_1=7502360423243071516; Hm_lvt_a79616d9322d81f12a92402ac6ae32ea=1746779408; apaas_web_did=1832530807807051; _tea_utm_cache_1229=undefined; lgw_csrf_token=c540cf747b5b41c2f749a2e1c0bd0900c3eb71b2-1747901330; _ga=GA1.2.113646166.1700115833; _gid=GA1.2.1661485038.1748331634; landing_url=https://accounts.feishu.cn/accounts/page/login?app_id=107&no_trap=1&redirect_uri=https%3A%2F%2Fapaas.feishu.cn%2Fai%2F{self.appid}%2Fmanagement%2Fchat-log; session=XN0YXJ0-583sf83f-7ceb-44bc-8578-0692b8383b7c-WVuZA; session_list=XN0YXJ0-583sf83f-7ceb-44bc-8578-0692b8383b7c-WVuZA; _ga_VPYRHN104D=GS2.1.s1748331633$o2$g1$t1748331645$j48$l0$h0; kunlun-session-v2=L%3A028d306c70a340a69fe9.eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ2YWwiOnsidGVuYW50X2lkIjozOTAsInVzZXJfaWQiOjE3MjIxNjYwNzMxOTk2NDUsInRlbmFudF9kb21haW5fbmFtZSI6ImFwYWFzIiwic2Vzc2lvbl92ZXJzaW9uIjoidjIwMjAtMDUtMTkiLCJ3c190b2tlbiI6Ilc6ZTU3MmJlYzNmOGIzNDE0ZDk0NDYiLCJsb2dpbl90b2tlbiI6IjE3MDE3ZmFlMWJlNjVlMzc2V1VhMzA0ZjY0N2MyZmFjY2QwZ256YmNmNGVjNzAzZDgwOWYxNHJPWTY0MzY1ZjEyNWI0YmZlZDhreUciLCJzb3VyY2VfY2hhbm5lbCI6ImZlaXNodSIsInRlbmFudF9rZXkiOiI3MzY1ODhjOTI2MGYxNzVkIiwiZXh0ZXJuYWxfZG9tYWluX25hbWUiOiJieXRlZGFuY2UiLCJvcmlnaW5hbF90ZW5hbnRfaWQiOjAsIm9yaWdpbmFsX3VzZXJfaWQiOjAsImlkcF9jaGFubmVsIjoiIn0sImV4cCI6MTc2Mzg4MzY0NX0.VWyqct9gPOSXiX_72IqC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XJUeXBlIjoiNDIifSwibG9kIjpudWxsLCJjbmYiOnsiamt0IjoiRWtuRFMyTmdZVDR4Y2xZRDM4UU9KUHNkUFptLVluRHRaR3ZmX1hfSTJxTSJ9LCJucyI6ImxhcmsiLCJuc191aWQiOiI3MDUzOTk0MzAyMzAwNTUzMjE4IiwibnNfdGlkIjoiMSIsIm90IjozLCJjdCI6MTc0ODMzMTY0NSwicnQiOjE3NDgzMzE2NDV9fQ.BP9Q4Wxdq_TWB898FxFr4TlpqUN8-N1QC6fFWO57C8wiNeAcFNUfed8mGdd7kvBgbC5PjwnNJjoL0iXySUpuXQ; swp_csrf_token=dd289ebe-0ce4-42d2-aece-263b6abf2d45; t_beda37=e1445dd5c8a191cc38f34d9809eb3c5179904df5285bb079d87b96baad8ee3e5',
|
|
279
313
|
"x-kunlun-token": "17017fae1be65e376WUa304f647c2faccd0gnzbcf4ec703d809f14rOY64365f125b4bfed8kyG"
|
|
280
314
|
|
|
281
315
|
}
|
|
File without changes
|
|
@@ -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.17", # 版本号
|
|
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",
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
["鼠标","显示器双C数据线","Type-C扩展坞","西部数据-WDBEPK0020BBK","鼠标和键盘","鼠标","鼠标","鼠标","笔记本充电器","笔记本充电器","鼠标","And crown-PTH-660/K0-F","mouse and keyboard","hdmi dongle","笔记本支架","蓝牙键盘","mac蓝牙鼠标","鼠标耳机键盘","显示器双C数据线","鼠标","鼠标","鼠标键盘","Adapter","外置硬盘","keyboard","笔记本充电器","鼠标和键盘","Type-C扩展坞","65W笔记本电源","安卓手机数据线","笔记本电源","keyboard","鼠标和键盘","SanDisk-SDSSDE81-4T00-Z25"]
|
|
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.15 → itam_assistant-0.1.17}/itam_assistant.egg-info/dependency_links.txt
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|