From da4d0f515c38f8759cb8feb1cf0feb33678912ae Mon Sep 17 00:00:00 2001 From: hrz <1710360675@qq.com> Date: Wed, 14 May 2025 22:59:55 +0800 Subject: [PATCH] =?UTF-8?q?fix:short=5Fmomery=E5=8F=AF=E8=83=BD=E4=B8=BA?= =?UTF-8?q?=E7=A9=BA=E7=9A=84bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../core/providers/memory/mem_local_short/mem_local_short.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/main/xiaozhi-server/core/providers/memory/mem_local_short/mem_local_short.py b/main/xiaozhi-server/core/providers/memory/mem_local_short/mem_local_short.py index 8531b8c6..2e5c7db2 100644 --- a/main/xiaozhi-server/core/providers/memory/mem_local_short/mem_local_short.py +++ b/main/xiaozhi-server/core/providers/memory/mem_local_short/mem_local_short.py @@ -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