How to you add context to be passed along with agent.run in ReAct LangChain framework
Asked Answered
C

1

7

I've previously built a pdf searching tool in LangChain which uses the chain.run(input_documents=, question=) syntax to ask the model questions along with context from that pdf. I want to integrate this with the agents provided by langchain. I am using the syntax agent.run('Question')

I am not able to find links to integrate the two methods.

Cliff answered 19/7, 2023 at 10:20 Comment(0)
S
0

How do solve it?

Did you try using the result of the chain as a text input for the agent? The syntax should looks like:

agent_input = chain.run(input_documents=, question=)\n agent(agent_input+"question")

Sonneteer answered 28/3 at 18:11 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.