mirror of
https://github.com/FoundationAgents/MetaGPT.git
synced 2026-05-11 16:52:37 +02:00
refactor: @cause_by.setter
This commit is contained in:
parent
56f544a675
commit
8ea52d8a83
2 changed files with 2 additions and 4 deletions
|
|
@ -2,8 +2,6 @@
|
|||
Filename: MetaGPT/examples/build_customized_agent.py
|
||||
Created Date: Tuesday, September 19th 2023, 6:52:25 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 asyncio
|
||||
import re
|
||||
|
|
@ -83,7 +81,7 @@ class SimpleCoder(Role):
|
|||
instruction = msg.content
|
||||
|
||||
code_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 msg
|
||||
|
||||
|
|
|
|||
|
|
@ -135,7 +135,7 @@ class Message(BaseModel):
|
|||
self.set_cause_by(v)
|
||||
continue
|
||||
if k == MESSAGE_ROUTE_TO:
|
||||
self.add_to(v)
|
||||
self.add_to(any_to_str(v))
|
||||
continue
|
||||
self.meta_info[k] = v
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue