Bugfix - allow custom input variables in chat zero shot agent's prompt (#1624)

I was trying out the `chat-zero-shot-react-description` agent for
[qabot](dbbd31bb27/qabot/agents/data_query_chain.py (L35-L52))
but langchain 0.0.108 doesn't correctly use custom 'input_variables` in
the prompt template.
tool-patch
Brian Thorne 1 year ago committed by GitHub
parent b3234bf3b0
commit 9ee2713272
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -73,9 +73,9 @@ class ChatAgent(Agent):
SystemMessagePromptTemplate.from_template(template),
HumanMessagePromptTemplate.from_template("{input}\n\n{agent_scratchpad}"),
]
return ChatPromptTemplate(
input_variables=["input", "agent_scratchpad"], messages=messages
)
if input_variables is None:
input_variables = ["input", "agent_scratchpad"]
return ChatPromptTemplate(input_variables=input_variables, messages=messages)
@classmethod
def from_llm_and_tools(

Loading…
Cancel
Save