mirror of
https://github.com/FoundationAgents/MetaGPT.git
synced 2026-06-08 15:05:17 +02:00
fixbug: No user feedback, unsure if past conversation is finished.
This commit is contained in:
parent
5a03ff20ce
commit
4fddfbab58
2 changed files with 3 additions and 1 deletions
|
|
@ -53,6 +53,6 @@ class BrainMemory(pydantic.BaseModel):
|
|||
@property
|
||||
def last_talk(self):
|
||||
if len(self.history) == 0 or not self.history[-1].is_contain_tags([MessageType.Talk.value]):
|
||||
return ""
|
||||
return None
|
||||
return self.history[-1].content
|
||||
|
||||
|
|
|
|||
|
|
@ -113,6 +113,8 @@ class Assistant(Role):
|
|||
async def refine_memory(self) -> str:
|
||||
history_text = self.memory.history_text
|
||||
last_talk = self.memory.last_talk
|
||||
if last_talk is None: # No user feedback, unsure if past conversation is finished.
|
||||
return None
|
||||
if history_text == "":
|
||||
return last_talk
|
||||
history_summary = await self._llm.get_context_title(history_text, max_words=20)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue