From 4a05679fdb88f662b9953b5ee607ac14170d7193 Mon Sep 17 00:00:00 2001 From: ZhangShenao <15201440436@163.com> Date: Mon, 29 Jul 2024 19:02:31 +0800 Subject: [PATCH] patch[experimental] Fix prompt in `GenerativeAgentMemory` (#24771) There is an issue with the prompt format in `GenerativeAgentMemory` , try to fix it. The prompt is same as the one in method `_score_memory_importance`. --- .../langchain_experimental/generative_agents/memory.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libs/experimental/langchain_experimental/generative_agents/memory.py b/libs/experimental/langchain_experimental/generative_agents/memory.py index 64791decf0..ac06acacf5 100644 --- a/libs/experimental/langchain_experimental/generative_agents/memory.py +++ b/libs/experimental/langchain_experimental/generative_agents/memory.py @@ -144,7 +144,7 @@ class GenerativeAgentMemory(BaseMemory): + " following piece of memory. Always answer with only a list of numbers." + " If just given one memory still respond in a list." + " Memories are separated by semi colans (;)" - + "\Memories: {memory_content}" + + "\nMemories: {memory_content}" + "\nRating: " ) scores = self.chain(prompt).run(memory_content=memory_content).strip()