beswarm 0.2.8__py3-none-any.whl → 0.2.10__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 +1 -1
- beswarm/aient/src/aient/core/request.py +10 -6
- beswarm/tools/worker.py +18 -6
- {beswarm-0.2.8.dist-info → beswarm-0.2.10.dist-info}/METADATA +1 -1
- {beswarm-0.2.8.dist-info → beswarm-0.2.10.dist-info}/RECORD +7 -7
- {beswarm-0.2.8.dist-info → beswarm-0.2.10.dist-info}/WHEEL +0 -0
- {beswarm-0.2.8.dist-info → beswarm-0.2.10.dist-info}/top_level.txt +0 -0
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.
|
7
|
+
version="1.1.42",
|
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",
|
@@ -239,15 +239,17 @@ async def get_gemini_payload(request, engine, provider, api_key=None):
|
|
239
239
|
if m:
|
240
240
|
try:
|
241
241
|
val = int(m.group(1))
|
242
|
-
if val
|
243
|
-
val = 0
|
244
|
-
elif val > 32768 and "gemini-2.5-pro" in original_model:
|
242
|
+
if val > 32768 and "gemini-2.5-pro" in original_model:
|
245
243
|
val = 32768
|
246
244
|
elif val < 128 and "gemini-2.5-pro" in original_model:
|
247
245
|
val = 128
|
246
|
+
elif val <= 0:
|
247
|
+
val = 0
|
248
248
|
elif val > 24576:
|
249
249
|
val = 24576
|
250
250
|
payload["generationConfig"]["thinkingConfig"]["thinkingBudget"] = val
|
251
|
+
if val == 0:
|
252
|
+
payload["generationConfig"].pop("thinkingConfig", None)
|
251
253
|
except ValueError:
|
252
254
|
# 如果转换为整数失败,忽略思考预算设置
|
253
255
|
pass
|
@@ -535,15 +537,17 @@ async def get_vertex_gemini_payload(request, engine, provider, api_key=None):
|
|
535
537
|
if m:
|
536
538
|
try:
|
537
539
|
val = int(m.group(1))
|
538
|
-
if val
|
539
|
-
val = 0
|
540
|
-
elif val > 32768 and "gemini-2.5-pro" in original_model:
|
540
|
+
if val > 32768 and "gemini-2.5-pro" in original_model:
|
541
541
|
val = 32768
|
542
542
|
elif val < 128 and "gemini-2.5-pro" in original_model:
|
543
543
|
val = 128
|
544
|
+
elif val <= 0:
|
545
|
+
val = 0
|
544
546
|
elif val > 24576:
|
545
547
|
val = 24576
|
546
548
|
payload["generationConfig"]["thinkingConfig"]["thinkingBudget"] = val
|
549
|
+
if val == 0:
|
550
|
+
payload["generationConfig"].pop("thinkingConfig", None)
|
547
551
|
except ValueError:
|
548
552
|
# 如果转换为整数失败,忽略思考预算设置
|
549
553
|
pass
|
beswarm/tools/worker.py
CHANGED
@@ -15,6 +15,8 @@ from ..bemcp.bemcp import MCPClient, convert_tool_format, MCPManager
|
|
15
15
|
|
16
16
|
manager = MCPManager()
|
17
17
|
|
18
|
+
DEBUG = os.getenv("DEBUG", "false").lower() in ("true", "1", "t", "yes")
|
19
|
+
|
18
20
|
@register_tool()
|
19
21
|
async def worker(goal, tools, work_dir, cache_messages=None):
|
20
22
|
"""
|
@@ -32,6 +34,13 @@ async def worker(goal, tools, work_dir, cache_messages=None):
|
|
32
34
|
Returns:
|
33
35
|
str: 当任务成功完成时,返回字符串 "任务已完成"。
|
34
36
|
"""
|
37
|
+
if DEBUG:
|
38
|
+
import sys
|
39
|
+
log_file = open(Path(work_dir) / ".beswarm" / "history.log", "a")
|
40
|
+
log_file.write(f"========== {datetime.now().strftime('%Y-%m-%d %H:%M:%S')} ==========\n")
|
41
|
+
sys.stdout = log_file
|
42
|
+
sys.stderr = log_file
|
43
|
+
|
35
44
|
start_time = datetime.now()
|
36
45
|
os.chdir(Path(work_dir).absolute())
|
37
46
|
finish_flag = 0
|
@@ -93,7 +102,7 @@ async def worker(goal, tools, work_dir, cache_messages=None):
|
|
93
102
|
"api_url": os.getenv("BASE_URL"),
|
94
103
|
"engine": os.getenv("MODEL"),
|
95
104
|
"system_prompt": instruction_system_prompt.format(os_version=platform.platform(), tools_list=tools_json, workspace_path=work_dir, current_time=datetime.now().strftime("%Y-%m-%d %H:%M:%S")),
|
96
|
-
"print_log":
|
105
|
+
"print_log": DEBUG,
|
97
106
|
# "max_tokens": 4000,
|
98
107
|
"temperature": 0.7,
|
99
108
|
"use_plugins": False,
|
@@ -164,8 +173,6 @@ async def worker(goal, tools, work_dir, cache_messages=None):
|
|
164
173
|
raise Exception(f"The request body is too long, please try again.")
|
165
174
|
if "任务已完成" == next_instruction.strip():
|
166
175
|
break
|
167
|
-
if "<instructions>" in next_instruction and "</instructions>" not in next_instruction:
|
168
|
-
next_instruction = next_instruction + "\n</instructions>"
|
169
176
|
last_instruction = next_instruction
|
170
177
|
next_instruction = extract_xml_content(next_instruction, "instructions")
|
171
178
|
if not next_instruction:
|
@@ -227,6 +234,13 @@ async def worker(goal, tools, work_dir, cache_messages=None):
|
|
227
234
|
return "任务已完成"
|
228
235
|
|
229
236
|
async def worker_gen(goal, tools, work_dir, cache_messages=None):
|
237
|
+
if DEBUG:
|
238
|
+
import sys
|
239
|
+
log_file = open(Path(work_dir) / ".beswarm" / "history.log", "a")
|
240
|
+
log_file.write(f"========== {datetime.now().strftime('%Y-%m-%d %H:%M:%S')} ==========\n")
|
241
|
+
sys.stdout = log_file
|
242
|
+
sys.stderr = log_file
|
243
|
+
|
230
244
|
start_time = datetime.now()
|
231
245
|
os.chdir(Path(work_dir).absolute())
|
232
246
|
finish_flag = 0
|
@@ -288,7 +302,7 @@ async def worker_gen(goal, tools, work_dir, cache_messages=None):
|
|
288
302
|
"api_url": os.getenv("BASE_URL"),
|
289
303
|
"engine": os.getenv("MODEL"),
|
290
304
|
"system_prompt": instruction_system_prompt.format(os_version=platform.platform(), tools_list=tools_json, workspace_path=work_dir, current_time=datetime.now().strftime("%Y-%m-%d %H:%M:%S")),
|
291
|
-
"print_log":
|
305
|
+
"print_log": DEBUG,
|
292
306
|
# "max_tokens": 4000,
|
293
307
|
"temperature": 0.7,
|
294
308
|
"use_plugins": False,
|
@@ -359,8 +373,6 @@ async def worker_gen(goal, tools, work_dir, cache_messages=None):
|
|
359
373
|
raise Exception(f"The request body is too long, please try again.")
|
360
374
|
if "任务已完成" == next_instruction.strip():
|
361
375
|
break
|
362
|
-
if "<instructions>" in next_instruction and "</instructions>" not in next_instruction:
|
363
|
-
next_instruction = next_instruction + "\n</instructions>"
|
364
376
|
last_instruction = next_instruction
|
365
377
|
next_instruction = extract_xml_content(next_instruction, "instructions")
|
366
378
|
if not next_instruction:
|
@@ -2,12 +2,12 @@ beswarm/__init__.py,sha256=HZjUOJtZR5QhMuDbq-wukQQn1VrBusNWai_ysGo-VVI,20
|
|
2
2
|
beswarm/prompt.py,sha256=_hYKZ0MUiMRs3C-1PMlFKIVgTKFcp_irla3p3wQNF3c,32015
|
3
3
|
beswarm/utils.py,sha256=xxbNifOPlfcVkKmF_qFzuEnZgF3MQg3mnOfz1EF0Qss,6697
|
4
4
|
beswarm/aient/main.py,sha256=SiYAIgQlLJqYusnTVEJOx1WNkSJKMImhgn5aWjfroxg,3814
|
5
|
-
beswarm/aient/setup.py,sha256=
|
5
|
+
beswarm/aient/setup.py,sha256=PO_a2y7aRPqyKvXJymiVfsJG0WjVV5HlFvFR3zPPiN8,487
|
6
6
|
beswarm/aient/src/aient/__init__.py,sha256=SRfF7oDVlOOAi6nGKiJIUK6B_arqYLO9iSMp-2IZZps,21
|
7
7
|
beswarm/aient/src/aient/core/__init__.py,sha256=NxjebTlku35S4Dzr16rdSqSTWUvvwEeACe8KvHJnjPg,34
|
8
8
|
beswarm/aient/src/aient/core/log_config.py,sha256=kz2_yJv1p-o3lUQOwA3qh-LSc3wMHv13iCQclw44W9c,274
|
9
9
|
beswarm/aient/src/aient/core/models.py,sha256=d4MISNezTSe0ls0-fjuToI2SoT-sk5fWqAJuKVinIlo,7502
|
10
|
-
beswarm/aient/src/aient/core/request.py,sha256=
|
10
|
+
beswarm/aient/src/aient/core/request.py,sha256=E2fujOgR8Jxl9kWVZcs7ylz9vftwIye3cbL6HgC-Gn4,71977
|
11
11
|
beswarm/aient/src/aient/core/response.py,sha256=mAVsCnNhWY09DXNe0lyPUJq-1ljtGjC67Az-Uh7ozIw,35166
|
12
12
|
beswarm/aient/src/aient/core/utils.py,sha256=NcXdb8zBN0GE01OGaUzg8U34RaraoFf2MaLDDGFvvC4,27492
|
13
13
|
beswarm/aient/src/aient/core/test/test_base_api.py,sha256=pWnycRJbuPSXKKU9AQjWrMAX1wiLC_014Qc9hh5C2Pw,524
|
@@ -133,8 +133,8 @@ beswarm/tools/repomap.py,sha256=YsTPq5MXfn_Ds5begcvHDnY_Xp2d4jH-xmWqNMHnNHY,4523
|
|
133
133
|
beswarm/tools/screenshot.py,sha256=u6t8FCgW5YHJ_Oc4coo8e0F3wTusWE_-H8dFh1rBq9Q,1011
|
134
134
|
beswarm/tools/search_arxiv.py,sha256=GpuIOYX8T0iRC-X-hmuR9AUJVn15WWZq864DaoC7BUc,8004
|
135
135
|
beswarm/tools/search_web.py,sha256=w0T0aCqOVlb6Of5hn_TtpnrGXo6bMtw2aKZdkrYjycI,12069
|
136
|
-
beswarm/tools/worker.py,sha256=
|
137
|
-
beswarm-0.2.
|
138
|
-
beswarm-0.2.
|
139
|
-
beswarm-0.2.
|
140
|
-
beswarm-0.2.
|
136
|
+
beswarm/tools/worker.py,sha256=iWhqema9bmn5dSDYqE1tKZ7HMCSZKYxUEklAQhc_Ow4,22919
|
137
|
+
beswarm-0.2.10.dist-info/METADATA,sha256=EjUnjz_W9CzDce_JCxVObIQJdln9MD46XbOFVFECP3c,3847
|
138
|
+
beswarm-0.2.10.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
139
|
+
beswarm-0.2.10.dist-info/top_level.txt,sha256=pJw4O87wvt5882smuSO6DfByJz7FJ8SxxT8h9fHCmpo,8
|
140
|
+
beswarm-0.2.10.dist-info/RECORD,,
|
File without changes
|
File without changes
|