From 7fb33fd890a3a19ab46f60d2ac9df152e75278b3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=8E=98=E6=9D=83=20=E9=A9=AC?= Date: Fri, 10 Nov 2023 16:56:50 +0800 Subject: [PATCH] refactor: cause_by --- metagpt/roles/sk_agent.py | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/metagpt/roles/sk_agent.py b/metagpt/roles/sk_agent.py index bb923caf2..15b18dd3e 100644 --- a/metagpt/roles/sk_agent.py +++ b/metagpt/roles/sk_agent.py @@ -4,9 +4,8 @@ @Time : 2023/9/13 12:23 @Author : femto Zheng @File : sk_agent.py -@Modified By: mashenquan, 2023-11-1. In accordance with Chapter 2.2.1 and 2.2.2 of RFC 116, modify the data - type of the `cause_by` value in the `Message` to a string, and utilize the new message distribution - feature for message filtering. +@Modified By: mashenquan, 2023-11-1. In accordance with Chapter 2.2.1 and 2.2.2 of RFC 116, utilize the new message + distribution feature for message filtering. """ from semantic_kernel.planning import SequentialPlanner from semantic_kernel.planning.action_planner.action_planner import ActionPlanner @@ -17,7 +16,6 @@ from metagpt.actions.execute_task import ExecuteTask from metagpt.logs import logger from metagpt.roles import Role from metagpt.schema import Message -from metagpt.utils.common import any_to_str from metagpt.utils.make_sk_kernel import make_sk_kernel @@ -74,7 +72,7 @@ class SkAgent(Role): result = (await self.plan.invoke_async()).result logger.info(result) - msg = Message(content=result, role=self.profile, cause_by=any_to_str(self._rc.todo)) + msg = Message(content=result, role=self.profile, cause_by=self._rc.todo) self._rc.memory.add(msg) self.publish_message(msg) return msg