beswarm 0.1.67__py3-none-any.whl → 0.1.69__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/plugins/excute_command.py +7 -7
- beswarm/tools/edit_file.py +15 -11
- beswarm/tools/worker.py +4 -0
- {beswarm-0.1.67.dist-info → beswarm-0.1.69.dist-info}/METADATA +1 -1
- {beswarm-0.1.67.dist-info → beswarm-0.1.69.dist-info}/RECORD +8 -8
- {beswarm-0.1.67.dist-info → beswarm-0.1.69.dist-info}/WHEEL +0 -0
- {beswarm-0.1.67.dist-info → beswarm-0.1.69.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.21",
|
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",
|
@@ -178,13 +178,13 @@ def excute_command(command):
|
|
178
178
|
if line.strip() == "":
|
179
179
|
continue
|
180
180
|
# aaa = last_line.strip()
|
181
|
-
is_same = compare_line(repr(line.strip()))
|
182
|
-
if not is_same:
|
183
|
-
|
184
|
-
|
185
|
-
|
186
|
-
|
187
|
-
|
181
|
+
# is_same = compare_line(repr(line.strip()))
|
182
|
+
# if not is_same:
|
183
|
+
# # print(f"{repr(aaa)}", flush=True)
|
184
|
+
# # print(f"{repr(line.strip())}", flush=True)
|
185
|
+
# # print(f"is_same: {is_same}", flush=True)
|
186
|
+
# # print(f"\n\n\n", flush=True)
|
187
|
+
new_output_lines.append(line)
|
188
188
|
# 限制输出行数
|
189
189
|
if len(new_output_lines) > 500:
|
190
190
|
new_output_lines = new_output_lines[:250] + new_output_lines[-250:]
|
beswarm/tools/edit_file.py
CHANGED
@@ -5,23 +5,27 @@ from ..aient.src.aient.plugins import register_tool
|
|
5
5
|
@register_tool()
|
6
6
|
def edit_file(file_path, diff_content, match_precision=0.8):
|
7
7
|
"""
|
8
|
-
使用diff
|
9
|
-
你应该清楚地表明编辑内容,同时最小化你写的未更改代码。
|
10
|
-
你仍应倾向于尽可能少地重复原始文件的行来传达更改。
|
11
|
-
但是,编辑应包含足够的未更改行上下文,以消除你正在编辑的代码的歧义。
|
8
|
+
使用diff模式编辑代码文件。**重要:此函数每次调用只能对文件进行一处修改。**
|
12
9
|
|
13
|
-
|
14
|
-
file_path: 要编辑的文件路径
|
15
|
-
diff_content: diff内容,格式为:
|
10
|
+
你需要提供一个diff块来指定要修改的内容,格式如下:
|
16
11
|
<<<<<<< SEARCH
|
17
|
-
|
12
|
+
要被替换的原始代码
|
18
13
|
=======
|
19
|
-
|
14
|
+
新的代码
|
20
15
|
>>>>>>> REPLACE
|
21
|
-
|
16
|
+
|
17
|
+
**使用规则:**
|
18
|
+
1. **单次修改:** `diff_content`参数中**必须只包含一个** `<<<<<<< SEARCH ... >>>>>>> REPLACE` 块。如果检测到多个块,函数将返回错误。
|
19
|
+
2. **上下文:** `SEARCH`块中的原始代码应包含足够的上下文,以确保在文件中能够唯一地定位到修改点,但也要尽量简洁。
|
20
|
+
3. **精确性:** `SEARCH`块中的内容需要与文件中的代码精确匹配(包括缩进和换行符)。如果无法精确匹配,函数会尝试模糊匹配。
|
21
|
+
|
22
|
+
参数:
|
23
|
+
file_path: 要编辑的文件路径。
|
24
|
+
diff_content: 包含单次修改信息的diff字符串,格式必须符合上述要求。
|
25
|
+
match_precision: 匹配精度 (0.0-1.0),值越高要求匹配越精确,默认0.8。当完全精确匹配失败时,此参数生效。
|
22
26
|
|
23
27
|
返回:
|
24
|
-
|
28
|
+
编辑结果的状态信息,包括成功或错误信息。
|
25
29
|
"""
|
26
30
|
try:
|
27
31
|
# 检查文件是否存在
|
beswarm/tools/worker.py
CHANGED
@@ -113,6 +113,8 @@ async def worker(goal, tools, work_dir, cache_messages=None):
|
|
113
113
|
raise Exception(f"Model: {instruction_agent_config['engine']} not found!")
|
114
114
|
if "'status_code': 413" in next_instruction:
|
115
115
|
raise Exception(f"The request body is too long, please try again.")
|
116
|
+
if "任务已完成" == next_instruction.strip():
|
117
|
+
break
|
116
118
|
next_instruction = extract_xml_content(next_instruction, "instructions")
|
117
119
|
if not next_instruction:
|
118
120
|
print("\n❌ 指令智能体生成的指令不符合要求,请重新生成。")
|
@@ -237,6 +239,8 @@ async def worker_gen(goal, tools, work_dir, cache_messages=None):
|
|
237
239
|
raise Exception(f"Model: {instruction_agent_config['engine']} not found!")
|
238
240
|
if "'status_code': 413" in next_instruction:
|
239
241
|
raise Exception(f"The request body is too long, please try again.")
|
242
|
+
if "任务已完成" == next_instruction.strip():
|
243
|
+
break
|
240
244
|
next_instruction = extract_xml_content(next_instruction, "instructions")
|
241
245
|
if not next_instruction:
|
242
246
|
print("\n❌ 指令智能体生成的指令不符合要求,请重新生成。")
|
@@ -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=
|
4
|
+
beswarm/aient/setup.py,sha256=qAA0xNh-3PrTMh8w92_J3i6ezKq9SQjNdo-9zPVcxJk,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
|
@@ -25,7 +25,7 @@ beswarm/aient/src/aient/models/vertex.py,sha256=qVD5l1Q538xXUPulxG4nmDjXE1VoV4yu
|
|
25
25
|
beswarm/aient/src/aient/plugins/__init__.py,sha256=p3KO6Aa3Lupos4i2SjzLQw1hzQTigOAfEHngsldrsyk,986
|
26
26
|
beswarm/aient/src/aient/plugins/arXiv.py,sha256=yHjb6PS3GUWazpOYRMKMzghKJlxnZ5TX8z9F6UtUVow,1461
|
27
27
|
beswarm/aient/src/aient/plugins/config.py,sha256=Vp6CG9ocdC_FAlCMEGtKj45xamir76DFxdJVvURNtog,6539
|
28
|
-
beswarm/aient/src/aient/plugins/excute_command.py,sha256=
|
28
|
+
beswarm/aient/src/aient/plugins/excute_command.py,sha256=i5AUSfnYe05cS4YZuNIhuCy-Cfxil7RJG372YwzteXs,10691
|
29
29
|
beswarm/aient/src/aient/plugins/get_time.py,sha256=Ih5XIW5SDAIhrZ9W4Qe5Hs1k4ieKPUc_LAd6ySNyqZk,654
|
30
30
|
beswarm/aient/src/aient/plugins/image.py,sha256=ZElCIaZznE06TN9xW3DrSukS7U3A5_cjk1Jge4NzPxw,2072
|
31
31
|
beswarm/aient/src/aient/plugins/list_directory.py,sha256=JZVuImecMSfEv6jLqii-0uQJ1UCsrpMNmYlwW3PEDg4,1374
|
@@ -121,15 +121,15 @@ beswarm/queries/tree-sitter-languages/scala-tags.scm,sha256=UxQjz80JIrrJ7Pm56uUn
|
|
121
121
|
beswarm/queries/tree-sitter-languages/typescript-tags.scm,sha256=OMdCeedPiA24ky82DpgTMKXK_l2ySTuF2zrQ2fJAi9E,1253
|
122
122
|
beswarm/tools/__init__.py,sha256=IJExt6D58d2yxBOjHVC6wYGhV7Pb7okmX61RvyqSCSY,1150
|
123
123
|
beswarm/tools/click.py,sha256=TygaekCXTmU3fIu6Uom7ZcyzEgYMlCC_GX-5SmWHuLI,20762
|
124
|
-
beswarm/tools/edit_file.py,sha256=
|
124
|
+
beswarm/tools/edit_file.py,sha256=hxyVLiyndInX6hUeXwvX5u1mC3sq3cp8E-Q8UYy5Ffo,8145
|
125
125
|
beswarm/tools/planner.py,sha256=lguBCS6kpwNPoXQvqH-WySabVubT82iyWOkJnjt6dXw,1265
|
126
126
|
beswarm/tools/repomap.py,sha256=N09K0UgwjCN7Zjg_5TYlVsulp3n2fztYlS8twalChU8,45003
|
127
127
|
beswarm/tools/screenshot.py,sha256=u6t8FCgW5YHJ_Oc4coo8e0F3wTusWE_-H8dFh1rBq9Q,1011
|
128
128
|
beswarm/tools/search_arxiv.py,sha256=9slwBemXjEqrd7-YgVmyMijPXlkhZCybEDRVhWVQ9B0,7937
|
129
129
|
beswarm/tools/search_web.py,sha256=B24amOnGHnmdV_6S8bw8O2PdhZRRIDtJjg-wXcfP7dQ,11859
|
130
130
|
beswarm/tools/think.py,sha256=WLw-7jNIsnS6n8MMSYUin_f-BGLENFmnKM2LISEp0co,1760
|
131
|
-
beswarm/tools/worker.py,sha256=
|
132
|
-
beswarm-0.1.
|
133
|
-
beswarm-0.1.
|
134
|
-
beswarm-0.1.
|
135
|
-
beswarm-0.1.
|
131
|
+
beswarm/tools/worker.py,sha256=qu6Bchk1CmAudNzJSKLQGjInXNAWMOd_tkM6rDUh7qg,12847
|
132
|
+
beswarm-0.1.69.dist-info/METADATA,sha256=xp1354j2oPHjCj_rqqxp2IDJ1VGfXXLGNZk5NO2xotA,3553
|
133
|
+
beswarm-0.1.69.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
134
|
+
beswarm-0.1.69.dist-info/top_level.txt,sha256=pJw4O87wvt5882smuSO6DfByJz7FJ8SxxT8h9fHCmpo,8
|
135
|
+
beswarm-0.1.69.dist-info/RECORD,,
|
File without changes
|
File without changes
|