Skip to main content

run_agent_turn

Function run_agent_turn 

Source
pub async fn run_agent_turn(
    manifest: &AgentManifest,
    history: &mut Vec<Message>,
    query: &str,
    driver: &dyn LlmDriver,
    tools: &ToolRegistry,
    memory: &dyn MemorySubstrate,
    stream_tx: Option<Sender<StreamEvent>>,
) -> Result<AgentLoopResult, AgentError>
Expand description

Run one agent turn with full conversation history (multi-turn).

Appends the new query and all resulting messages (tool calls, assistant response) to history. On next call, prior turns provide context so the agent can maintain coherent multi-turn conversation.

This is the core primitive for the REPL — each user prompt is one turn, and history accumulates across the session.