Skip to content
Open
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
25 changes: 25 additions & 0 deletions crates/forge_domain/src/provider.rs
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ impl ProviderId {
pub const NOVITA: ProviderId = ProviderId(Cow::Borrowed("novita"));
pub const GOOGLE_AI_STUDIO: ProviderId = ProviderId(Cow::Borrowed("google_ai_studio"));
pub const MODAL: ProviderId = ProviderId(Cow::Borrowed("modal"));
pub const ADAL: ProviderId = ProviderId(Cow::Borrowed("adal"));

/// Returns all built-in provider IDs
///
Expand Down Expand Up @@ -110,6 +111,7 @@ impl ProviderId {
ProviderId::NOVITA,
ProviderId::GOOGLE_AI_STUDIO,
ProviderId::MODAL,
ProviderId::ADAL,
]
}

Expand Down Expand Up @@ -139,6 +141,7 @@ impl ProviderId {
"novita" => "Novita".to_string(),
"google_ai_studio" => "GoogleAIStudio".to_string(),
"modal" => "Modal".to_string(),
"adal" => "AdaL".to_string(),
_ => {
// For other providers, use UpperCamelCase conversion
use convert_case::{Case, Casing};
Expand Down Expand Up @@ -184,8 +187,12 @@ impl std::str::FromStr for ProviderId {
"opencode_go" => ProviderId::OPENCODE_GO,
"fireworks-ai" => ProviderId::FIREWORKS_AI,
"novita" => ProviderId::NOVITA,
"vertex_ai_anthropic" => ProviderId::VERTEX_AI_ANTHROPIC,
"bedrock" => ProviderId::BEDROCK,
"opencode_zen" => ProviderId::OPENCODE_ZEN,
"google_ai_studio" => ProviderId::GOOGLE_AI_STUDIO,
"modal" => ProviderId::MODAL,
"adal" => ProviderId::ADAL,
// For custom providers, use Cow::Owned to avoid memory leaks
custom => ProviderId(Cow::Owned(custom.to_string())),
};
Expand Down Expand Up @@ -607,6 +614,13 @@ mod tests {
assert_eq!(actual, expected);
}

#[test]
fn test_adal_from_str() {
let actual = ProviderId::from_str("adal").unwrap();
let expected = ProviderId::ADAL;
assert_eq!(actual, expected);
}

#[test]
fn test_modal_display_name() {
assert_eq!(ProviderId::MODAL.to_string(), "Modal");
Expand All @@ -618,6 +632,17 @@ mod tests {
assert!(built_in.contains(&ProviderId::MODAL));
}

#[test]
fn test_adal_display_name() {
assert_eq!(ProviderId::ADAL.to_string(), "AdaL");
}

#[test]
fn test_adal_in_built_in_providers() {
let built_in = ProviderId::built_in_providers();
assert!(built_in.contains(&ProviderId::ADAL));
}

#[test]
fn test_io_intelligence() {
let fixture = "test_key";
Expand Down
9 changes: 9 additions & 0 deletions crates/forge_repo/src/provider/provider.json
Original file line number Diff line number Diff line change
Expand Up @@ -3279,5 +3279,14 @@
}
],
"auth_methods": ["api_key"]
},
{
"id": "adal",
"api_key_vars": "ADAL_API_KEY",
"url_param_vars": [],
"response_type": "OpenAI",
"url": "https://api.sylph.ai/v1/chat/completions",
"models": "https://api.sylph.ai/v1/models",
"auth_methods": ["api_key"]
}
]
Loading