Expand description
OpenAI-compatible chat-completions adapter.
Targets the /chat/completions shape that OpenAI, Azure (via gateway),
GLM (Zhipu), DeepSeek, Moonshot, Together, Ollama and many others speak.
The only thing that varies is the base URL + model name + API key, which
is all driven by config.
§Deferred tool loading (software-layer ToolSearch)
This provider implements the same deferred-tool pattern as AnthropicProvider
but in pure software — no API-level defer_loading or tool_reference needed.
On each complete_with_search / stream_with_search call:
- Only eager tools +
ToolSearchToolare sent in the initial request. - If the model calls
ToolSearchTool, the query is resolved against the deferred list, the matched schemas are returned as plain JSON in atool_resultmessage, and a new request is sent with the matched tools appended to the eager list. - Capped at
max_search_roundsto prevent infinite loops.