Enable runtime access to provider name (#5399)
This commit is contained in:
@@ -113,6 +113,8 @@ pub struct GithubCopilotProvider {
|
||||
#[serde(skip)]
|
||||
mu: tokio::sync::Mutex<RefCell<Option<CopilotState>>>,
|
||||
model: ModelConfig,
|
||||
#[serde(skip)]
|
||||
name: String,
|
||||
}
|
||||
|
||||
impl GithubCopilotProvider {
|
||||
@@ -127,6 +129,7 @@ impl GithubCopilotProvider {
|
||||
cache,
|
||||
mu,
|
||||
model,
|
||||
name: Self::metadata().name,
|
||||
})
|
||||
}
|
||||
|
||||
@@ -392,6 +395,10 @@ impl Provider for GithubCopilotProvider {
|
||||
)
|
||||
}
|
||||
|
||||
fn get_name(&self) -> &str {
|
||||
&self.name
|
||||
}
|
||||
|
||||
fn get_model_config(&self) -> ModelConfig {
|
||||
self.model.clone()
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user