Skip to main content

Module coordinator

Module coordinator 

Source
Expand description

Multi-turn tool coordinator — data types and runtime.

Provides a provider-agnostic orchestration layer for agent tool-calling loops: send a prompt with tool definitions, handle tool call requests, execute tools, feed results back, repeat until the model produces a final response or hits an iteration cap.

Types reused from crate::agent:

Types defined here:

§Design notes

  • ToolCallRecord is reused from crate::agent rather than duplicated. Failed tool calls land in result as a {"error": "..."} JSON object with success: false, matching pawan’s existing agent loop — there’s no separate error field on the record.
  • ConversationMessage::tool_call_id is only populated on Role::Tool turns and links the result back to the assistant message that requested it.

Re-exports§

pub use types::*;

Modules§

types
Coordinator wire types — ToolCallingConfig, FinishReason, ConversationMessage, CoordinatorResult

Structs§

ToolCoordinator
Runtime that drives the LLM + tool-calling loop.