beswarm 0.1.60__py3-none-any.whl → 0.1.62__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.
beswarm/aient/setup.py CHANGED
@@ -4,7 +4,7 @@ from setuptools import setup, find_packages
4
4
 
5
5
  setup(
6
6
  name="aient",
7
- version="1.1.15",
7
+ version="1.1.16",
8
8
  description="Aient: The Awakening of Agent.",
9
9
  long_description=Path.open(Path("README.md"), encoding="utf-8").read(),
10
10
  long_description_content_type="text/markdown",
@@ -44,6 +44,7 @@ system_prompt = """
44
44
  2. Always respond in 中文。
45
45
  3. 尽力满足user的请求,如果 user 要求你使用工具,请自行根据工具的参数要求,组织参数,将工具调用组织成xml格式,即可触发工具执行流程。如果user提供了明确的xml工具调用,请直接复述user的xml工具调用。你必须复述user的xml工具调用才能真正调用工具。
46
46
  4. 禁止要求user调用工具,当你需要调用工具时,请自行组织参数,将工具调用组织成xml格式,即可触发工具执行流程。禁止自己没有使用xml格式调用工具就假定工具已经调用。
47
+ 5. 仔细阅读并理解 user 的任务描述和当前指令。user 会根据任务描述分步骤让你执行,因此请严格遵循 user 指令按步骤操作,并请勿自行完成 user 未指定的步骤。在 user 明确给出下一步指令前,绝不擅自行动或推测、执行任何未明确要求的后续步骤。完成当前 user 指定的步骤后,必须主动向 user 汇报该步骤的完成情况,并明确请求 user 提供下一步的操作指令。
47
48
  </communication>
48
49
 
49
50
  <making_code_changes>
beswarm/tools/worker.py CHANGED
@@ -1,4 +1,5 @@
1
1
  import os
2
+ import re
2
3
  import copy
3
4
  import json
4
5
  import platform
@@ -82,7 +83,25 @@ async def worker(goal, tools, work_dir, cache_messages=None):
82
83
  with open(cache_file, "w", encoding="utf-8") as f:
83
84
  f.write(json.dumps(conversation_history, ensure_ascii=False, indent=4))
84
85
 
85
- conversation_history.pop(0)
86
+ work_agent_system_prompt = conversation_history.pop(0)
87
+ if conversation_history:
88
+ # 获取原始内容
89
+ original_content = work_agent_system_prompt["content"]
90
+
91
+ # 定义正则表达式
92
+ regex = r"<latest_file_content>(.*?)</latest_file_content>"
93
+
94
+ # 进行匹配
95
+ match = re.search(regex, original_content, re.DOTALL)
96
+
97
+ # 提取内容或设置为空字符串
98
+ if match:
99
+ extracted_content = f"<latest_file_content>{match.group(1)}</latest_file_content>\n\n"
100
+ else:
101
+ extracted_content = ""
102
+
103
+ conversation_history[0]["content"] = extracted_content + conversation_history[0]["content"]
104
+
86
105
  instruction_agent.conversation["default"][1:] = conversation_history
87
106
  if "find_and_click_element" in str(tools_json):
88
107
  instruction_prompt = await get_current_screen_image_message(instruction_prompt)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: beswarm
3
- Version: 0.1.60
3
+ Version: 0.1.62
4
4
  Summary: MAS
5
5
  Requires-Python: >=3.11
6
6
  Description-Content-Type: text/markdown
@@ -1,7 +1,7 @@
1
1
  beswarm/__init__.py,sha256=HZjUOJtZR5QhMuDbq-wukQQn1VrBusNWai_ysGo-VVI,20
2
2
  beswarm/utils.py,sha256=Z2Kuus2BLp9EHUC2ZNL9iUsb6NWnPj-MTA7SYzGyg24,1755
3
3
  beswarm/aient/main.py,sha256=SiYAIgQlLJqYusnTVEJOx1WNkSJKMImhgn5aWjfroxg,3814
4
- beswarm/aient/setup.py,sha256=A2q_i7Phzeh-ii_T_-TOguYtW3tJuV8qY-V5WowGCrk,487
4
+ beswarm/aient/setup.py,sha256=Sd2NPcQ4WHx-F_jSx8hMYbLMTtRxIo6a-wxcEkruwW0,487
5
5
  beswarm/aient/src/aient/__init__.py,sha256=SRfF7oDVlOOAi6nGKiJIUK6B_arqYLO9iSMp-2IZZps,21
6
6
  beswarm/aient/src/aient/core/__init__.py,sha256=NxjebTlku35S4Dzr16rdSqSTWUvvwEeACe8KvHJnjPg,34
7
7
  beswarm/aient/src/aient/core/log_config.py,sha256=kz2_yJv1p-o3lUQOwA3qh-LSc3wMHv13iCQclw44W9c,274
@@ -36,7 +36,7 @@ beswarm/aient/src/aient/plugins/run_python.py,sha256=dgcUwBunMuDkaSKR5bToudVzSdr
36
36
  beswarm/aient/src/aient/plugins/websearch.py,sha256=llxy1U0vJiNMiKvamMr4p7IruLb3nnDR4YErz8TYimc,15215
37
37
  beswarm/aient/src/aient/plugins/write_file.py,sha256=YRvQKMvV-5lwohxlvwt9hjfxz2dRJP85AJWAMUIqbBY,3804
38
38
  beswarm/aient/src/aient/prompt/__init__.py,sha256=GBtn6-JDT8KHFCcuPpfSNE_aGddg5p4FEyMCy4BfwGs,20
39
- beswarm/aient/src/aient/prompt/agent.py,sha256=y2GETN6ScC5yQVs75VFfzm4YUWzblbqLYz0Sy6JnPRw,24950
39
+ beswarm/aient/src/aient/prompt/agent.py,sha256=ZNsbgXRyvYzAFTRRziAnNVqcTyAnxrGcsGfGrt72j6k,25427
40
40
  beswarm/aient/src/aient/utils/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
41
41
  beswarm/aient/src/aient/utils/prompt.py,sha256=UcSzKkFE4-h_1b6NofI6xgk3GoleqALRKY8VBaXLjmI,11311
42
42
  beswarm/aient/src/aient/utils/scripts.py,sha256=LD8adnfuRrJoY2tWKseXOPJXaxbrUmz4czsnUvHswNY,29096
@@ -127,8 +127,8 @@ beswarm/tools/repomap.py,sha256=N09K0UgwjCN7Zjg_5TYlVsulp3n2fztYlS8twalChU8,4500
127
127
  beswarm/tools/search_arxiv.py,sha256=9slwBemXjEqrd7-YgVmyMijPXlkhZCybEDRVhWVQ9B0,7937
128
128
  beswarm/tools/search_web.py,sha256=B24amOnGHnmdV_6S8bw8O2PdhZRRIDtJjg-wXcfP7dQ,11859
129
129
  beswarm/tools/think.py,sha256=WLw-7jNIsnS6n8MMSYUin_f-BGLENFmnKM2LISEp0co,1760
130
- beswarm/tools/worker.py,sha256=2EOag_yo8qC020jx32tcU9G_gzT3PeYasukLwuuOAJQ,5976
131
- beswarm-0.1.60.dist-info/METADATA,sha256=H7moorce2OKfYVPmPizKxYp00P6vy4MH_uYyteAP0UE,3553
132
- beswarm-0.1.60.dist-info/WHEEL,sha256=zaaOINJESkSfm_4HQVc5ssNzHCPXhJm0kEUakpsEHaU,91
133
- beswarm-0.1.60.dist-info/top_level.txt,sha256=pJw4O87wvt5882smuSO6DfByJz7FJ8SxxT8h9fHCmpo,8
134
- beswarm-0.1.60.dist-info/RECORD,,
130
+ beswarm/tools/worker.py,sha256=6tg2973BZkr85W73RWcTQ7cGub2sIRxHgluriorVBNc,6741
131
+ beswarm-0.1.62.dist-info/METADATA,sha256=RzS5f38zi_lsfKumv6AqZARc0atpVl0OV_5g4hQ1AkE,3553
132
+ beswarm-0.1.62.dist-info/WHEEL,sha256=zaaOINJESkSfm_4HQVc5ssNzHCPXhJm0kEUakpsEHaU,91
133
+ beswarm-0.1.62.dist-info/top_level.txt,sha256=pJw4O87wvt5882smuSO6DfByJz7FJ8SxxT8h9fHCmpo,8
134
+ beswarm-0.1.62.dist-info/RECORD,,