ui: Prioritize favorite models in model selection (#24766)
Updated model selection prioritization to include favorite models.
This commit is contained in:
@@ -545,7 +545,8 @@ class ModelsStore {
|
|||||||
* 1. Model from active conversation's last assistant response (if loaded)
|
* 1. Model from active conversation's last assistant response (if loaded)
|
||||||
* 2. Model from active conversation's last assistant response (if not loaded)
|
* 2. Model from active conversation's last assistant response (if not loaded)
|
||||||
* 3. First loaded model (not from active conversation)
|
* 3. First loaded model (not from active conversation)
|
||||||
* 4. First available model
|
* 4. A favorite model
|
||||||
|
* 5. First available model
|
||||||
*/
|
*/
|
||||||
async ensureFirstModelSelected(): Promise<void> {
|
async ensureFirstModelSelected(): Promise<void> {
|
||||||
if (this.selectedModelName) return;
|
if (this.selectedModelName) return;
|
||||||
@@ -574,6 +575,13 @@ class ModelsStore {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Try loading a favorite model
|
||||||
|
const favorite = this.favoriteModelIds.values().next()?.value
|
||||||
|
if (favorite) {
|
||||||
|
await this.selectModelById(favorite);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
// Fall back to the first available model
|
// Fall back to the first available model
|
||||||
await this.selectModelById(availableModels[0].id);
|
await this.selectModelById(availableModels[0].id);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user