langchain
langchain copied to clipboard
Issue: question about agents
I want pass "chat_history" to the agents like :
...
agent = initialize_agent(tools, llm, agent=AgentType.OPENAI_FUNCTIONS, verbose=True)
response = agent.run({"input": {"chat_history": _message_to_tuple(history), "question": query}})
but got an error. how can i pass 'chat_history' to the agent?
Suggestion:
No response
could you pls tell what error u got?
could you pls tell what error u got?
The agent type is OpenAIFunctionsAgent, the input key must be:
@property
def input_keys(self) -> List[str]:
"""Get input keys. Input refers to user input here."""
return ["input"]
i cannot pass the chat_history to the tools chain
the tools contains a ConversationalRetrievalChain, and the chain set return_source_documents = True.
if i remove return_source_documents = True.. it will throw another err.
Hi, @zhangjunqiang! I'm Dosu, and I'm here to help the LangChain team manage their backlog. I wanted to let you know that we are marking this issue as stale.
From what I understand, you are encountering an error when trying to pass the 'chat_history' to the agent in your Python code. You provided some additional details about the error and the configuration of the tools chain. It seems that removing a certain configuration option throws another error.
Before we close this issue, we wanted to check if it is still relevant to the latest version of the LangChain repository. If it is, please let us know by commenting on the issue. Otherwise, feel free to close the issue yourself, or it will be automatically closed in 7 days.
Thank you for your understanding, and please don't hesitate to reach out if you have any further questions or concerns.