Skip to content

Commit cd9c8e4

Browse files
committed
revert custom dropdown removal for backwards compat
1 parent b345711 commit cd9c8e4

File tree

1 file changed

+28
-0
lines changed

1 file changed

+28
-0
lines changed

frontend/src/components/app-config/ai-config.tsx

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import {
55
BotIcon,
66
BrainIcon,
77
ChevronRightIcon,
8+
InfoIcon,
89
PlusIcon,
910
Trash2Icon,
1011
} from "lucide-react";
@@ -61,6 +62,7 @@ import {
6162
} from "../ui/accordion";
6263
import { Button } from "../ui/button";
6364
import { Checkbox } from "../ui/checkbox";
65+
import { DropdownMenuSeparator } from "../ui/dropdown-menu";
6466
import { Label } from "../ui/label";
6567
import { ExternalLink } from "../ui/links";
6668
import {
@@ -272,6 +274,32 @@ export const ModelSelector: React.FC<ModelSelectorProps> = ({
272274
placeholder={placeholder}
273275
onSelect={selectModel}
274276
triggerClassName="text-sm"
277+
customDropdownContent={
278+
<>
279+
<DropdownMenuSeparator />
280+
<p className="px-2 py-1.5 text-sm text-muted-secondary flex items-center gap-1">
281+
Enter a custom model
282+
<Tooltip content="Models should include the provider prefix, e.g. 'openai/gpt-4o'">
283+
<InfoIcon className="h-3 w-3" />
284+
</Tooltip>
285+
</p>
286+
<div className="px-2 py-1">
287+
<Input
288+
className="w-full border-border shadow-none focus-visible:shadow-xs"
289+
placeholder={placeholder}
290+
{...field}
291+
value={asStringOrEmpty(field.value)}
292+
onKeyDown={Events.stopPropagation()}
293+
/>
294+
{value && (
295+
<IncorrectModelId
296+
value={value}
297+
includeSuggestion={false}
298+
/>
299+
)}
300+
</div>
301+
</>
302+
}
275303
forRole={forRole}
276304
/>
277305
</FormControl>

0 commit comments

Comments
 (0)