mirror of
https://github.com/FoundationAgents/MetaGPT.git
synced 2026-05-05 22:02:38 +02:00
refactor: brain memory
This commit is contained in:
parent
348cafa0b8
commit
bed3d8c841
1 changed files with 7 additions and 2 deletions
|
|
@ -71,7 +71,8 @@ class TalkAction(Action):
|
|||
self._rsp = ActionOutput(content=rsp)
|
||||
return self._rsp
|
||||
|
||||
async def run(self, *args, **kwargs) -> ActionOutput:
|
||||
@property
|
||||
def aask_args(self):
|
||||
language = CONFIG.language or DEFAULT_LANGUAGE
|
||||
system_msgs = [
|
||||
f"You are {CONFIG.agent_description}.",
|
||||
|
|
@ -89,7 +90,11 @@ class TalkAction(Action):
|
|||
format_msgs.append(json.loads(self._history_summary))
|
||||
else:
|
||||
format_msgs.append({"role": "assistant", "content": self._history_summary})
|
||||
rsp = await self.llm.aask(msg=self._talk, format_msgs=format_msgs, system_msgs=system_msgs)
|
||||
return self._talk, format_msgs, system_msgs
|
||||
|
||||
async def run(self, *args, **kwargs) -> ActionOutput:
|
||||
msg, format_msgs, system_msgs = self.aask_args
|
||||
rsp = await self.llm.aask(msg=msg, format_msgs=format_msgs, system_msgs=system_msgs)
|
||||
self._rsp = ActionOutput(content=rsp)
|
||||
return self._rsp
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue