📚 API ReferenceLoops
<ActionLoop>
Autonomously execute actions.
Import
import { ActionLoop } from 'react-agents';
Usage
Add the component to your agent to initiate an action loop:
function MyAgent() {
return (
<Agent>
<ActionLoop
hint="Optional hint to guide the agent's actions"
actOpts={{ /* Optional action options */ }}
evaluator={customEvaluator} // Optional: Provide a custom evaluator
>
{/* Child components */}
</ActionLoop>
</Agent>
);
}
The agent will continue to loop and execute actions until the component is removed.
Props
hint?: string
- Optional hint to guide the agent's actionsactOpts?: object
- Optional configuration for action behaviorevaluator?: Evaluator
- Optional custom evaluator (cannot be used with hint/actOpts)