fix: support LLM provider compatibility options

Closes #36
This commit is contained in:
Valerio 2026-05-06 11:36:53 +02:00
parent 86183b11e4
commit a3aa4bce6f
6 changed files with 193 additions and 16 deletions

View file

@ -260,7 +260,7 @@ struct Cli {
#[arg(long, env = "WEBCLAW_LLM_MODEL")]
llm_model: Option<String>,
/// Override the LLM base URL (Ollama or OpenAI-compatible)
/// Override the LLM base URL (Ollama, OpenAI-compatible, or Anthropic-compatible)
#[arg(long, env = "WEBCLAW_LLM_BASE_URL")]
llm_base_url: Option<String>,
@ -1919,8 +1919,9 @@ async fn build_llm_provider(cli: &Cli) -> Result<Box<dyn LlmProvider>, String> {
Ok(Box::new(provider))
}
"anthropic" => {
let provider = webclaw_llm::providers::anthropic::AnthropicProvider::new(
let provider = webclaw_llm::providers::anthropic::AnthropicProvider::with_base_url(
None,
cli.llm_base_url.clone(),
cli.llm_model.clone(),
)
.ok_or("ANTHROPIC_API_KEY not set")?;