beswarm 0.2.63__py3-none-any.whl → 0.2.65__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
@@ -90,8 +90,16 @@ class InstructionAgent(BaseAgent):
90
90
  self.goal_diff = '\n'.join(changed_lines).strip()
91
91
 
92
92
  def get_conversation_history(self, raw_conversation_history: List[Dict]):
93
- conversation_history = copy.deepcopy(raw_conversation_history)
94
93
 
94
+ for index, message in enumerate(raw_conversation_history):
95
+ if message.get("content") and isinstance(message["content"], str):
96
+ if "<knowledge_graph_tree>" in message["content"] and self.graph_tree:
97
+ message["content"] = replace_xml_content(message["content"], "knowledge_graph_tree", self.graph_tree)
98
+ raw_conversation_history[index] = message
99
+ if "\n\nYour message **must** end with [done] to signify the end of your output." in message["content"]:
100
+ message["content"] = message["content"].replace("\n\nYour message **must** end with [done] to signify the end of your output.", "")
101
+
102
+ conversation_history = copy.deepcopy(raw_conversation_history)
95
103
  self.cache_file.write_text(json.dumps(conversation_history, ensure_ascii=False, indent=4), encoding="utf-8")
96
104
 
97
105
  work_agent_system_prompt = conversation_history.pop(0)
@@ -113,13 +121,6 @@ class InstructionAgent(BaseAgent):
113
121
  if "<knowledge_graph_tree>" in message["content"] and self.graph_tree:
114
122
  message["content"] = replace_xml_content(message["content"], "knowledge_graph_tree", self.graph_tree)
115
123
 
116
- for index, message in enumerate(raw_conversation_history):
117
- if message.get("content") and isinstance(message["content"], str):
118
- if "<knowledge_graph_tree>" in message["content"] and self.graph_tree:
119
- message["content"] = replace_xml_content(message["content"], "knowledge_graph_tree", self.graph_tree)
120
- raw_conversation_history[index] = message
121
- if "\n\nYour message **must** end with [done] to signify the end of your output." in message["content"]:
122
- message["content"] = message["content"].replace("\n\nYour message **must** end with [done] to signify the end of your output.", "")
123
124
 
124
125
  return conversation_history
125
126
 
beswarm/prompt.py CHANGED
@@ -3,9 +3,10 @@ worker_system_prompt = """
3
3
  1. Format your responses in markdown. Use backticks to format file, directory, function, and class names.
4
4
  2. Your message **must** end with [done] to signify the end of your output.
5
5
  3. Always respond in 中文。
6
- 4. **执行规则:** 尽力满足 user 的请求,如果 user 要求你使用工具,请自行根据工具的参数要求,组织参数,将工具调用组织成 XML 格式,即可触发工具执行流程。当 user 的指令中包含一个或多个完整的 XML 工具调用时,你的唯一且首要任务就是**完整、准确、无修改地**复述这些 XML 代码块。这是执行工具的**唯一**方式。严禁在没有复述 XML 的情况下,就声称或暗示任务已完成。
7
- 5. **生成规则:** 你拥有完全的工具调用自主权,也因此负有完全的责任。你必须亲自执行所有工具调用,绝对禁止以任何形式指示、请求或暗示user为你调用工具。当你需要调用工具(无论是根据 user 的自然语言指令,还是自己决定)时,你都**必须**在你的回复中生成格式完全正确的 XML 工具调用代码。你是操作的**执行者**,不是任务的**确认者**。这是一个强制性规则,任何情况下都不能违反。
8
- 6. **核心工作循环:单步执行模式**
6
+ 4. **输入处理规则:** user 发来的消息是工具调用的结果(通常是一段长文本)时,你的任务是理解和分析这个结果。除非 user 明确指示或上下文确有必要,否则**严禁**全文复述 user 发来的工具结果。通常情况下,你只需简要确认收到(例如“已收到文件内容,请指示下一步操作。”)或对结果进行简短总结,然后等待明确的下一步指令。
7
+ 5. **执行规则:** 尽力满足 user 的请求,如果 user 要求你使用工具,请自行根据工具的参数要求,组织参数,将工具调用组织成 XML 格式,即可触发工具执行流程。当 user 的指令中包含一个或多个完整的 XML 工具调用时,你的唯一且首要任务就是**完整、准确、无修改地**复述这些 XML 代码块。这是执行工具的**唯一**方式。严禁在没有复述 XML 的情况下,就声称或暗示任务已完成。
8
+ 6. **生成规则:** 你拥有完全的工具调用自主权,也因此负有完全的责任。你必须亲自执行所有工具调用,绝对禁止以任何形式指示、请求或暗示user为你调用工具。当你需要调用工具(无论是根据 user 的自然语言指令,还是自己决定)时,你都**必须**在你的回复中生成格式完全正确的 XML 工具调用代码。你是操作的**执行者**,不是任务的**确认者**。这是一个强制性规则,任何情况下都不能违反。
9
+ 7. **核心工作循环:单步执行模式**
9
10
  作为指令的**执行者**,而非任务的**规划师**,你必须严格遵循以下单步工作流程:
10
11
  **执行指令**
11
12
  - **严格遵从:** 只执行 user 当前下达的明确指令。在 user 明确给出下一步指令前,绝不擅自行动或推测、执行任何未明确要求的后续步骤。
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: beswarm
3
- Version: 0.2.63
3
+ Version: 0.2.65
4
4
  Summary: MAS
5
5
  Requires-Python: >=3.11
6
6
  Description-Content-Type: text/markdown
@@ -2,11 +2,11 @@ beswarm/__init__.py,sha256=HZjUOJtZR5QhMuDbq-wukQQn1VrBusNWai_ysGo-VVI,20
2
2
  beswarm/broker.py,sha256=64Y-djrKYaZfBQ8obwHOmr921QgZeu9BtScZWaYLfDo,9887
3
3
  beswarm/core.py,sha256=htssaaeIBZ_yOqvX9VtANoVWaZHt_7oWcxyDI1z0paQ,310
4
4
  beswarm/knowledge_graph.py,sha256=oiOMknAJzGrOHc2AyQgvrCcZAkGLhFnsnvSBdfFBWMw,14831
5
- beswarm/prompt.py,sha256=INVRWQZP6lysvGUcPOYI_er5-bi1gGe_qa6BTov7PmY,32362
5
+ beswarm/prompt.py,sha256=qlH-yYCGv9j9-5grnMXl0B53CDZgfTpe4ncwBwgWg7o,32816
6
6
  beswarm/taskmanager.py,sha256=vMmcoZ4FlNvjEliRkv3AniPji50NcY4Q1_2HETzR0DU,12226
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=z-RDEgDilrT6hNIN4G_3m04iJ698qyovZ5WG6QdywdA,20265
9
+ beswarm/agents/planact.py,sha256=7w9MuVhPk9WlMnGy_LlX8uCVM3pZs2IHf9dSIrHKOjo,20266
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
@@ -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.63.dist-info/METADATA,sha256=lMyXTP2gr3sg_Dz7ibk9o--waz6bv5f6CASmSYOdAsQ,3878
120
- beswarm-0.2.63.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
121
- beswarm-0.2.63.dist-info/top_level.txt,sha256=pJw4O87wvt5882smuSO6DfByJz7FJ8SxxT8h9fHCmpo,8
122
- beswarm-0.2.63.dist-info/RECORD,,
119
+ beswarm-0.2.65.dist-info/METADATA,sha256=N6OxxpRDR-33aH_G1t2cPk7tsLm__CHfuU9gWwz9fns,3878
120
+ beswarm-0.2.65.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
121
+ beswarm-0.2.65.dist-info/top_level.txt,sha256=pJw4O87wvt5882smuSO6DfByJz7FJ8SxxT8h9fHCmpo,8
122
+ beswarm-0.2.65.dist-info/RECORD,,