fix:short_momery可能为空的bug

This commit is contained in:
hrz
2025-05-14 22:59:55 +08:00
parent b791fb1494
commit da4d0f515c
@@ -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