orchestrator
diapason.agents.orchestrator
¶
OrchestratorAgent — multi-turn agent with tool-calling loop.
Supports two modes:
- function_calling (default): Uses OpenAI-format tool definitions and
parses
tool_callsfrom the engine response. - structured: Uses a THOUGHT/TOOL/INPUT/FINAL_ANSWER text format (like ReAct) with a canonical system prompt from the orchestrator prompt registry. This is the format used by the SFT/GRPO training pipelines, making the Orchestrator a distinctive trainable agent type.
OrchestratorAgent
¶
Bases: ToolUsingAgent
Multi-turn agent that routes between tools and the LLM.
Implements a tool-calling loop:
1. Send messages with tool definitions to the engine.
2. If the response contains tool_calls, execute them and loop.
3. If no tool_calls, return the final answer.
4. Stop after max_turns iterations.
In structured mode the agent instead uses a
THOUGHT: / TOOL: / INPUT: / FINAL_ANSWER: text protocol
identical to the format used by the orchestrator SFT/GRPO
training pipelines.