Enderdog69
Enderdog692mo ago

How to make the agent trigger a function call, and depending on the function call, execute a branch?

To be more precise, as attached in the image, what I am trying to achieve is make the Agent do a function tool call, and upon completion of that call, invoke the exit condition and continue through the workflow depending on which function was called (Here get_type_reccomendations was called, then the get_type_reccomendations exit should be invoked) I haven't been able to achieve this. Everytime I come close to doing it, what happens is that the function call as well as the exit condition get invoked at the same time. And at the same time, I want the tool call and then exit to the branch something deterministic. How can this be achieved? Help would be really appreciated.
No description
4 Replies
W. Williams (SFT)
So your agent is more of a router?
Enderdog69
Enderdog69OP2mo ago
Yeah you can say, the desired workflow is that if the user wants some product recommendations, they would make a call to our backend which would provide the necessary products, and once that tool call is made by the agent, based on the returned values we would want to render the images in a carousel, and then the conversation would continue as normal.
W. Williams (SFT)
I personally haven't built one in VF. This should be doable. You could just route to an agent that had the tools to get the products and handle the carousel. Then route back to the router.
Enderdog69
Enderdog69OP2mo ago
ooh nice, let me try that Wanted to update, tried this, and it works! Thank you so much for recommending this solution. Was stuck on this for quite some time.

Did you find this page helpful?