mirror of
https://github.com/FoundationAgents/MetaGPT.git
synced 2026-06-02 14:45:17 +02:00
rm forward_message
This commit is contained in:
parent
f621186c2e
commit
e39f7ff0b1
8 changed files with 26 additions and 65 deletions
|
|
@ -190,7 +190,7 @@ class Environment(ExtEnv):
|
|||
found = True
|
||||
if not found:
|
||||
logger.warning(f"Message no recipients: {message.dump()}")
|
||||
# self.history += f"\n{message}" # For debug
|
||||
self.history += f"\n{message}" # For debug
|
||||
|
||||
return True
|
||||
|
||||
|
|
|
|||
|
|
@ -6,8 +6,6 @@ from metagpt.schema import Message
|
|||
class MGXEnv(Environment):
|
||||
"""MGX Environment"""
|
||||
|
||||
history: dict[str, Message] = {} # redefine message history
|
||||
|
||||
def _publish_message(self, message: Message, peekable: bool = True) -> bool:
|
||||
return super().publish_message(message, peekable)
|
||||
|
||||
|
|
@ -28,16 +26,8 @@ class MGXEnv(Environment):
|
|||
# every regular message goes through team leader
|
||||
tl.put_message(message)
|
||||
|
||||
self.history[message.id] = message
|
||||
|
||||
return True
|
||||
|
||||
def forward_message(self, message_id: str) -> str:
|
||||
if message_id not in self.history:
|
||||
return f"invalid message_id {message_id}, not found in history."
|
||||
msg = self.history[message_id]
|
||||
return self._publish_message(msg)
|
||||
|
||||
async def ask_human(self, question: str) -> str:
|
||||
# NOTE: Can be overwritten in remote setting
|
||||
return get_human_input(question)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue