beswarm 0.1.14__py3-none-any.whl → 0.1.16__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.0.74",
7
+ version="1.0.76",
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",
@@ -300,7 +300,7 @@ async def get_vertex_gemini_payload(request, engine, provider, api_key=None):
300
300
  original_model = model_dict[request.model]
301
301
  search_tool = None
302
302
 
303
- pro_models = ["gemini-2.5-pro", "gemini-2.0-pro", "gemini-exp"]
303
+ pro_models = ["gemini-2.5", "gemini-2.0", "gemini-exp"]
304
304
  if any(pro_model in original_model for pro_model in pro_models):
305
305
  location = gemini2
306
306
  search_tool = {"googleSearch": {}}
@@ -946,6 +946,7 @@ async def get_gpt_payload(request, engine, provider, api_key=None):
946
946
 
947
947
  if "api.x.ai" in url:
948
948
  payload.pop("stream_options", None)
949
+ payload.pop("presencePenalty", None)
949
950
 
950
951
  if "grok-3-mini" in original_model:
951
952
  if request.model.endswith("high"):
@@ -62,7 +62,8 @@ When making code changes, NEVER output code to the USER, unless requested. Inste
62
62
  </calling_external_apis>
63
63
 
64
64
  <user_info>
65
- The user's OS version is {os_name} {os_version}. The absolute path of the user's workspace is {workspace_path} which is also the project root directory. 请在指令中使用绝对路径。所有操作必须基于工作目录。禁止在工作目录之外进行任何操作。禁止默认你当前就在工作目录。The user's shell is {shell}.
65
+ The user's OS version is {os_version}. The absolute path of the user's workspace is {workspace_path} which is also the project root directory. The user's shell is {shell}.
66
+ 请在指令中使用绝对路径。所有操作必须基于工作目录。禁止在工作目录之外进行任何操作。你当前运行目录不一定就是工作目录。禁止默认你当前就在工作目录。
66
67
  </user_info>
67
68
 
68
69
  <instructions for tool use>
@@ -118,7 +119,6 @@ You can use tools as follows:
118
119
  """
119
120
 
120
121
  instruction_system_prompt = """
121
-
122
122
  你是一个指令生成器,负责指导另一个智能体完成任务。
123
123
  你需要分析工作智能体的对话历史,并生成下一步指令。
124
124
  根据任务目标和当前进度,提供清晰明确的指令。
@@ -127,8 +127,9 @@ instruction_system_prompt = """
127
127
 
128
128
  你需要称呼工作智能体为“你”,指令禁止使用疑问句,必须使用祈使句。
129
129
  所有回复必须使用中文。
130
- 你的工作目录为:{workspace_path},请在指令中使用绝对路径。所有操作必须基于工作目录。禁止在工作目录之外进行任何操作。禁止默认你当前就在工作目录。
131
-
130
+ 运行工作智能体的系统信息:{os_version}
131
+ 你的工作目录为:{workspace_path},请在指令中使用绝对路径。所有操作必须基于工作目录。
132
+ 禁止在工作目录之外进行任何操作。你当前运行目录不一定就是工作目录。禁止默认你当前就在工作目录。
132
133
 
133
134
  你的输出必须符合以下步骤:
134
135
 
beswarm/tools/repomap.py CHANGED
@@ -1286,4 +1286,7 @@ if __name__ == "__main__":
1286
1286
 
1287
1287
  # print(get_code_repo_map("."))
1288
1288
  # print(get_code_repo_map("/Users/yanyuming/Downloads/GitHub/uni-api"))
1289
- print(get_code_repo_map("/Users/yanyuming/Downloads/GitHub/text-to-motion"))
1289
+ # print(get_code_repo_map("/Users/yanyuming/Downloads/GitHub/text-to-motion"))
1290
+ print(get_code_repo_map("/Users/yanyuming/Downloads/GitHub/beswarm/work/secretary/secretary"))
1291
+
1292
+ # python -m beswarm.tools.repomap
beswarm/tools/worker.py CHANGED
@@ -1,5 +1,6 @@
1
1
  import os
2
2
  import copy
3
+ import platform
3
4
  from ..aient.src.aient.plugins import register_tool
4
5
 
5
6
  from ..aient.src.aient.models import chatgpt
@@ -28,8 +29,7 @@ async def worker(goal, tools, work_dir, cache_messages=None):
28
29
 
29
30
  tools_json = [value for _, value in get_function_call_list(tools).items()]
30
31
  work_agent_system_prompt = system_prompt.format(
31
- os_name=os.name,
32
- os_version=os.uname().version,
32
+ os_version=platform.platform(),
33
33
  workspace_path=work_dir,
34
34
  shell=os.getenv('SHELL', 'Unknown'),
35
35
  tools_list=tools_json
@@ -52,7 +52,7 @@ async def worker(goal, tools, work_dir, cache_messages=None):
52
52
  "api_key": os.getenv("API_KEY"),
53
53
  "api_url": os.getenv("BASE_URL"),
54
54
  "engine": os.getenv("MODEL"),
55
- "system_prompt": instruction_system_prompt.format(tools_list=tools_json, workspace_path=work_dir),
55
+ "system_prompt": instruction_system_prompt.format(os_version=platform.platform(), tools_list=tools_json, workspace_path=work_dir),
56
56
  "print_log": False,
57
57
  # "max_tokens": 4000,
58
58
  "temperature": 0.7,
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: beswarm
3
- Version: 0.1.14
3
+ Version: 0.1.16
4
4
  Summary: MAS
5
5
  Requires-Python: >=3.11
6
6
  Description-Content-Type: text/markdown
@@ -68,3 +68,36 @@ cd ~/Downloads/GitHub/beswarm && docker run --rm \
68
68
  -v ./work:/app/work beswarm \
69
69
  --goal "分析这个仓库 https://github.com/cloneofsimo/minRF"
70
70
  ```
71
+
72
+ main.py
73
+
74
+ ```python
75
+ import os
76
+ import asyncio
77
+ import nest_asyncio
78
+ nest_asyncio.apply()
79
+
80
+ from beswarm.tools import (
81
+ worker,
82
+ get_code_repo_map,
83
+ search_arxiv,
84
+ read_file,
85
+ list_directory,
86
+ excute_command,
87
+ write_to_file,
88
+ download_read_arxiv_pdf,
89
+ )
90
+
91
+ os.environ['API_KEY'] = ''
92
+ os.environ['BASE_URL'] = 'https://api.xxx.xyz/v1/chat/completions'
93
+ os.environ['MODEL'] = 'gemini-2.5-pro'
94
+
95
+ # 设定任务目标
96
+ goal = """
97
+
98
+ """
99
+ work_dir = '/home/ray/default'
100
+
101
+ tools = [read_file, list_directory, write_to_file, excute_command, search_arxiv, download_read_arxiv_pdf, get_code_repo_map]
102
+ asyncio.run(worker(goal, tools, work_dir))
103
+ ```
@@ -1,12 +1,12 @@
1
1
  beswarm/__init__.py,sha256=HZjUOJtZR5QhMuDbq-wukQQn1VrBusNWai_ysGo-VVI,20
2
2
  beswarm/utils.py,sha256=AdDCcqAIIKQEMl7PfryVgeT9G5sHe7QNsZnrvmTGA8E,283
3
3
  beswarm/aient/main.py,sha256=SiYAIgQlLJqYusnTVEJOx1WNkSJKMImhgn5aWjfroxg,3814
4
- beswarm/aient/setup.py,sha256=2ZLf8IjbEEYKStTnjsKCdVu7Iv4PbDBL9HHYxRRkuL0,487
4
+ beswarm/aient/setup.py,sha256=UOCyTbJunqBeBMa1Dma79K6Dk24vR0bELQSz3IhTA4g,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
8
8
  beswarm/aient/src/aient/core/models.py,sha256=_1wYZg_n9kb2A3C8xCboyqleH2iHc9scwOvtx9DPeok,7582
9
- beswarm/aient/src/aient/core/request.py,sha256=84GysWqkt5PNTYQ4VLK1z2GK66WIFs-691oHgHDBH1A,60773
9
+ beswarm/aient/src/aient/core/request.py,sha256=PF3hBBzl5RZTda2bAT_Vlp7DiXFhYMzk2Egp7irKVPk,60810
10
10
  beswarm/aient/src/aient/core/response.py,sha256=CSAOQmybBu3i2Yq2YUyi91dZWTN1tmtJEBTI8RFwj_s,30594
11
11
  beswarm/aient/src/aient/core/utils.py,sha256=R4oKj1oVsdfePdQReaW-ZU4VRTCetvdCKPz_OOTOU_w,26072
12
12
  beswarm/aient/src/aient/core/test/test_base_api.py,sha256=pWnycRJbuPSXKKU9AQjWrMAX1wiLC_014Qc9hh5C2Pw,524
@@ -34,7 +34,7 @@ beswarm/aient/src/aient/plugins/run_python.py,sha256=dgcUwBunMuDkaSKR5bToudVzSdr
34
34
  beswarm/aient/src/aient/plugins/websearch.py,sha256=yiBzqXK5X220ibR-zko3VDsn4QOnLu1k6E2YOygCeTQ,15185
35
35
  beswarm/aient/src/aient/plugins/write_file.py,sha256=qYbNvcDTGs00pWYb0UOSYSeN4kw5_DMDxjaSlxtlAkU,1732
36
36
  beswarm/aient/src/aient/prompt/__init__.py,sha256=GBtn6-JDT8KHFCcuPpfSNE_aGddg5p4FEyMCy4BfwGs,20
37
- beswarm/aient/src/aient/prompt/agent.py,sha256=ssZREegzmkWNW20dxzGO92J8Y5v7yjRTR9znTPDjo5Q,23681
37
+ beswarm/aient/src/aient/prompt/agent.py,sha256=WLs0KiNZs29FJ5w7N3kQZYLVEeS7K8vxIOUw06LcXVE,23825
38
38
  beswarm/aient/src/aient/utils/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
39
39
  beswarm/aient/src/aient/utils/prompt.py,sha256=UcSzKkFE4-h_1b6NofI6xgk3GoleqALRKY8VBaXLjmI,11311
40
40
  beswarm/aient/src/aient/utils/scripts.py,sha256=n0jR5eXCBIK12W4bIx-xU1FVl1hZ4zDC7hq_BWQHYJU,27537
@@ -121,11 +121,11 @@ beswarm/queries/tree-sitter-languages/typescript-tags.scm,sha256=OMdCeedPiA24ky8
121
121
  beswarm/tools/__init__.py,sha256=1QLRX95kJSdCKW8OvAJCg67qlzsU9juU60ciZvUGq00,761
122
122
  beswarm/tools/edit_file.py,sha256=qKOVanfh_79eavRrqqyFirRo07sZ897jUL2PD4GRKJk,6965
123
123
  beswarm/tools/planner.py,sha256=lguBCS6kpwNPoXQvqH-WySabVubT82iyWOkJnjt6dXw,1265
124
- beswarm/tools/repomap.py,sha256=DhZewVr3fsjau3S9uCpx723uFliteb-QvSpeArDgnU8,40692
124
+ beswarm/tools/repomap.py,sha256=CwvwoN5Swr42EzrORTTeV8MMb7mPviy4a4b0fxBu50k,40828
125
125
  beswarm/tools/search_arxiv.py,sha256=9slwBemXjEqrd7-YgVmyMijPXlkhZCybEDRVhWVQ9B0,7937
126
126
  beswarm/tools/think.py,sha256=WLw-7jNIsnS6n8MMSYUin_f-BGLENFmnKM2LISEp0co,1760
127
- beswarm/tools/worker.py,sha256=kw9-7--IgS3B6PE0XJibO2BPc_-8jVCKb7fXRTJGVzA,5080
128
- beswarm-0.1.14.dist-info/METADATA,sha256=C6iU66_hclvt7ddbJiBoKX1XsU0nkIxtl3ZtNXWcVWU,2229
129
- beswarm-0.1.14.dist-info/WHEEL,sha256=SmOxYU7pzNKBqASvQJ7DjX3XGUF92lrGhMb3R6_iiqI,91
130
- beswarm-0.1.14.dist-info/top_level.txt,sha256=pJw4O87wvt5882smuSO6DfByJz7FJ8SxxT8h9fHCmpo,8
131
- beswarm-0.1.14.dist-info/RECORD,,
127
+ beswarm/tools/worker.py,sha256=3YnSyXaboNJ9j052NMLoIEOtxWL-uJ6sllonm7jV02E,5104
128
+ beswarm-0.1.16.dist-info/METADATA,sha256=u339_6M84jBXXi2CpKLbbP39swSB8s41LQJ9OsBxnZQ,2878
129
+ beswarm-0.1.16.dist-info/WHEEL,sha256=SmOxYU7pzNKBqASvQJ7DjX3XGUF92lrGhMb3R6_iiqI,91
130
+ beswarm-0.1.16.dist-info/top_level.txt,sha256=pJw4O87wvt5882smuSO6DfByJz7FJ8SxxT8h9fHCmpo,8
131
+ beswarm-0.1.16.dist-info/RECORD,,