webclaw/crates/webclaw-llm/src/lib.rs
Valerio d9e3d0b2bb feat(llm): add Gemini provider and fix stale Anthropic default model
Adds a Google Gemini provider (Generative Language API) to the chain, ordered Ollama -> OpenAI -> Gemini -> Anthropic so Google credits are preferred with Anthropic as last-resort fallback. System->systemInstruction, assistant->model, json_mode->responseMimeType; model name validated before URL interpolation; maxOutputTokens defaults high for 2.5 thinking models. Also fixes AnthropicProvider default (retired claude-sonnet-4-20250514 -> 404); now claude-sonnet-4-6, honors ANTHROPIC_MODEL.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-16 15:52:37 +02:00

19 lines
603 B
Rust

/// webclaw-llm: LLM integration with local-first hybrid architecture.
///
/// Provider chain tries Ollama (local) first, falls back to OpenAI, then Gemini, then Anthropic.
/// Provides schema-based extraction, prompt extraction, and summarization
/// on top of webclaw-core's content pipeline.
pub mod chain;
pub mod clean;
pub mod error;
pub mod extract;
pub mod provider;
pub mod providers;
pub mod summarize;
#[cfg(test)]
pub(crate) mod testing;
pub use chain::ProviderChain;
pub use clean::strip_thinking_tags;
pub use error::LlmError;
pub use provider::{CompletionRequest, LlmProvider, Message};