(model_id: &str, os: &Os)
| 161 | } |
| 162 | |
| 163 | pub async fn get_model_info(model_id: &str, os: &Os) -> Result<ModelInfo, ChatError> { |
| 164 | let (models, _) = get_available_models(os).await?; |
| 165 | |
| 166 | models |
| 167 | .into_iter() |
| 168 | .find(|m| m.model_id == model_id) |
| 169 | .ok_or_else(|| ChatError::Custom(format!("Model '{}' not found", model_id).into())) |
| 170 | } |
| 171 | |
| 172 | /// Get available models with caching support |
| 173 | pub async fn get_available_models(os: &Os) -> Result<(Vec<ModelInfo>, ModelInfo), ChatError> { |
no test coverage detected