"use client"; import { Check, ChevronsUpDown, Loader2 } from "lucide-react"; import { Button } from "./ui/button"; import { Command, CommandEmpty, CommandGroup, CommandInput, CommandItem, CommandList, } from "./ui/command"; import { Popover, PopoverContent, PopoverTrigger } from "./ui/popover"; import { cn } from "@/lib/utils"; interface CustomConfigProps { customLlmUrl: string; customLlmApiKey: string; customModel: string; customModels: string[]; customModelsLoading: boolean; customModelsChecked: boolean; openModelSelect: boolean; onInputChange: (value: string, field: string) => void; onOpenModelSelectChange: (open: boolean) => void; onFetchCustomModels: () => void; } export default function CustomConfig({ customLlmUrl, customLlmApiKey, customModel, customModels, customModelsLoading, customModelsChecked, openModelSelect, onInputChange, onOpenModelSelectChange, onFetchCustomModels, }: CustomConfigProps) { return ( <>
onInputChange(e.target.value, "custom_llm_url") } />
onInputChange(e.target.value, "custom_llm_api_key") } />
{/* Model selection dropdown - only show if models are available */} {customModelsChecked && customModels.length > 0 && (

Important: Only models with function calling capabilities (tool calls) or JSON schema support will work.

No model found. {customModels.map((model, index) => ( { onInputChange(value, "custom_model"); onOpenModelSelectChange(false); }} > {model} ))}
)} {/* Check for available models button - show when no models checked or no models found */} {(!customModelsChecked || (customModelsChecked && customModels.length === 0)) && (
)} {/* Show message if no models found */} {customModelsChecked && customModels.length === 0 && (

No models found. Please make sure models are available.

)} ); }