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
@@ -24,6 +24,8 @@ pub const CLAUDE_CODE_DOC_URL: &str = "https://claude.ai/cli";
pub struct ClaudeCodeProvider {
command: String,
model: ModelConfig,
#[serde(skip)]
name: String,
}
impl ClaudeCodeProvider {
@@ -42,6 +44,7 @@ impl ClaudeCodeProvider {
Ok(Self {
command: resolved_command,
model,
name: Self::metadata().name,
})
}
@@ -463,6 +466,10 @@ impl Provider for ClaudeCodeProvider {
)
}
fn get_name(&self) -> &str {
&self.name
}
fn get_model_config(&self) -> ModelConfig {
// Return the model config with appropriate context limit for Claude models
self.model.clone()