Enable runtime access to provider name (#5399)
This commit is contained in:
@@ -24,6 +24,8 @@ pub const GEMINI_CLI_DOC_URL: &str = "https://ai.google.dev/gemini-api/docs";
|
||||
pub struct GeminiCliProvider {
|
||||
command: String,
|
||||
model: ModelConfig,
|
||||
#[serde(skip)]
|
||||
name: String,
|
||||
}
|
||||
|
||||
impl GeminiCliProvider {
|
||||
@@ -42,6 +44,7 @@ impl GeminiCliProvider {
|
||||
Ok(Self {
|
||||
command: resolved_command,
|
||||
model,
|
||||
name: Self::metadata().name,
|
||||
})
|
||||
}
|
||||
|
||||
@@ -311,6 +314,10 @@ impl Provider for GeminiCliProvider {
|
||||
)
|
||||
}
|
||||
|
||||
fn get_name(&self) -> &str {
|
||||
&self.name
|
||||
}
|
||||
|
||||
fn get_model_config(&self) -> ModelConfig {
|
||||
// Return the model config with appropriate context limit for Gemini models
|
||||
self.model.clone()
|
||||
|
||||
Reference in New Issue
Block a user