Skip to main content

Basic Function Registration

Functions can be either sync or async. Keep them focused and single-purpose.
Basic Controller has all basic functionality you might need to interact with the browser already implemented.
Keep the function name and description short and concise. The Agent use the function solely based on the name and description. The stringified output of the action is passed to the Agent.

Browser-Aware Functions

For actions that need browser access, simply add the browser parameter inside the function parameters:

Structured Parameters with Zod

For complex actions, you can define parameter schemas using Zod:

Using Custom Actions with multiple agents

You can use the same controller for multiple agents.
The controller is stateless and can be used to register multiple actions and multiple agents.

Exclude functions

If you want less actions to be used by the agent, you can exclude them from the controller.
For more examples like file upload or notifications, visit examples/custom-functions.