mirror of
https://github.com/earendil-works/pi.git
synced 2026-06-18 15:54:04 +08:00
fix: Model selector fuzzy search matches id + provider
Restores original behavior from 3de8e075. Allows multi-token queries
like 'opus anthropic' to match Anthropic models.
This commit is contained in:
@@ -153,7 +153,7 @@ export class ModelSelectorComponent extends Container {
|
||||
}
|
||||
|
||||
private filterModels(query: string): void {
|
||||
this.filteredModels = fuzzyFilter(this.allModels, query, ({ provider, id }) => `${provider} ${id}`);
|
||||
this.filteredModels = fuzzyFilter(this.allModels, query, ({ id, provider }) => `${id} ${provider}`);
|
||||
this.selectedIndex = Math.min(this.selectedIndex, Math.max(0, this.filteredModels.length - 1));
|
||||
this.updateList();
|
||||
}
|
||||
|
||||
@@ -268,8 +268,8 @@ export class InteractiveMode {
|
||||
label: `${m.provider}/${m.id}`,
|
||||
}));
|
||||
|
||||
// Fuzzy filter by provider + model ID (allows "anthropic opus" to match)
|
||||
const filtered = fuzzyFilter(items, prefix, (item) => `${item.provider} ${item.id}`);
|
||||
// Fuzzy filter by model ID + provider (allows "opus anthropic" to match)
|
||||
const filtered = fuzzyFilter(items, prefix, (item) => `${item.id} ${item.provider}`);
|
||||
|
||||
if (filtered.length === 0) return null;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user