Log in
Log into community
Find answers from the community
View all posts
Related posts
Did this answer your question?
๐
๐
๐
Powered by
Hall
Inactive
Updated 2 months ago
0
Follow
Hi all. Anyone has an idea how to use
Hi all. Anyone has an idea how to use
Inactive
0
Follow
m
mato
9 months ago
ยท
Hi all. Anyone has an idea how to use QueryPipeline as tool (to use in Router?)
L
g
5 comments
Share
Open in Discord
L
Logan M
9 months ago
create a query engine from the pipeline
https://docs.llamaindex.ai/en/stable/examples/query_engine/custom_query_engine.html#defining-a-custom-query-engine
g
gyx119
9 months ago
You can do
from llama_index.core.tools import QueryEngineTool
tool = QueryEngineTool(query_engine=query_engine, metadata=...)
L
Logan M
9 months ago
I think since the query pipeline is not a query engine, this won't work? (Unless I missed that in the base class lol)
g
gyx119
9 months ago
more like this:
tool = QueryEngineTool(query_engine=AgentRunner(
agent_worker=QueryPipelineAgentWorker(pipeline=get_query_pipeline()))
)
L
Logan M
9 months ago
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
Join on Discord