Skip to main content

Module providers

Module providers 

Source

Modules§

anthropic
openai

Structs§

ChatRequest
ChatResponse
Message
ServerTool
Server-side tool definition. These tools are executed by the API provider rather than by the client. Currently only web_search_tool is supported.
Usage
Token accounting for one provider turn. input_tokens already includes cached/uncached portions combined — when providers expose cache details separately we capture them here so callers can report cache effectiveness.
WebSearchContent
Content returned by the server-side web search tool.
WebSearchResultItem

Enums§

ContentBlock
MessageContent
ProviderType
Provider type enumeration for factory creation.
Role
StopReason
StreamEvent
Incremental events emitted during a streaming chat turn.

Traits§

Provider

Functions§

create_minimal_provider
Create a minimal provider using full configuration chain. Uses the same config loading as main agent: env vars > ~/.matrix/config.json > ~/.claude/settings.json Suitable for subagents and background tasks.
create_provider
Create a provider instance based on type and configuration. This is the recommended way to obtain a Provider instance.
create_provider_with_headers
Create a provider with extra headers support.
infer_provider_type
Infer provider type from model name. Returns Anthropic for Claude models, OpenAI for GPT models.