aient 1.0.32__py3-none-any.whl → 1.0.34__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.
aient/plugins/config.py CHANGED
@@ -3,19 +3,13 @@ import json
3
3
  import inspect
4
4
 
5
5
  from .registry import registry
6
- from ..utils.scripts import cut_message, safe_get
6
+ from ..utils.scripts import cut_message
7
7
  from ..utils.prompt import search_key_word_prompt, arxiv_doc_user_prompt
8
8
 
9
9
  async def get_tools_result_async(function_call_name, function_full_response, function_call_max_tokens, engine, robot, api_key, api_url, use_plugins, model, add_message, convo_id, language):
10
10
  function_response = ""
11
11
  if function_call_name in registry.tools:
12
12
  function_to_call = registry.tools[function_call_name]
13
- function_args = registry.tools_info[function_call_name].args
14
- # required_args = registry.tools_info[function_call_name].required
15
- if function_args:
16
- arg = function_args[0]
17
- else:
18
- arg = None
19
13
  if function_call_name == "get_search_results":
20
14
  prompt = json.loads(function_full_response)["query"]
21
15
  yield "message_search_stage_1"
@@ -47,18 +41,12 @@ async def get_tools_result_async(function_call_name, function_full_response, fun
47
41
  function_response = "无法找到相关信息,停止使用 tools"
48
42
  # user_prompt = f"You need to response the following question: {prompt}. Search results is provided inside <Search_results></Search_results> XML tags. Your task is to think about the question step by step and then answer the above question in {config.language} based on the Search results provided. Please response in {config.language} and adopt a style that is logical, in-depth, and detailed. Note: In order to make the answer appear highly professional, you should be an expert in textual analysis, aiming to make the answer precise and comprehensive. Directly response markdown format, without using markdown code blocks"
49
43
  # self.add_to_conversation(user_prompt, "user", convo_id=convo_id)
50
- elif arg: # generate_image get_url_content run_python_script
51
- prompt = safe_get(json.loads(function_full_response), arg, default=".")
52
- if inspect.iscoroutinefunction(function_to_call):
53
- function_response = await function_to_call(prompt)
54
- else:
55
- function_response = function_to_call(prompt)
56
- function_response, text_len = cut_message(function_response, function_call_max_tokens, engine)
57
- else: # get_date_time_weekday
44
+ else:
45
+ prompt = json.loads(function_full_response)
58
46
  if inspect.iscoroutinefunction(function_to_call):
59
- function_response = await function_to_call()
47
+ function_response = await function_to_call(**prompt)
60
48
  else:
61
- function_response = function_to_call()
49
+ function_response = function_to_call(**prompt)
62
50
  function_response, text_len = cut_message(function_response, function_call_max_tokens, engine)
63
51
 
64
52
  if function_call_name == "download_read_arxiv_pdf":
@@ -49,10 +49,10 @@ def url_to_markdown(url):
49
49
  body = Cleaner(javascript=True, style=True).clean_html(body)
50
50
  return ''.join(lxml.html.tostring(c, encoding='unicode') for c in body)
51
51
  except Exception as e:
52
- print('\033[31m')
53
- print("error: url_to_markdown url", url)
54
- print("error", e)
55
- print('\033[0m')
52
+ # print('\033[31m')
53
+ # print("error: url_to_markdown url", url)
54
+ # print("error", e)
55
+ # print('\033[0m')
56
56
  return "抱歉,目前无法访问该网页。"
57
57
 
58
58
  # 将HTML转换为Markdown
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: aient
3
- Version: 1.0.32
3
+ Version: 1.0.34
4
4
  Summary: Aient: The Awakening of Agent.
5
5
  Description-Content-Type: text/markdown
6
6
  License-File: LICENSE
@@ -20,17 +20,17 @@ aient/models/groq.py,sha256=2JCB0QE1htOprJHI5fZ11R2RtOhsHlsTjbmFyzc8oSM,10084
20
20
  aient/models/vertex.py,sha256=qVD5l1Q538xXUPulxG4nmDjXE1VoV4yuAkTCpIeJVw0,16795
21
21
  aient/plugins/__init__.py,sha256=KrCM6kFD1NB96hfhwUZIG8vJcdZVnfpACMew5YOWxSo,956
22
22
  aient/plugins/arXiv.py,sha256=yHjb6PS3GUWazpOYRMKMzghKJlxnZ5TX8z9F6UtUVow,1461
23
- aient/plugins/config.py,sha256=S7UHlo5e-czjssSyDQXVbR9bUlB21Fj934OfOKW5Vug,8191
23
+ aient/plugins/config.py,sha256=J1x1newErZ44-IzUtm8gT9Rsx0SRrQxIY__p911dJZM,7543
24
24
  aient/plugins/image.py,sha256=ZElCIaZznE06TN9xW3DrSukS7U3A5_cjk1Jge4NzPxw,2072
25
25
  aient/plugins/registry.py,sha256=YknzhieU_8nQ3oKlUSSWDB4X7t2Jx0JnqT2Jd9Xsvfk,3574
26
26
  aient/plugins/run_python.py,sha256=dgcUwBunMuDkaSKR5bToudVzSdrXVewktDDFUz_iIOQ,4589
27
27
  aient/plugins/today.py,sha256=btnXJNqWorJDKPvH9PBTdHaExpVI1YPuSAeRrq-fg9A,667
28
- aient/plugins/websearch.py,sha256=k23xymhf3xxdc3hc0_0FFZTI9OaThCYM6csYsygCHs8,15177
28
+ aient/plugins/websearch.py,sha256=yiBzqXK5X220ibR-zko3VDsn4QOnLu1k6E2YOygCeTQ,15185
29
29
  aient/utils/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
30
30
  aient/utils/prompt.py,sha256=UcSzKkFE4-h_1b6NofI6xgk3GoleqALRKY8VBaXLjmI,11311
31
31
  aient/utils/scripts.py,sha256=O-0IXN3mezPauFs6fw83WDDgklpXTDvcbJBNTDrsIG0,8201
32
- aient-1.0.32.dist-info/licenses/LICENSE,sha256=XNdbcWldt0yaNXXWB_Bakoqnxb3OVhUft4MgMA_71ds,1051
33
- aient-1.0.32.dist-info/METADATA,sha256=l2oZ7hWojO3bq4hWyjpxkxVvhuWAZAqiYwHdj5y0Dd0,4986
34
- aient-1.0.32.dist-info/WHEEL,sha256=1tXe9gY0PYatrMPMDd6jXqjfpz_B-Wqm32CPfRC58XU,91
35
- aient-1.0.32.dist-info/top_level.txt,sha256=3oXzrP5sAVvyyqabpeq8A2_vfMtY554r4bVE-OHBrZk,6
36
- aient-1.0.32.dist-info/RECORD,,
32
+ aient-1.0.34.dist-info/licenses/LICENSE,sha256=XNdbcWldt0yaNXXWB_Bakoqnxb3OVhUft4MgMA_71ds,1051
33
+ aient-1.0.34.dist-info/METADATA,sha256=lmRxPK3h4FqU1crAZW6BOpAqMNUx2zbr52_yPZ9J_6k,4986
34
+ aient-1.0.34.dist-info/WHEEL,sha256=1tXe9gY0PYatrMPMDd6jXqjfpz_B-Wqm32CPfRC58XU,91
35
+ aient-1.0.34.dist-info/top_level.txt,sha256=3oXzrP5sAVvyyqabpeq8A2_vfMtY554r4bVE-OHBrZk,6
36
+ aient-1.0.34.dist-info/RECORD,,
File without changes