Skip to contents

Creates a new agent with the specified name and provider.

Usage

new_agent(name, provider, approval_callback = NULL, ...)

Arguments

name

Character string specifying the agent name.

provider

An object of class provider or a function that returns a provider.

approval_callback

Optional function for human approval of tool calls. Should accept a tool_info parameter and return TRUE/FALSE or a character string.

...

Additional arguments passed to methods.

Value

An object of class "agent"

Details

The provider argument can be either a provider object or a function that returns a provider object. If a function is provided, it will be called with no arguments and the result will be used as the provider. This is recommended so agents are isolated from each other and do not share state as they would with an instance of a provider.