Find answers from the community

Updated 8 months ago

Can I use the Query Pipeline as a query

Can I use the Query Pipeline as a query tool?
L
d
3 comments
You can use anything as a tool


Plain Text
from llama_index.core.tools import FunctionTool

def query(query_string: str) -> str:
  """Usefule for asking questions about X."""
  return query_pipeline.run(query_string=query_string)

tool = FunctionTool.from_defaults(fn=query)
And can you nest Query Pipelines?
You sure can -- a query pipeline can be a component in another query pipeline
Add a reply
Sign up and join the conversation on Discord