clean models manager (#9168)

Have only the following Methods:
- `list_models`: getting current available models
- `try_list_models`: sync version no refresh for tui use
- `get_default_model`: get the default model (should be tightened to
core and received on session configuration)
- `get_model_info`: get `ModelInfo` for a specific model (should be
tightened to core but used in tests)
- `refresh_if_new_etag`: trigger refresh on different etags

Also move the cache to its own struct
This commit is contained in:
Ahmed Ibrahim
2026-01-13 16:55:33 -08:00
committed by GitHub
parent ebbbee70c6
commit 7e33ac7eb6
12 changed files with 404 additions and 273 deletions

View File

@@ -138,8 +138,15 @@ impl ThreadManager {
self.state.models_manager.clone()
}
pub async fn list_models(&self, config: &Config) -> Vec<ModelPreset> {
self.state.models_manager.list_models(config).await
pub async fn list_models(
&self,
config: &Config,
refresh_strategy: crate::models_manager::manager::RefreshStrategy,
) -> Vec<ModelPreset> {
self.state
.models_manager
.list_models(config, refresh_strategy)
.await
}
pub async fn list_thread_ids(&self) -> Vec<ThreadId> {