Enable runtime access to provider name (#5399)

This commit is contained in:
Will Pfleger
2025-10-28 14:21:24 -04:00
committed by GitHub
parent f1ad5490b6
commit 4d8c91efbd
25 changed files with 196 additions and 3 deletions
+7
View File
@@ -54,6 +54,7 @@ pub struct OpenAiProvider {
model: ModelConfig,
custom_headers: Option<HashMap<String, String>>,
supports_streaming: bool,
name: String,
}
impl OpenAiProvider {
@@ -107,6 +108,7 @@ impl OpenAiProvider {
model,
custom_headers,
supports_streaming: true,
name: Self::metadata().name,
})
}
@@ -163,6 +165,7 @@ impl OpenAiProvider {
model,
custom_headers: config.headers,
supports_streaming: config.supports_streaming.unwrap_or(true),
name: config.name.clone(),
})
}
@@ -201,6 +204,10 @@ impl Provider for OpenAiProvider {
)
}
fn get_name(&self) -> &str {
&self.name
}
fn get_model_config(&self) -> ModelConfig {
self.model.clone()
}