Enable runtime access to provider name (#5399)
This commit is contained in:
@@ -23,6 +23,8 @@ pub const CURSOR_AGENT_DOC_URL: &str = "https://docs.cursor.com/en/cli/overview"
|
||||
pub struct CursorAgentProvider {
|
||||
command: String,
|
||||
model: ModelConfig,
|
||||
#[serde(skip)]
|
||||
name: String,
|
||||
}
|
||||
|
||||
impl CursorAgentProvider {
|
||||
@@ -41,6 +43,7 @@ impl CursorAgentProvider {
|
||||
Ok(Self {
|
||||
command: resolved_command,
|
||||
model,
|
||||
name: Self::metadata().name,
|
||||
})
|
||||
}
|
||||
|
||||
@@ -395,6 +398,10 @@ impl Provider for CursorAgentProvider {
|
||||
)
|
||||
}
|
||||
|
||||
fn get_name(&self) -> &str {
|
||||
&self.name
|
||||
}
|
||||
|
||||
fn get_model_config(&self) -> ModelConfig {
|
||||
// Return the model config with appropriate context limit for Cursor models
|
||||
self.model.clone()
|
||||
|
||||
Reference in New Issue
Block a user