Find answers from the community

Updated last year

Hey eveyone, I have a question regarding

At a glance
Hey eveyone, I have a question regarding Query Pipelines. I have ReAct agent which should use my query pipelines as tools and iterate over them. I do not know how can I give my query pipeline to the ReAct Agent as a tool. Appreciate any support
L
s
2 comments
ohhhh good point! I don't think this is currently possible actually, at least not directly

I would wrap it in a FunctionTool

Plain Text
from llama_index.core.tools import FunctionTool

def query_pipeline(input1: str, input2: str) -> str:
  """Useful for looking up information about X."""
  return str(pipeline.run(input1=input1, input2=input2))

tool = FunctionTool.from_defaults(fn=query_pipeline, name=<optional>, description=<optional>)
Thank you @Logan M . that is good point, will try it
Add a reply
Sign up and join the conversation on Discord