Docs
CodeRabbit
Cloudflare
AG Grid
SerpAPI
Netlify
OpenRouter
Neon
WorkOS
Clerk
Electric
PowerSync
Sentry
Railway
Prisma
Strapi
Unkey
CodeRabbit
Cloudflare
AG Grid
SerpAPI
Netlify
OpenRouter
Neon
WorkOS
Clerk
Electric
PowerSync
Sentry
Railway
Prisma
Strapi
Unkey
Class References
Function References
Interface References
Type Alias References
Variable References
Interface References

AgentLoopState

Interface: AgentLoopState

Defined in: packages/typescript/ai/src/types.ts:631

State passed to agent loop strategy for determining whether to continue

Properties

finishReason

ts
finishReason: string | null;
finishReason: string | null;

Defined in: packages/typescript/ai/src/types.ts:637

Finish reason from the last response


iterationCount

ts
iterationCount: number;
iterationCount: number;

Defined in: packages/typescript/ai/src/types.ts:633

Current iteration count (0-indexed)


messages

ts
messages: ModelMessage<
  | string
  | ContentPart<unknown, unknown, unknown, unknown, unknown>[]
  | null>[];
messages: ModelMessage<
  | string
  | ContentPart<unknown, unknown, unknown, unknown, unknown>[]
  | null>[];

Defined in: packages/typescript/ai/src/types.ts:635

Current messages array