🌟 The Multi-Agent Framework: First AI Software Company, Towards Natural Language Programming
refactor: @cause_by.setter
莘权 马8ea52d8a83ce
diff --git a/examples/build_customized_agent.py b/examples/build_customized_agent.pyindex af15c90ca..f7f554e53 100644--- a/examples/build_customized_agent.py+++ b/examples/build_customized_agent.py@@ -2,8 +2,6 @@Filename: MetaGPT/examples/build_customized_agent.pyCreated Date: Tuesday, September 19th 2023, 6:52:25 pmAuthor: garylin2099-@Modified By: mashenquan, 2023-11-1. According to Chapter 2.2.1 and 2.2.2 of RFC 116, change the data type of- the `cause_by` value in the `Message` to a string to support the new message distribution feature."""import asyncioimport re@@ -83,7 +81,7 @@ class SimpleCoder(Role):instruction = msg.contentcode_text = await SimpleWriteCode().run(instruction)- msg = Message(content=code_text, role=self.profile, cause_by=get_object_name(todo))+ msg = Message(content=code_text, role=self.profile, cause_by=todo)return msgdiff --git a/metagpt/schema.py b/metagpt/schema.pyindex 1082c5ddb..0be067cfe 100644--- a/metagpt/schema.py+++ b/metagpt/schema.py@@ -135,7 +135,7 @@ class Message(BaseModel):self.set_cause_by(v)continueif k == MESSAGE_ROUTE_TO:- self.add_to(v)+ self.add_to(any_to_str(v))continueself.meta_info[k] = v