Add support for /model autocomplete

This commit is contained in:
Armin Ronacher 2026-01-10 20:27:29 +01:00
parent c95b132fcc
commit 5cf0490383
2 changed files with 34 additions and 3 deletions

View file

@ -154,7 +154,7 @@ export class ModelSelectorComponent extends Container {
}
private filterModels(query: string): void {
this.filteredModels = fuzzyFilter(this.allModels, query, ({ id, provider }) => `${id} ${provider}`);
this.filteredModels = fuzzyFilter(this.allModels, query, ({ id }) => id);
this.selectedIndex = Math.min(this.selectedIndex, Math.max(0, this.filteredModels.length - 1));
this.updateList();
}