Custom Agents
Agent is a simple function that gets called with agent’s input and context. This abstraction allows you to do pretty much anything, such as prompting an LLM of your choice with SDK of your choice or executing local functions.
In this example, we will define an agent that repeats given flow 3 times and then returns all the results.
In practice, the flow will look like this.
Implementing the agent
Since agent is a simple function, we can define it as a regular function.
This will simply return an array of results from the nested flow.