Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions crates/forge_domain/src/provider.rs
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ impl ProviderId {
pub const OPENCODE_ZEN: ProviderId = ProviderId(Cow::Borrowed("opencode_zen"));
pub const FIREWORKS_AI: ProviderId = ProviderId(Cow::Borrowed("fireworks-ai"));
pub const NOVITA: ProviderId = ProviderId(Cow::Borrowed("novita"));
pub const GOOGLE_AI_STUDIO: ProviderId = ProviderId(Cow::Borrowed("google_ai_studio"));

/// Returns all built-in provider IDs
///
Expand Down Expand Up @@ -104,6 +105,7 @@ impl ProviderId {
ProviderId::OPENCODE_ZEN,
ProviderId::FIREWORKS_AI,
ProviderId::NOVITA,
ProviderId::GOOGLE_AI_STUDIO,
]
}

Expand All @@ -129,6 +131,7 @@ impl ProviderId {
"codex" => "Codex".to_string(),
"fireworks-ai" => "FireworksAI".to_string(),
"novita" => "Novita".to_string(),
"google_ai_studio" => "GoogleAIStudio".to_string(),
_ => {
// For other providers, use UpperCamelCase conversion
use convert_case::{Case, Casing};
Expand Down Expand Up @@ -173,6 +176,7 @@ impl std::str::FromStr for ProviderId {
"codex" => ProviderId::CODEX,
"fireworks-ai" => ProviderId::FIREWORKS_AI,
"novita" => ProviderId::NOVITA,
"google_ai_studio" => ProviderId::GOOGLE_AI_STUDIO,
// For custom providers, use Cow::Owned to avoid memory leaks
custom => ProviderId(Cow::Owned(custom.to_string())),
};
Expand Down Expand Up @@ -544,6 +548,7 @@ mod tests {
assert_eq!(ProviderId::IO_INTELLIGENCE.to_string(), "IOIntelligence");
assert_eq!(ProviderId::CODEX.to_string(), "Codex");
assert_eq!(ProviderId::FIREWORKS_AI.to_string(), "FireworksAI");
assert_eq!(ProviderId::GOOGLE_AI_STUDIO.to_string(), "GoogleAIStudio");
}

#[test]
Expand All @@ -566,6 +571,14 @@ mod tests {
assert!(built_in.contains(&ProviderId::CODEX));
assert!(built_in.contains(&ProviderId::OPENAI_RESPONSES_COMPATIBLE));
assert!(built_in.contains(&ProviderId::FIREWORKS_AI));
assert!(built_in.contains(&ProviderId::GOOGLE_AI_STUDIO));
}

#[test]
fn test_google_ai_studio_from_str() {
let actual = ProviderId::from_str("google_ai_studio").unwrap();
let expected = ProviderId::GOOGLE_AI_STUDIO;
assert_eq!(actual, expected);
}

#[test]
Expand Down
80 changes: 80 additions & 0 deletions crates/forge_repo/src/provider/provider.json
Original file line number Diff line number Diff line change
Expand Up @@ -1888,6 +1888,86 @@
],
"auth_methods": ["google_adc"]
},
{
"id": "google_ai_studio",
"api_key_vars": "GEMINI_API_KEY",
"url_param_vars": [],
"response_type": "Google",
"url": "https://generativelanguage.googleapis.com/v1beta",
"models": [
{
"id": "gemini-3.1-pro-preview",
"name": "Gemini 3.1 Pro Preview",
"description": "Most capable Gemini model with advanced reasoning",
"context_length": 1000000,
"tools_supported": true,
"supports_parallel_tool_calls": true,
"supports_reasoning": true,
"input_modalities": ["text", "image"]
},
{
"id": "gemini-3.1-flash-lite-preview",
"name": "Gemini 3.1 Flash Lite Preview",
"description": "Cost-efficient Gemini model optimized for high-volume, low latency use cases",
"context_length": 1000000,
"tools_supported": true,
"supports_parallel_tool_calls": true,
"supports_reasoning": true,
"input_modalities": ["text", "image"]
},
{
"id": "gemini-3-pro-preview",
"name": "Gemini 3 Pro Preview",
"description": "Advanced Gemini model with strong reasoning capabilities",
"context_length": 1000000,
"tools_supported": true,
"supports_parallel_tool_calls": true,
"supports_reasoning": true,
"input_modalities": ["text", "image"]
},
{
"id": "gemini-3-flash-preview",
"name": "Gemini 3 Flash Preview",
"description": "Fast Gemini model with thinking support",
"context_length": 1000000,
"tools_supported": true,
"supports_parallel_tool_calls": true,
"supports_reasoning": true,
"input_modalities": ["text", "image"]
},
{
"id": "gemini-2.5-pro",
"name": "Gemini 2.5 Pro",
"description": "Powerful Gemini model for complex tasks with thinking",
"context_length": 1000000,
"tools_supported": true,
"supports_parallel_tool_calls": true,
"supports_reasoning": true,
"input_modalities": ["text", "image"]
},
{
"id": "gemini-2.5-flash",
"name": "Gemini 2.5 Flash",
"description": "Fast and efficient Gemini model with thinking",
"context_length": 1000000,
"tools_supported": true,
"supports_parallel_tool_calls": true,
"supports_reasoning": true,
"input_modalities": ["text", "image"]
},
{
"id": "gemini-2.0-flash",
"name": "Gemini 2.0 Flash",
"description": "Fast and versatile Gemini model",
"context_length": 1000000,
"tools_supported": true,
"supports_parallel_tool_calls": true,
"supports_reasoning": false,
"input_modalities": ["text", "image"]
}
],
"auth_methods": ["api_key"]
},
{
"id": "minimax",
"api_key_vars": "MINIMAX_API_KEY",
Expand Down
Loading