
Create a new agent
new_agent.RdCreates a new agent with the specified name and provider.
Arguments
- name
Character string specifying the agent name.
- provider
An object of class
provideror 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.
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.