import { cn } from '~/utils/'; import { useRecoilValue } from 'recoil'; import { Switch, SelectDropDown, Label, Slider, InputNumber, HoverCard, HoverCardTrigger, } from '~/components'; import OptionHover from './OptionHover'; import { localize } from '~/localization/Translation'; const defaultTextProps = 'rounded-md border border-gray-200 focus:border-slate-400 focus:bg-gray-50 bg-transparent text-sm shadow-[0_0_10px_rgba(0,0,0,0.05)] outline-none placeholder:text-gray-400 focus:outline-none focus:ring-gray-400 focus:ring-opacity-20 focus:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 dark:border-gray-500 dark:bg-gray-700 focus:dark:bg-gray-600 dark:text-gray-50 dark:shadow-[0_0_15px_rgba(0,0,0,0.10)] dark:focus:border-gray-400 dark:focus:outline-none dark:focus:ring-0 dark:focus:ring-gray-400 dark:focus:ring-offset-0'; const optionText = 'p-0 shadow-none text-right pr-1 h-8 border-transparent focus:ring-[#10a37f] focus:ring-offset-0 focus:ring-opacity-100 hover:bg-gray-800/10 dark:hover:bg-white/10 focus:bg-gray-800/10 dark:focus:bg-white/10 transition-colors'; import store from '~/store'; function Settings(props) { const { readonly, agent, skipCompletion, model, temperature, setOption } = props; const endpoint = 'gptPlugins'; const lang = useRecoilValue(store.lang); const endpointsConfig = useRecoilValue(store.endpointsConfig); const setModel = setOption('model'); const setTemperature = setOption('temperature'); const setAgent = setOption('agent'); const setSkipCompletion = setOption('skipCompletion'); const onCheckedChangeAgent = (checked) => { setAgent(checked ? 'functions' : 'classic'); }; const onCheckedChangeSkip = (checked) => { setSkipCompletion(checked); }; const models = endpointsConfig?.[endpoint]?.['availableModels'] || []; return (
setTemperature(value)} max={2} min={0} step={0.01} controls={false} className={cn( defaultTextProps, cn( optionText, 'reset-rc-number-input reset-rc-number-input-text-right h-auto w-12 border-0 group-hover/temp:border-gray-200', ), )} />
setTemperature(value[0])} doubleClickHandler={() => setTemperature(1)} max={2} min={0} step={0.01} className="flex h-4 w-full" />
{/*
setTopP(value)} max={1} min={0} step={0.01} controls={false} className={cn( defaultTextProps, cn( optionText, 'reset-rc-number-input reset-rc-number-input-text-right h-auto w-12 border-0 group-hover/temp:border-gray-200' ) )} />
setTopP(value[0])} doubleClickHandler={() => setTopP(1)} max={1} min={0} step={0.01} className="flex h-4 w-full" />
setFreqP(value)} max={2} min={-2} step={0.01} controls={false} className={cn( defaultTextProps, cn( optionText, 'reset-rc-number-input reset-rc-number-input-text-right h-auto w-12 border-0 group-hover/temp:border-gray-200' ) )} />
setFreqP(value[0])} doubleClickHandler={() => setFreqP(0)} max={2} min={-2} step={0.01} className="flex h-4 w-full" />
setPresP(value)} max={2} min={-2} step={0.01} controls={false} className={cn( defaultTextProps, cn( optionText, 'reset-rc-number-input reset-rc-number-input-text-right h-auto w-12 border-0 group-hover/temp:border-gray-200' ) )} />
setPresP(value[0])} doubleClickHandler={() => setPresP(0)} max={2} min={-2} step={0.01} className="flex h-4 w-full" />
*/}
); } export default Settings;