import TextareaAutosize from 'react-textarea-autosize'; import { ImageDetail, imageDetailNumeric, imageDetailValue } from 'librechat-data-provider'; import { Input, Label, Switch, Slider, HoverCard, InputNumber, SelectDropDown, HoverCardTrigger, } from '~/components/ui'; import { cn, defaultTextProps, optionText, removeFocusOutlines } from '~/utils/'; import { useLocalize, useDebouncedInput } from '~/hooks'; import type { TModelSelectProps } from '~/common'; import OptionHover from './OptionHover'; import { ESide } from '~/common'; export default function Settings({ conversation, setOption, models, readonly }: TModelSelectProps) { const localize = useLocalize(); const { endpoint, endpointType, model, chatGptLabel, promptPrefix, temperature, top_p: topP, frequency_penalty: freqP, presence_penalty: presP, resendFiles, imageDetail, } = conversation ?? {}; const [setChatGptLabel, chatGptLabelValue] = useDebouncedInput({ setOption, optionKey: 'chatGptLabel', initialValue: chatGptLabel, }); const [setPromptPrefix, promptPrefixValue] = useDebouncedInput({ setOption, optionKey: 'promptPrefix', initialValue: promptPrefix, }); const [setTemperature, temperatureValue] = useDebouncedInput({ setOption, optionKey: 'temperature', initialValue: temperature, }); const [setTopP, topPValue] = useDebouncedInput({ setOption, optionKey: 'top_p', initialValue: topP, }); const [setFreqP, freqPValue] = useDebouncedInput({ setOption, optionKey: 'frequency_penalty', initialValue: freqP, }); const [setPresP, presPValue] = useDebouncedInput({ setOption, optionKey: 'presence_penalty', initialValue: presP, }); if (!conversation) { return null; } const setModel = setOption('model'); const setResendFiles = setOption('resendFiles'); const setImageDetail = setOption('imageDetail'); const optionEndpoint = endpointType ?? endpoint; return (