Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change 'history' to 'memory' in the ConversationalAgent prompts #5203

Merged
merged 2 commits into from
Jun 26, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions haystack/agents/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand All @@ -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(),
}
4 changes: 2 additions & 2 deletions haystack/nodes/prompt/prompt_template.py
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@
"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"
Expand All @@ -174,7 +174,7 @@
"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!
}
Expand Down