Docs
Code Rabbit
Cloudflare
AG Grid
Netlify
Neon
WorkOS
Clerk
Convex
Electric
Sentry
Prisma
Strapi
Unkey
UI.dev
Code Rabbit
Cloudflare
AG Grid
Netlify
Neon
WorkOS
Clerk
Convex
Electric
Sentry
Prisma
Strapi
Unkey
UI.dev
Class References
Function References
Interface References
Type Alias References
Variable References
Type Alias References

AgentLoopStrategy

Type Alias: AgentLoopStrategy()

ts
type AgentLoopStrategy = (state) => boolean;
type AgentLoopStrategy = (state) => boolean;

Defined in: types.ts:560

Strategy function that determines whether the agent loop should continue

Parameters

state

AgentLoopState

Current state of the agent loop

Returns

boolean

true to continue looping, false to stop

Example

typescript
// Continue for up to 5 iterations
const strategy: AgentLoopStrategy = ({ iterationCount }) => iterationCount < 5;
// Continue for up to 5 iterations
const strategy: AgentLoopStrategy = ({ iterationCount }) => iterationCount < 5;