My code uses "wikipedia" to search for the relevant content. Below is the code
Load tools
tools = load_tools(
["wikipedia"],
llm=llm)
agent = initialize_agent(
tools,
llm,
agent=AgentType.CHAT_ZERO_SHOT_REACT_DESCRIPTION,
handle_parsing_errors=True,
verbose=False
)
out = agent(f"Does {var_1} cause {var_2} or the other way around?.")
Instead of "wikipedia", I want to use my own pdf document that is available in my local. Can anyone help me in doing this?
I have tried using the below code
from langchain.document_loaders import PyPDFium2Loader
loader = PyPDFium2Loader("hunter-350-dual-channel.pdf")
data = loader.load()
but i am not sure how to include this in the agent.
You can use RetrievalQA to generate a tool.
Just like below: