mirror of
https://github.com/openai/codex.git
synced 2026-09-17 12:23:33 +00:00
Avoid unknown model warning for remote slugs
This commit is contained in:
@@ -149,13 +149,15 @@ impl ModelsManager {
|
||||
// todo(aibrahim): look if we can tighten it to pub(crate)
|
||||
/// Look up model metadata, applying remote overrides and config adjustments.
|
||||
pub async fn get_model_info(&self, model: &str, config: &Config) -> ModelInfo {
|
||||
let local = model_info::find_model_info_for_slug(model);
|
||||
let remote = self
|
||||
.get_remote_models(config)
|
||||
.await
|
||||
.into_iter()
|
||||
.find(|m| m.slug == model);
|
||||
let model = remote.unwrap_or(local);
|
||||
let model = match remote {
|
||||
Some(remote) => remote,
|
||||
None => model_info::find_model_info_for_slug(model),
|
||||
};
|
||||
model_info::with_config_overrides(model, config)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user