Skip to main content

Module agent_loop

Module agent_loop 

Source
Expand description

The agent loop (packages/agent/agent-loop.ts): stream an assistant response, execute any tool calls, feed results back, and repeat until the model stops.

Structs§

AgentLoopConfig
Configuration for the agent loop.

Functions§

agent_loop
Start an agent loop as a background task and return its event stream. The loop appends prompts to a copy of the context, runs to completion, and terminates with a single AgentEvent::AgentEnd carrying the final transcript. Each run is independent (the caller owns the live transcript).

Type Aliases§

AgentEventStream
A boxed async stream of agent events.