in this code when i ask anything it give me an error "KeyError: {'input', 'agent_scratchpad'}" I want the gpt to search bing and give back results
def langchain_completion(self
):
system_template = """
Your job is a financial advisor and assistant that must make decisions for users based on the user's data and the questions you ask. \
"""
llm = ChatOpenAI(model_name="gpt-4",
temperature=self.TEMPERATURE,
max_tokens=self.USER_MAX_TOKENS
)
tools = load_tools(["wikipedia", "llm-math", "bing-search"],
llm=llm
)
my_agent = initialize_agent(tools,
llm,
agent=AgentType.ZERO_SHOT_REACT_DESCRIPTION,
verbose=False
)
my_agent.agent.llm_chain.prompt.template = system_template
while True:
question = input("Enter your prompt: ")
if (question != ""):
print(my_agent.run(input=question))
else:
return "I'm Out"
The error:
File ~\miniconda3\envs\workspace\Lib\site-packages\langchain\utils\formatting.py:18, in StrictFormatter.check_unused_args(self, used_args, args, kwargs) 16 extra = set(kwargs).difference(used_args) 17 if extra: ---> 18 raise KeyError(extra)
KeyError: {'input', 'agent_scratchpad'}