Skip to main content

Module protocol

Module protocol 

Source
Expand description

Protocol abstraction — unified interface for remote model API providers.

Each provider (OpenAI, Anthropic, Google) implements ProtocolHandler, which owns message formatting, request building, response parsing, and streaming. RemoteBackend becomes a thin dispatcher.

Structs§

AnthropicHandler
ApiRequest
Unified request parameters for any protocol.
ApiResponse
Unified response from any protocol.
AzureOpenAiHandler
GoogleHandler
OpenAiHandler

Traits§

ProtocolHandler
Protocol handler trait — each provider implements this.

Functions§

google_url
Build the full Google API URL with model and key.
handler_for
Get the appropriate protocol handler for an API protocol.