beswarm 0.1.26__py3-none-any.whl → 0.1.28__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.85",
7
+ version="1.0.87",
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",
@@ -431,10 +431,13 @@ class chatgpt(BaseLLM):
431
431
 
432
432
  function_parameter = parse_function_xml(full_response)
433
433
  if function_parameter:
434
- for tool_dict in function_parameter:
435
- if tool_dict.get("function_name", "") not in self.plugins.keys():
436
- function_parameter.remove(tool_dict)
437
- full_response = full_response + f"\n\nFunction: {tool_dict.get('function_name', '')} does not exist! I must use existing functions. I need to try again."
434
+ function_parameter = [tool_dict for tool_dict in function_parameter if tool_dict.get("function_name", "") in self.plugins.keys()]
435
+ invalid_tools = [tool_dict for tool_dict in function_parameter if tool_dict.get("function_name", "") not in self.plugins.keys()]
436
+ for tool_dict in invalid_tools:
437
+ full_response = full_response + f"\n\nFunction: {tool_dict.get('function_name', '')} does not exist! I must use existing functions. I need to try again."
438
+ if self.print_log:
439
+ print("invalid_tools", invalid_tools)
440
+ print("full_response", full_response)
438
441
  if function_parameter:
439
442
  need_function_call = True
440
443
  else:
@@ -39,8 +39,12 @@ def excute_command(command):
39
39
  stdout_log = result.stdout
40
40
  return f"执行命令成功:\n{stdout_log}"
41
41
  except subprocess.CalledProcessError as e:
42
+ if "pip install" in command:
43
+ stdout_log = "\n".join([x for x in e.stdout.split('\n') if '━━' not in x])
44
+ else:
45
+ stdout_log = e.stdout
42
46
  # 如果命令执行失败,返回错误信息和错误输出
43
- return f"执行命令失败 (退出码 {e.returncode}):\n错误: {e.stderr}\n输出: {e.stdout}"
47
+ return f"执行命令失败 (退出码 {e.returncode}):\n错误: {e.stderr}\n输出: {stdout_log}"
44
48
  except Exception as e:
45
49
  return f"执行命令时发生异常: {e}"
46
50
 
@@ -44,6 +44,9 @@ Example: Requesting to write to frontend-config.json
44
44
  # 确保目录存在
45
45
  os.makedirs(os.path.dirname(path) or '.', exist_ok=True)
46
46
 
47
+ if content.startswith("## ") and path.endswith(".md"):
48
+ content = "\n\n" + content
49
+
47
50
  # 写入文件
48
51
  with open(path, mode, encoding='utf-8') as file:
49
52
  file.write(content)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: beswarm
3
- Version: 0.1.26
3
+ Version: 0.1.28
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=AdDCcqAIIKQEMl7PfryVgeT9G5sHe7QNsZnrvmTGA8E,283
3
3
  beswarm/aient/main.py,sha256=SiYAIgQlLJqYusnTVEJOx1WNkSJKMImhgn5aWjfroxg,3814
4
- beswarm/aient/setup.py,sha256=EhwhmsokkWGYShSGqmabXCMernqtzq9Rm56ADXM-9wE,487
4
+ beswarm/aient/setup.py,sha256=mMD7sxErW_cvOWzAN-8-Q9wiW8jOqj3ynKnkAkoJsec,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
@@ -15,7 +15,7 @@ beswarm/aient/src/aient/core/test/test_payload.py,sha256=8jBiJY1uidm1jzL-EiK0s6U
15
15
  beswarm/aient/src/aient/models/__init__.py,sha256=ouNDNvoBBpIFrLsk09Q_sq23HR0GbLAKfGLIFmfEuXE,219
16
16
  beswarm/aient/src/aient/models/audio.py,sha256=kRd-8-WXzv4vwvsTGwnstK-WR8--vr9CdfCZzu8y9LA,1934
17
17
  beswarm/aient/src/aient/models/base.py,sha256=z-Z0pJfTN2x0cuwfvu0BdMRY9O-RmLwHEnBIJN1x4Fg,6719
18
- beswarm/aient/src/aient/models/chatgpt.py,sha256=10c1O1tO_RUCH_oOJ6dsDO6T-cVKyqEkd8rh20MsH7s,44826
18
+ beswarm/aient/src/aient/models/chatgpt.py,sha256=_K1cuU6yjF2tRQievD_qYS2-laDAmsBCZlb2IYsw_ek,45100
19
19
  beswarm/aient/src/aient/models/claude.py,sha256=thK9P8qkaaoUN3OOJ9Shw4KDs-pAGKPoX4FOPGFXva8,28597
20
20
  beswarm/aient/src/aient/models/duckduckgo.py,sha256=1l7vYCs9SG5SWPCbcl7q6pCcB5AUF_r-a4l9frz3Ogo,8115
21
21
  beswarm/aient/src/aient/models/gemini.py,sha256=chGLc-8G_DAOxr10HPoOhvVFW1RvMgHd6mt--VyAW98,14730
@@ -24,7 +24,7 @@ beswarm/aient/src/aient/models/vertex.py,sha256=qVD5l1Q538xXUPulxG4nmDjXE1VoV4yu
24
24
  beswarm/aient/src/aient/plugins/__init__.py,sha256=p3KO6Aa3Lupos4i2SjzLQw1hzQTigOAfEHngsldrsyk,986
25
25
  beswarm/aient/src/aient/plugins/arXiv.py,sha256=yHjb6PS3GUWazpOYRMKMzghKJlxnZ5TX8z9F6UtUVow,1461
26
26
  beswarm/aient/src/aient/plugins/config.py,sha256=KnZ5xtb5o41FI2_qvxTEQhssdd3WJc7lIAFNR85INQw,7817
27
- beswarm/aient/src/aient/plugins/excute_command.py,sha256=A5jvmo8DGcluylIooczMHk8t8zs7vq-wQzbF1ETYY2A,1606
27
+ beswarm/aient/src/aient/plugins/excute_command.py,sha256=9bCKFSQCRO2OYEYT-C-Vqmme0TRO7tc7bFjOxlT03Fk,1784
28
28
  beswarm/aient/src/aient/plugins/get_time.py,sha256=Ih5XIW5SDAIhrZ9W4Qe5Hs1k4ieKPUc_LAd6ySNyqZk,654
29
29
  beswarm/aient/src/aient/plugins/image.py,sha256=ZElCIaZznE06TN9xW3DrSukS7U3A5_cjk1Jge4NzPxw,2072
30
30
  beswarm/aient/src/aient/plugins/list_directory.py,sha256=5ubm-mfrj-tanGSDp4M_Tmb6vQb3dx2-XVfQ2yL2G8A,1394
@@ -32,7 +32,7 @@ beswarm/aient/src/aient/plugins/read_file.py,sha256=cJxGnhcz1_gjkgeemVyixLUiCvf-
32
32
  beswarm/aient/src/aient/plugins/registry.py,sha256=YknzhieU_8nQ3oKlUSSWDB4X7t2Jx0JnqT2Jd9Xsvfk,3574
33
33
  beswarm/aient/src/aient/plugins/run_python.py,sha256=dgcUwBunMuDkaSKR5bToudVzSdrXVewktDDFUz_iIOQ,4589
34
34
  beswarm/aient/src/aient/plugins/websearch.py,sha256=yiBzqXK5X220ibR-zko3VDsn4QOnLu1k6E2YOygCeTQ,15185
35
- beswarm/aient/src/aient/plugins/write_file.py,sha256=FfQgAaojwtHiUORLBBt98mKWddoWgjd3o2UD1v1mgUI,1732
35
+ beswarm/aient/src/aient/plugins/write_file.py,sha256=_3GoYp-t3zfZDKZYVJq5Zddk6ayB_6c2YBB9dDOWVD8,1827
36
36
  beswarm/aient/src/aient/prompt/__init__.py,sha256=GBtn6-JDT8KHFCcuPpfSNE_aGddg5p4FEyMCy4BfwGs,20
37
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
@@ -125,7 +125,7 @@ beswarm/tools/repomap.py,sha256=CwvwoN5Swr42EzrORTTeV8MMb7mPviy4a4b0fxBu50k,4082
125
125
  beswarm/tools/search_arxiv.py,sha256=9slwBemXjEqrd7-YgVmyMijPXlkhZCybEDRVhWVQ9B0,7937
126
126
  beswarm/tools/think.py,sha256=WLw-7jNIsnS6n8MMSYUin_f-BGLENFmnKM2LISEp0co,1760
127
127
  beswarm/tools/worker.py,sha256=JZkMT4JAkrV_0-CBATLAPVZzVGEMMEM2XUTTMGmED0E,5245
128
- beswarm-0.1.26.dist-info/METADATA,sha256=jb283jWSrJQbfNFT9CHcIo_UfR7MMcCc8SbgDdbnkZQ,2870
129
- beswarm-0.1.26.dist-info/WHEEL,sha256=ck4Vq1_RXyvS4Jt6SI0Vz6fyVs4GWg7AINwpsaGEgPE,91
130
- beswarm-0.1.26.dist-info/top_level.txt,sha256=pJw4O87wvt5882smuSO6DfByJz7FJ8SxxT8h9fHCmpo,8
131
- beswarm-0.1.26.dist-info/RECORD,,
128
+ beswarm-0.1.28.dist-info/METADATA,sha256=w8h_tliNum4dTTgJ6lM93JoHOmOMDegh6gUCTN-s-9s,2870
129
+ beswarm-0.1.28.dist-info/WHEEL,sha256=ck4Vq1_RXyvS4Jt6SI0Vz6fyVs4GWg7AINwpsaGEgPE,91
130
+ beswarm-0.1.28.dist-info/top_level.txt,sha256=pJw4O87wvt5882smuSO6DfByJz7FJ8SxxT8h9fHCmpo,8
131
+ beswarm-0.1.28.dist-info/RECORD,,