don't filter out configured providers that have no available models

This commit is contained in:
Cole Goldsmith 2025-11-20 14:27:26 -06:00
parent dee77f4890
commit abf09fc070
2 changed files with 31 additions and 26 deletions

View file

@ -89,7 +89,6 @@ export function ModelSelector({
return ( return (
<Popover open={open} onOpenChange={setOpen} modal={false}> <Popover open={open} onOpenChange={setOpen} modal={false}>
<PopoverTrigger asChild> <PopoverTrigger asChild>
{/** biome-ignore lint/a11y/useSemanticElements: has to be a Button */}
<Button <Button
variant="outline" variant="outline"
role="combobox" role="combobox"
@ -150,28 +149,36 @@ export function ModelSelector({
</div> </div>
} }
> >
{group.options.map((option) => ( {group.options.length === 0 ? (
<CommandItem <CommandItem disabled className="text-muted-foreground ml-6">
key={option.value} No models available
value={option.value}
onSelect={(currentValue) => {
if (currentValue !== value) {
onValueChange(currentValue, option.provider);
}
setOpen(false);
}}
>
<CheckIcon
className={cn(
"mr-2 h-4 w-4",
value === option.value ? "opacity-100" : "opacity-0",
)}
/>
<div className="flex items-center gap-2">
{option.label}
</div>
</CommandItem> </CommandItem>
))} ) : (
group.options.map((option) => (
<CommandItem
key={option.value}
value={option.value}
onSelect={(currentValue) => {
if (currentValue !== value) {
onValueChange(currentValue, option.provider);
}
setOpen(false);
}}
>
<CheckIcon
className={cn(
"mr-2 h-4 w-4",
value === option.value
? "opacity-100"
: "opacity-0",
)}
/>
<div className="flex items-center gap-2">
{option.label}
</div>
</CommandItem>
))
)}
</CommandGroup> </CommandGroup>
)) ))
) : ( ) : (

View file

@ -204,8 +204,7 @@ function KnowledgeSourcesPage() {
...model, ...model,
provider: provider.provider, provider: provider.provider,
})), })),
})) }));
.filter((provider) => provider.options.length > 0);
// Build grouped embedding model options from all configured providers (excluding Anthropic) // Build grouped embedding model options from all configured providers (excluding Anthropic)
const groupedEmbeddingModels = [ const groupedEmbeddingModels = [
@ -239,8 +238,7 @@ function KnowledgeSourcesPage() {
...model, ...model,
provider: provider.provider, provider: provider.provider,
})), })),
})) }));
.filter((provider) => provider.options.length > 0);
const isLoadingAnyLlmModels = const isLoadingAnyLlmModels =
openaiLoading || anthropicLoading || ollamaLoading || watsonxLoading; openaiLoading || anthropicLoading || ollamaLoading || watsonxLoading;