From 56f544a675ef7417b46e2f683609b497af31feef Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=8E=98=E6=9D=83=20=E9=A9=AC?= Date: Sat, 4 Nov 2023 16:49:13 +0800 Subject: [PATCH] refactor: @cause_by.setter --- examples/agent_creator.py | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/examples/agent_creator.py b/examples/agent_creator.py index 5a1398456..3618c0608 100644 --- a/examples/agent_creator.py +++ b/examples/agent_creator.py @@ -2,8 +2,6 @@ Filename: MetaGPT/examples/agent_creator.py Created Date: Tuesday, September 12th 2023, 3:28:37 pm Author: 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 re @@ -12,7 +10,6 @@ from metagpt.const import PROJECT_ROOT, WORKSPACE_ROOT from metagpt.logs import logger from metagpt.roles import Role from metagpt.schema import Message -from metagpt.utils.common import get_object_name with open(PROJECT_ROOT / "examples/build_customized_agent.py", "r") as f: # use official example script to guide AgentCreator @@ -75,7 +72,7 @@ class AgentCreator(Role): instruction = msg.content code_text = await CreateAgent().run(example=self.agent_template, instruction=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 msg