Merge pull request #47 from iorisa/fixbug/get_title

Fixbug/get title
This commit is contained in:
send18 2023-09-09 16:49:09 +08:00 committed by GitHub
commit 5d557f9751
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

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 Message(**self.history[0]).content if self.history else "New"
summary = await self.summarize(llm=llm, max_words=500)
language = CONFIG.language or DEFAULT_LANGUAGE