beswarm 0.1.31__py3-none-any.whl → 0.1.32__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.90",
7
+ version="1.0.91",
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",
@@ -125,9 +125,9 @@ class chatgpt(BaseLLM):
125
125
  # print("role", role, "function_name", function_name, "message", message)
126
126
  if convo_id not in self.conversation:
127
127
  self.reset(convo_id=convo_id)
128
- if function_name == "" and message and message != None:
128
+ if function_name == "" and message:
129
129
  self.conversation[convo_id].append({"role": role, "content": message})
130
- elif function_name != "" and message and message != None:
130
+ elif function_name != "" and message:
131
131
  # 删除从 cut_history_by_function_name 以后的所有历史记录
132
132
  if function_name == self.cut_history_by_function_name:
133
133
  matching_message = next(filter(lambda x: safe_get(x, "tool_calls", 0, "function", "name", default="") == 'get_next_pdf', self.conversation[convo_id]), None)
@@ -429,26 +429,27 @@ class chatgpt(BaseLLM):
429
429
  if response_role is None:
430
430
  response_role = "assistant"
431
431
 
432
- function_parameter = parse_function_xml(full_response)
433
- if function_parameter:
434
- invalid_tools = [tool_dict for tool_dict in function_parameter if tool_dict.get("function_name", "") not in self.plugins.keys()]
435
- function_parameter = [tool_dict for tool_dict in function_parameter if tool_dict.get("function_name", "") 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 and invalid_tools:
439
- print("invalid_tools", invalid_tools)
440
- print("function_parameter", function_parameter)
441
- print("full_response", full_response)
432
+ if self.use_plugins == True:
433
+ function_parameter = parse_function_xml(full_response)
442
434
  if function_parameter:
443
- need_function_call = True
444
- else:
445
- need_function_call = False
446
- if self.print_log:
447
- print("Failed to parse function_parameter full_response", full_response)
448
- full_response = ""
435
+ invalid_tools = [tool_dict for tool_dict in function_parameter if tool_dict.get("function_name", "") not in self.plugins.keys()]
436
+ function_parameter = [tool_dict for tool_dict in function_parameter if tool_dict.get("function_name", "") in self.plugins.keys()]
437
+ for tool_dict in invalid_tools:
438
+ 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."
439
+ if self.print_log and invalid_tools:
440
+ print("invalid_tools", invalid_tools)
441
+ print("function_parameter", function_parameter)
442
+ print("full_response", full_response)
443
+ if function_parameter:
444
+ need_function_call = True
445
+ else:
446
+ need_function_call = False
447
+ if self.print_log:
448
+ print("Failed to parse function_parameter full_response", full_response)
449
+ full_response = ""
449
450
 
450
451
  # 处理函数调用
451
- if need_function_call and self.use_plugins != False:
452
+ if need_function_call and self.use_plugins == True:
452
453
  if self.print_log:
453
454
  print("function_parameter", function_parameter)
454
455
  print("function_full_response", function_full_response)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: beswarm
3
- Version: 0.1.31
3
+ Version: 0.1.32
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=7VXWS5c7_Rs1e_M-Vb0lVPvFOmvZ4ePzklbj1fMMVX0,487
4
+ beswarm/aient/setup.py,sha256=Yu2nicPHxIzQJARPGUjzlqzfZZW9pGkJguVGBfKn1fk,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=Y99EIUE9m7QIo3G-6MQWQ_HShCv5tDQHYM-nQyV32DM,45002
18
+ beswarm/aient/src/aient/models/chatgpt.py,sha256=-NWkkKxTCyraPYT0YN37NA2rUfOaDNXtvFSQmIE5tS8,45066
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
@@ -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.31.dist-info/METADATA,sha256=F1YBCYr4Ub_jaD3xvQhfsn4Z0lbJr2_H774Jbl3-KN8,2870
129
- beswarm-0.1.31.dist-info/WHEEL,sha256=ck4Vq1_RXyvS4Jt6SI0Vz6fyVs4GWg7AINwpsaGEgPE,91
130
- beswarm-0.1.31.dist-info/top_level.txt,sha256=pJw4O87wvt5882smuSO6DfByJz7FJ8SxxT8h9fHCmpo,8
131
- beswarm-0.1.31.dist-info/RECORD,,
128
+ beswarm-0.1.32.dist-info/METADATA,sha256=kCil9ROq7bb7PmPRvj5N3K0K0XZqmBpxHpbv6IU6SrA,2870
129
+ beswarm-0.1.32.dist-info/WHEEL,sha256=ooBFpIzZCPdw3uqIQsOo4qqbA4ZRPxHnOH7peeONza0,91
130
+ beswarm-0.1.32.dist-info/top_level.txt,sha256=pJw4O87wvt5882smuSO6DfByJz7FJ8SxxT8h9fHCmpo,8
131
+ beswarm-0.1.32.dist-info/RECORD,,
@@ -1,5 +1,5 @@
1
1
  Wheel-Version: 1.0
2
- Generator: setuptools (80.0.0)
2
+ Generator: setuptools (80.0.1)
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any
5
5