From f4e18e91a5960df210f813cd435b7baea8d0ba08 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bilge=20Y=C3=BCcel?= Date: Mon, 26 Jun 2023 13:43:06 +0300 Subject: [PATCH] Change 'history' to 'memory' (#5203) --- haystack/agents/utils.py | 4 ++-- haystack/nodes/prompt/prompt_template.py | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/haystack/agents/utils.py b/haystack/agents/utils.py index 29493f10f..668795dc1 100644 --- a/haystack/agents/utils.py +++ b/haystack/agents/utils.py @@ -37,7 +37,7 @@ def agent_without_tools_parameter_resolver(query: str, agent: "Agent", **kwargs) """ A parameter resolver for simple chat agents without tools that returns the query and the history. """ - return {"query": query, "history": agent.memory.load()} + return {"query": query, "memory": agent.memory.load()} def conversational_agent_parameter_resolver( @@ -52,5 +52,5 @@ def conversational_agent_parameter_resolver( "tool_names": agent.tm.get_tool_names(), "tool_names_with_descriptions": agent.tm.get_tool_names_with_descriptions(), "transcript": agent_step.transcript, - "history": agent.memory.load(), + "memory": agent.memory.load(), } diff --git a/haystack/nodes/prompt/prompt_template.py b/haystack/nodes/prompt/prompt_template.py index 7fbce90b5..e757a0aea 100644 --- a/haystack/nodes/prompt/prompt_template.py +++ b/haystack/nodes/prompt/prompt_template.py @@ -158,7 +158,7 @@ LEGACY_DEFAULT_TEMPLATES: Dict[str, Dict] = { "If the AI Agent is uncertain or concerned that the information may be outdated or inaccurate, it must use the available tools to find the most up-to-date information. The AI has access to these tools:\n" "{tool_names_with_descriptions}\n" "The following is the previous conversation between a human and an AI:\n" - "{history}\n" + "{memory}\n" "AI Agent responses must start with one of the following:\n" "Thought: [AI Agent's reasoning process]\n" "Tool: [{tool_names}] (on a new line) Tool Input: [input for the selected tool WITHOUT quotation marks and on a new line] (These must always be provided together and on separate lines.)\n" @@ -174,7 +174,7 @@ LEGACY_DEFAULT_TEMPLATES: Dict[str, Dict] = { "prompt": "Condense the following chat transcript by shortening and summarizing the content without losing important information:\n{chat_transcript}\nCondensed Transcript:" }, "conversational-agent-without-tools": { - "prompt": "The following is a conversation between a human and an AI.\n{history}\nHuman: {query}\nAI:" + "prompt": "The following is a conversation between a human and an AI.\n{memory}\nHuman: {query}\nAI:" }, # DO NOT ADD ANY NEW TEMPLATE IN HERE! }