Find answers from the community

Updated 8 months ago

Hey! Does anyone know if a query

Hey! Does anyone know if a query pipeline can take different paths or routes via an if condition or similar? Or does it have to be done on the whole set of functions?
L
a
9 comments
Yea, using conditional links

Plain Text
qp.add_link(
    "a",
    "b",
    condition_fn=lambda inputs: not inputs["done"],
)
@Logan M hey! thanks for your answer! Is there any more documentation regarding this?
The example above is really all you need though tbh
@Logan M does it only work with an agent pipeline? or can you do it with a normal query pipeline (meaning, using FnComponent instead of AgentFnComponent)
You can do it with whatever components you want πŸ‘
Basically it just runs the condition function using the outputs of a (i.e. the inputs of b) to see if the link should actually be followed
Add a reply
Sign up and join the conversation on Discord