Skip to content

Commit 57ac2a0

Browse files
feat(provider): add AdaL (SylphAI) as a built-in provider
Add AdaL CLI by SylphAI as a new provider option in ForgeCode. AdaL is registered as an OpenAI-compatible provider with api.sylph.ai endpoints, enabling ForgeCode users to access AdaL's models via API key auth. Changes: - Add 'adal' entry to provider.json with OpenAI response type - Add ProviderId::ADAL constant to forge_domain - Wire up display_name ("AdaL"), FromStr, and built_in_providers() - Add missing FromStr arms for vertex_ai_anthropic, bedrock, opencode_zen - Add unit tests for ADAL display name, from_str, and built_in_providers Co-Authored-By: ForgeCode <noreply@forgecode.dev>
1 parent 58d0df9 commit 57ac2a0

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
@@ -73,6 +73,7 @@ impl ProviderId {
7373
pub const FIREWORKS_AI: ProviderId = ProviderId(Cow::Borrowed("fireworks-ai"));
7474
pub const NOVITA: ProviderId = ProviderId(Cow::Borrowed("novita"));
7575
pub const GOOGLE_AI_STUDIO: ProviderId = ProviderId(Cow::Borrowed("google_ai_studio"));
76+
pub const ADAL: ProviderId = ProviderId(Cow::Borrowed("adal"));
7677

7778
/// Returns all built-in provider IDs
7879
///
@@ -106,6 +107,7 @@ impl ProviderId {
106107
ProviderId::FIREWORKS_AI,
107108
ProviderId::NOVITA,
108109
ProviderId::GOOGLE_AI_STUDIO,
110+
ProviderId::ADAL,
109111
]
110112
}
111113

@@ -132,6 +134,7 @@ impl ProviderId {
132134
"fireworks-ai" => "FireworksAI".to_string(),
133135
"novita" => "Novita".to_string(),
134136
"google_ai_studio" => "GoogleAIStudio".to_string(),
137+
"adal" => "AdaL".to_string(),
135138
_ => {
136139
// For other providers, use UpperCamelCase conversion
137140
use convert_case::{Case, Casing};
@@ -176,7 +179,11 @@ impl std::str::FromStr for ProviderId {
176179
"codex" => ProviderId::CODEX,
177180
"fireworks-ai" => ProviderId::FIREWORKS_AI,
178181
"novita" => ProviderId::NOVITA,
182+
"vertex_ai_anthropic" => ProviderId::VERTEX_AI_ANTHROPIC,
183+
"bedrock" => ProviderId::BEDROCK,
184+
"opencode_zen" => ProviderId::OPENCODE_ZEN,
179185
"google_ai_studio" => ProviderId::GOOGLE_AI_STUDIO,
186+
"adal" => ProviderId::ADAL,
180187
// For custom providers, use Cow::Owned to avoid memory leaks
181188
custom => ProviderId(Cow::Owned(custom.to_string())),
182189
};
@@ -581,6 +588,24 @@ mod tests {
581588
assert_eq!(actual, expected);
582589
}
583590

591+
#[test]
592+
fn test_adal_from_str() {
593+
let actual = ProviderId::from_str("adal").unwrap();
594+
let expected = ProviderId::ADAL;
595+
assert_eq!(actual, expected);
596+
}
597+
598+
#[test]
599+
fn test_adal_display_name() {
600+
assert_eq!(ProviderId::ADAL.to_string(), "AdaL");
601+
}
602+
603+
#[test]
604+
fn test_adal_in_built_in_providers() {
605+
let built_in = ProviderId::built_in_providers();
606+
assert!(built_in.contains(&ProviderId::ADAL));
607+
}
608+
584609
#[test]
585610
fn test_io_intelligence() {
586611
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
@@ -3099,5 +3099,14 @@
30993099
"input_modalities": ["text"]
31003100
}
31013101
]
3102+
},
3103+
{
3104+
"id": "adal",
3105+
"api_key_vars": "ADAL_API_KEY",
3106+
"url_param_vars": [],
3107+
"response_type": "OpenAI",
3108+
"url": "https://api.sylph.ai/v1/chat/completions",
3109+
"models": "https://api.sylph.ai/v1/models",
3110+
"auth_methods": ["api_key"]
31023111
}
31033112
]

0 commit comments

Comments
 (0)