Merge remote-tracking branch 'origin/feat/whatsapp-email-channels'
# Conflicts: # Cargo.lock # src/config/schema.rs # src/cron/mod.rs # src/security/secrets.rs # src/service/mod.rs
This commit is contained in:
commit
47c5006de4
12 changed files with 1689 additions and 143 deletions
|
|
@ -1,5 +1,6 @@
|
|||
pub mod anthropic;
|
||||
pub mod compatible;
|
||||
pub mod gemini;
|
||||
pub mod ollama;
|
||||
pub mod openai;
|
||||
pub mod openrouter;
|
||||
|
|
@ -100,6 +101,9 @@ pub fn create_provider(name: &str, api_key: Option<&str>) -> anyhow::Result<Box<
|
|||
"ollama" => Ok(Box::new(ollama::OllamaProvider::new(
|
||||
api_key.filter(|k| !k.is_empty()),
|
||||
))),
|
||||
"gemini" | "google" | "google-gemini" => {
|
||||
Ok(Box::new(gemini::GeminiProvider::new(api_key)))
|
||||
}
|
||||
|
||||
// ── OpenAI-compatible providers ──────────────────────
|
||||
"venice" => Ok(Box::new(OpenAiCompatibleProvider::new(
|
||||
|
|
@ -253,6 +257,15 @@ mod tests {
|
|||
assert!(create_provider("ollama", None).is_ok());
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn factory_gemini() {
|
||||
assert!(create_provider("gemini", Some("test-key")).is_ok());
|
||||
assert!(create_provider("google", Some("test-key")).is_ok());
|
||||
assert!(create_provider("google-gemini", Some("test-key")).is_ok());
|
||||
// Should also work without key (will try CLI auth)
|
||||
assert!(create_provider("gemini", None).is_ok());
|
||||
}
|
||||
|
||||
// ── OpenAI-compatible providers ──────────────────────────
|
||||
|
||||
#[test]
|
||||
|
|
@ -445,6 +458,7 @@ mod tests {
|
|||
"anthropic",
|
||||
"openai",
|
||||
"ollama",
|
||||
"gemini",
|
||||
"venice",
|
||||
"vercel",
|
||||
"cloudflare",
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue