Skip to main content

Crate swink_agent_adapters

Crate swink_agent_adapters 

Source
Expand description

LLM provider adapters for swink-agent.

Provides StreamFn implementations for nine LLM providers. No provider is enabled by default; enable only what you need:

FeatureProvider
anthropicAnthropic Claude
openaiOpenAI GPT
ollamaOllama (local)
geminiGoogle Gemini
azureAzure OpenAI / AI Foundry
bedrockAWS Bedrock
mistralMistral AI
xaixAI Grok
proxyCustom SSE proxy

Use full or all to compile every provider adapter.

§Quick Start

use swink_agent_adapters::build_remote_connection_for_model;

let conn = build_remote_connection_for_model("claude-sonnet-4-6")?;

Modules§

classify
HTTP status code classification for LLM provider error handling.
convert
Shared message conversion utilities for LLM adapters.
sse
Shared SSE (Server-Sent Events) stream parser and adapter helpers.

Structs§

AnthropicStreamFn
A StreamFn implementation for the Anthropic Messages API.
AzureStreamFn
BedrockStreamFn
GeminiStreamFn
MistralStreamFn
A StreamFn implementation for the Mistral chat completions API.
OllamaStreamFn
A StreamFn implementation for Ollama’s /api/chat endpoint.
OpenAiStreamFn
A StreamFn implementation for OpenAI-compatible chat completions APIs.
ProxyStreamFn
A StreamFn implementation that proxies LLM calls over HTTP/SSE.
RemotePresetKey
XAiStreamFn

Enums§

AzureAuth
Authentication method for Azure OpenAI deployments.
RemoteModelConnectionError

Functions§

all_remote_presets
Returns all remote presets from the catalog, regardless of feature flags.
build_connection_from_preset
build_remote_connection
build_remote_connection_for_model
Builds a ModelConnection for a model identified by its model_id (e.g. "claude-sonnet-4-6", "gpt-5.4").
build_remote_connection_with_credential
Builds a ModelConnection for a preset key using an explicitly provided credential instead of reading it from the process environment.
is_provider_compiled
Returns true if the adapter for the given provider key is compiled in.
preset
Looks up a remote preset by its model_id (e.g. "claude-sonnet-4-6").
remote_presets
Returns remote presets filtered to only those whose provider adapter is compiled in. Use all_remote_presets to enumerate the full catalog regardless of compiled adapter support.