mirror of
https://github.com/FoundationAgents/MetaGPT.git
synced 2026-05-03 04:42:38 +02:00
fixbug: sent_from, send_to
This commit is contained in:
parent
1e6e9d3103
commit
9fa47aff03
7 changed files with 19 additions and 18 deletions
|
|
@ -43,6 +43,7 @@ from metagpt.const import (
|
|||
MESSAGE_ROUTE_FROM,
|
||||
MESSAGE_ROUTE_TO,
|
||||
MESSAGE_ROUTE_TO_ALL,
|
||||
MESSAGE_ROUTE_TO_SELF,
|
||||
PRDS_FILE_REPO,
|
||||
SYSTEM_DESIGN_FILE_REPO,
|
||||
TASK_FILE_REPO,
|
||||
|
|
@ -200,7 +201,7 @@ class Message(BaseModel):
|
|||
"""list[<role>: <content>]"""
|
||||
|
||||
id: str = Field(default="", validate_default=True) # According to Section 2.2.3.1.1 of RFC 135
|
||||
content: str
|
||||
content: str # natural language for user or agent
|
||||
instruct_content: Optional[BaseModel] = Field(default=None, validate_default=True)
|
||||
role: str = "user" # system / user / assistant
|
||||
cause_by: str = Field(default="", validate_default=True)
|
||||
|
|
@ -399,6 +400,13 @@ class AIMessage(Message):
|
|||
return self.metadata.get(AGENT, "")
|
||||
|
||||
|
||||
class AISelfMessage(AIMessage):
|
||||
def __init__(self, **kwargs):
|
||||
super().__init__(**kwargs)
|
||||
self.sent_from = MESSAGE_ROUTE_TO_SELF
|
||||
self.send_to = MESSAGE_ROUTE_TO_SELF
|
||||
|
||||
|
||||
class Task(BaseModel):
|
||||
task_id: str = ""
|
||||
dependent_task_ids: list[str] = [] # Tasks prerequisite to this Task
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue