Expand description
Provider layer. The Brain trait and the model adapters (Anthropic,
OpenAI-compatible, Ollama, Responses) live in the sparrow-providers crate
so the heavy adapter code compiles once and is cached — touching the engine
no longer recompiles them. Re-exported here so existing crate::provider::*
imports keep working unchanged.
detect (first-run provider detection) stays in the binary crate because it
depends on the config provider registry and the onboarding wizard.
Modules§
- anthropic
- detect
- Provider auto-detection: scan environment for API keys, test connectivity with lightweight API calls, rank providers by cost tier (free > paid), and return a list of ready-to-use providers.
- discovery
- ollama
- openai_
compat - responses
- sse_
buffer - Reassemble newline-delimited frames across arbitrary network chunks.
- tool_
markup - Fallback parser for tool calls emitted as inline markup instead of the provider’s native function-calling JSON.
Structs§
Enums§
Traits§
- Brain
- Uniform interface over every model vendor. Normalizes messages, streaming, and tool-calling so the rest of the system is vendor-agnostic.