beswarm 0.2.55__py3-none-any.whl → 0.2.56__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/agents/planact.py CHANGED
@@ -210,6 +210,9 @@ class WorkerAgent(BaseAgent):
210
210
  if response.strip() == '':
211
211
  self.logger.error("\n❌ 工作智能体回复为空,请重新生成指令。")
212
212
  self.broker.publish(message, self.error_topic)
213
+ elif "HTTP Error', 'status_code': 524" in response:
214
+ self.logger.error("\n❌ 工作智能体回复超时 100 秒,请重新生成指令。")
215
+ self.broker.publish(message, self.error_topic)
213
216
  else:
214
217
  self.broker.publish({"status": "new_message", "result": "\n✅ 工作智能体:\n" + response}, self.status_topic)
215
218
  self.broker.publish({
@@ -390,7 +390,7 @@ async def fetch_cloudflare_response_stream(client, url, headers, payload, model)
390
390
  async def fetch_cohere_response_stream(client, url, headers, payload, model):
391
391
  timestamp = int(datetime.timestamp(datetime.now()))
392
392
  async with client.stream('POST', url, headers=headers, json=payload) as response:
393
- error_message = await check_response(response, "fetch_gpt_response_stream")
393
+ error_message = await check_response(response, "fetch_cohere_response_stream")
394
394
  if error_message:
395
395
  yield error_message
396
396
  return
@@ -471,6 +471,8 @@ class chatgpt(BaseLLM):
471
471
  # self.logger.info(f"worker Response: {full_response}")
472
472
  if not full_response.strip().endswith('[done]'):
473
473
  raise Exception(f"Response is not ended with [done]: {full_response}")
474
+ elif not full_response.strip():
475
+ raise Exception(f"Response is empty")
474
476
  else:
475
477
  full_response = full_response.strip().rstrip('[done]')
476
478
  full_response = full_response.replace("<tool_code>", "").replace("</tool_code>", "")
@@ -635,6 +637,9 @@ class chatgpt(BaseLLM):
635
637
  else:
636
638
  all_responses.append(f"[{tool_name}({tool_args}) Result]:\n\n{tool_response}")
637
639
 
640
+ if self.check_done:
641
+ all_responses.append("Your message **must** end with [done] to signify the end of your output.")
642
+
638
643
  # 合并所有工具响应
639
644
  function_response = "\n\n".join(all_responses).strip()
640
645
  if missing_required_params:
@@ -719,7 +724,7 @@ class chatgpt(BaseLLM):
719
724
  self.logger.info(f"api_key: {kwargs.get('api_key', self.api_key)}")
720
725
 
721
726
  # 发送请求并处理响应
722
- for i in range(10):
727
+ for i in range(30):
723
728
  if self.print_log:
724
729
  replaced_text = json.loads(re.sub(r';base64,([A-Za-z0-9+/=]+)', ';base64,***', json.dumps(json_post)))
725
730
  replaced_text_str = json.dumps(replaced_text, indent=4, ensure_ascii=False)
@@ -771,8 +776,8 @@ class chatgpt(BaseLLM):
771
776
  except httpx.RemoteProtocolError:
772
777
  continue
773
778
  except Exception as e:
774
- if "Response is not ended with [done]:" in str(e):
775
- self.logger.error(f"Response is not ended with [done]: {e}")
779
+ if "Response is" in str(e):
780
+ self.logger.error(f"{e}")
776
781
  continue
777
782
  self.logger.error(f"发生了未预料的错误:{e}")
778
783
  import traceback
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: beswarm
3
- Version: 0.2.55
3
+ Version: 0.2.56
4
4
  Summary: MAS
5
5
  Requires-Python: >=3.11
6
6
  Description-Content-Type: text/markdown
@@ -6,13 +6,13 @@ beswarm/prompt.py,sha256=INVRWQZP6lysvGUcPOYI_er5-bi1gGe_qa6BTov7PmY,32362
6
6
  beswarm/taskmanager.py,sha256=ErgZa9_aBeWdmt5neRw6sDVdwSWewxip458gAjeQhS4,12188
7
7
  beswarm/utils.py,sha256=0J-b38P5QGT-A_38co7FjzaUNJykaskI7mbbcQ4w_68,8215
8
8
  beswarm/agents/chatgroup.py,sha256=PzrmRcDKAbB7cxL16nMod_CzPosDV6bfTmXxQVuv-AQ,12012
9
- beswarm/agents/planact.py,sha256=xi259X0y1Sd2HBM42pp0JtCtGE3glhO12l5u5F0SvOU,19926
9
+ beswarm/agents/planact.py,sha256=ndsisPbGhHN04O85Htc12bC1UWPdgq_CNA1077nxeD0,20147
10
10
  beswarm/aient/aient/__init__.py,sha256=SRfF7oDVlOOAi6nGKiJIUK6B_arqYLO9iSMp-2IZZps,21
11
11
  beswarm/aient/aient/core/__init__.py,sha256=NxjebTlku35S4Dzr16rdSqSTWUvvwEeACe8KvHJnjPg,34
12
12
  beswarm/aient/aient/core/log_config.py,sha256=kz2_yJv1p-o3lUQOwA3qh-LSc3wMHv13iCQclw44W9c,274
13
13
  beswarm/aient/aient/core/models.py,sha256=d4MISNezTSe0ls0-fjuToI2SoT-sk5fWqAJuKVinIlo,7502
14
14
  beswarm/aient/aient/core/request.py,sha256=4FFCwQ7h7b6bqtrA8qw-DPJVXZTj2i1CkYccFeEwUPw,76552
15
- beswarm/aient/aient/core/response.py,sha256=sPcNV9qLosj3lIXElezUZEjIyglspdkBg-EsIUhr9bQ,33203
15
+ beswarm/aient/aient/core/response.py,sha256=tYKWOeexYEhWK4napIAfYjCn2rQ1zpxRvknsBBWrv2M,33206
16
16
  beswarm/aient/aient/core/utils.py,sha256=D98d5Cy1h4ejKtuxS0EEDtL4YqpaZLB5tuXoVP0IBWQ,28462
17
17
  beswarm/aient/aient/core/test/test_base_api.py,sha256=pWnycRJbuPSXKKU9AQjWrMAX1wiLC_014Qc9hh5C2Pw,524
18
18
  beswarm/aient/aient/core/test/test_geminimask.py,sha256=HFX8jDbNg_FjjgPNxfYaR-0-roUrOO-ND-FVsuxSoiw,13254
@@ -21,7 +21,7 @@ beswarm/aient/aient/core/test/test_payload.py,sha256=8jBiJY1uidm1jzL-EiK0s6UGmW9
21
21
  beswarm/aient/aient/models/__init__.py,sha256=ZTiZgbfBPTjIPSKURE7t6hlFBVLRS9lluGbmqc1WjxQ,43
22
22
  beswarm/aient/aient/models/audio.py,sha256=kRd-8-WXzv4vwvsTGwnstK-WR8--vr9CdfCZzu8y9LA,1934
23
23
  beswarm/aient/aient/models/base.py,sha256=-nnihYnx-vHZMqeVO9ljjt3k4FcD3n-iMk4tT-10nRQ,7232
24
- beswarm/aient/aient/models/chatgpt.py,sha256=LnbWADil5oNmdBaAtXb1XcQwoaERqanO7Or9wzsg82w,49348
24
+ beswarm/aient/aient/models/chatgpt.py,sha256=zPPzZOEFilHXvz82oZ-qVvIYyJjtXmyR0sV-XbVgq3A,49550
25
25
  beswarm/aient/aient/plugins/__init__.py,sha256=p3KO6Aa3Lupos4i2SjzLQw1hzQTigOAfEHngsldrsyk,986
26
26
  beswarm/aient/aient/plugins/arXiv.py,sha256=yHjb6PS3GUWazpOYRMKMzghKJlxnZ5TX8z9F6UtUVow,1461
27
27
  beswarm/aient/aient/plugins/config.py,sha256=2DXH-LP9KGl_P4467chJu3q4AAbX5nSn4DIkdI0aYH8,7105
@@ -116,7 +116,7 @@ beswarm/tools/search_web.py,sha256=NYrb5KL_WUGPm-fOKT8Cyjon04lxBU-gaLdrVjeYgGo,1
116
116
  beswarm/tools/subtasks.py,sha256=mIjA2QrRy9Fos4rYm8fCfu2QrsE_MGnQI9IR8dOxsGs,9885
117
117
  beswarm/tools/worker.py,sha256=_cSkRUKRJMAiZiTfnBze_e9Kc7k7KvbB5hdxdvp4FW4,2009
118
118
  beswarm/tools/write_csv.py,sha256=u0Hq18Ksfheb52MVtyLNCnSDHibITpsYBPs2ub7USYA,1466
119
- beswarm-0.2.55.dist-info/METADATA,sha256=iUHDB2olCdaPgC5J8ppmSdqdH6NXChIfnDsclhikhpY,3878
120
- beswarm-0.2.55.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
121
- beswarm-0.2.55.dist-info/top_level.txt,sha256=pJw4O87wvt5882smuSO6DfByJz7FJ8SxxT8h9fHCmpo,8
122
- beswarm-0.2.55.dist-info/RECORD,,
119
+ beswarm-0.2.56.dist-info/METADATA,sha256=FrWan2BAJ5fDhF0t-RzYYa_ktMHjwSIOYtk02oLLHjA,3878
120
+ beswarm-0.2.56.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
121
+ beswarm-0.2.56.dist-info/top_level.txt,sha256=pJw4O87wvt5882smuSO6DfByJz7FJ8SxxT8h9fHCmpo,8
122
+ beswarm-0.2.56.dist-info/RECORD,,