Merge pull request #1249 from xinnan-tech/manager-local-mem

fix:short_momery可能为空的bug
This commit is contained in:
欣南科技 2025-05-14 23:01:03 +08:00 committed by GitHub
commit 96008fa78f
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -153,7 +153,7 @@ class MemoryProvider(MemoryProviderBase):
msgStr += f"User: {msg.content}\n"
elif msg.role == "assistant":
msgStr += f"Assistant: {msg.content}\n"
if len(self.short_momery) > 0:
if self.short_momery and len(self.short_momery) > 0:
msgStr += "历史记忆:\n"
msgStr += self.short_momery