Find answers from the community

Updated 2 months ago

Hi all. Anyone has an idea how to use

Hi all. Anyone has an idea how to use QueryPipeline as tool (to use in Router?)
L
g
5 comments
You can do

from llama_index.core.tools import QueryEngineTool
tool = QueryEngineTool(query_engine=query_engine, metadata=...)
I think since the query pipeline is not a query engine, this won't work? (Unless I missed that in the base class lol)
more like this:

tool = QueryEngineTool(query_engine=AgentRunner(
agent_worker=QueryPipelineAgentWorker(pipeline=get_query_pipeline()))
)
I think the custom query engine approach is slightly more correct imo -- no need to bring an agent or memory into this
Add a reply
Sign up and join the conversation on Discord