Skip to content

Commit d08324e

Browse files
chindris-mihai-alexandruforge-code-agentamitksingh1490
authored
fix(provider): add AdaL (SylphAI) as a built-in provider (#2868)
Co-authored-by: ForgeCode <noreply@forgecode.dev> Co-authored-by: Amit Singh <amitksingh1490@gmail.com>
1 parent 3a61871 commit d08324e

2 files changed

Lines changed: 34 additions & 0 deletions

File tree

crates/forge_domain/src/provider.rs

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,7 @@ impl ProviderId {
7575
pub const NOVITA: ProviderId = ProviderId(Cow::Borrowed("novita"));
7676
pub const GOOGLE_AI_STUDIO: ProviderId = ProviderId(Cow::Borrowed("google_ai_studio"));
7777
pub const MODAL: ProviderId = ProviderId(Cow::Borrowed("modal"));
78+
pub const ADAL: ProviderId = ProviderId(Cow::Borrowed("adal"));
7879

7980
/// Returns all built-in provider IDs
8081
///
@@ -110,6 +111,7 @@ impl ProviderId {
110111
ProviderId::NOVITA,
111112
ProviderId::GOOGLE_AI_STUDIO,
112113
ProviderId::MODAL,
114+
ProviderId::ADAL,
113115
]
114116
}
115117

@@ -139,6 +141,7 @@ impl ProviderId {
139141
"novita" => "Novita".to_string(),
140142
"google_ai_studio" => "GoogleAIStudio".to_string(),
141143
"modal" => "Modal".to_string(),
144+
"adal" => "AdaL".to_string(),
142145
_ => {
143146
// For other providers, use UpperCamelCase conversion
144147
use convert_case::{Case, Casing};
@@ -184,8 +187,12 @@ impl std::str::FromStr for ProviderId {
184187
"opencode_go" => ProviderId::OPENCODE_GO,
185188
"fireworks-ai" => ProviderId::FIREWORKS_AI,
186189
"novita" => ProviderId::NOVITA,
190+
"vertex_ai_anthropic" => ProviderId::VERTEX_AI_ANTHROPIC,
191+
"bedrock" => ProviderId::BEDROCK,
192+
"opencode_zen" => ProviderId::OPENCODE_ZEN,
187193
"google_ai_studio" => ProviderId::GOOGLE_AI_STUDIO,
188194
"modal" => ProviderId::MODAL,
195+
"adal" => ProviderId::ADAL,
189196
// For custom providers, use Cow::Owned to avoid memory leaks
190197
custom => ProviderId(Cow::Owned(custom.to_string())),
191198
};
@@ -607,6 +614,13 @@ mod tests {
607614
assert_eq!(actual, expected);
608615
}
609616

617+
#[test]
618+
fn test_adal_from_str() {
619+
let actual = ProviderId::from_str("adal").unwrap();
620+
let expected = ProviderId::ADAL;
621+
assert_eq!(actual, expected);
622+
}
623+
610624
#[test]
611625
fn test_modal_display_name() {
612626
assert_eq!(ProviderId::MODAL.to_string(), "Modal");
@@ -618,6 +632,17 @@ mod tests {
618632
assert!(built_in.contains(&ProviderId::MODAL));
619633
}
620634

635+
#[test]
636+
fn test_adal_display_name() {
637+
assert_eq!(ProviderId::ADAL.to_string(), "AdaL");
638+
}
639+
640+
#[test]
641+
fn test_adal_in_built_in_providers() {
642+
let built_in = ProviderId::built_in_providers();
643+
assert!(built_in.contains(&ProviderId::ADAL));
644+
}
645+
621646
#[test]
622647
fn test_io_intelligence() {
623648
let fixture = "test_key";

crates/forge_repo/src/provider/provider.json

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3329,5 +3329,14 @@
33293329
}
33303330
],
33313331
"auth_methods": ["api_key"]
3332+
},
3333+
{
3334+
"id": "adal",
3335+
"api_key_vars": "ADAL_API_KEY",
3336+
"url_param_vars": [],
3337+
"response_type": "OpenAI",
3338+
"url": "https://api.sylph.ai/v1/chat/completions",
3339+
"models": "https://api.sylph.ai/v1/models",
3340+
"auth_methods": ["api_key"]
33323341
}
33333342
]

0 commit comments

Comments
 (0)