fixbug: get_title

This commit is contained in:
莘权 马 2023-09-09 16:43:42 +08:00
parent 19e78ff13e
commit 1b6b24077e

View file

@ -227,7 +227,7 @@ class BrainMemory(pydantic.BaseModel):
async def get_title(self, llm, max_words=5, **kwargs) -> str:
"""Generate text title"""
if self.llm_type == LLMType.METAGPT.value:
return self.history[0] if self.history else "New"
return Message(**self.history[0]).content if self.history else "New"
summary = await self.summarize(llm=llm, max_words=500)