fixbug: get_title

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

View file

@ -226,6 +226,9 @@ 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"
summary = await self.summarize(llm=llm, max_words=500)
language = CONFIG.language or DEFAULT_LANGUAGE