import { ModalConfigValidator, ModelConfig } from "../store"; import Locale from "../locales"; import { InputRange } from "./input-range"; import { ListItem, Select } from "./ui-lib"; import { useAllModels } from "../utils/hooks"; export function ModelConfigList(props: { modelConfig: ModelConfig; updateConfig: (updater: (config: ModelConfig) => void) => void; }) { const allModels = useAllModels(); return ( <> { props.updateConfig( (config) => (config.temperature = ModalConfigValidator.temperature( e.currentTarget.valueAsNumber, )), ); }} > { props.updateConfig( (config) => (config.top_p = ModalConfigValidator.top_p( e.currentTarget.valueAsNumber, )), ); }} > props.updateConfig( (config) => (config.max_tokens = ModalConfigValidator.max_tokens( e.currentTarget.valueAsNumber, )), ) } > { props.updateConfig( (config) => (config.presence_penalty = ModalConfigValidator.presence_penalty( e.currentTarget.valueAsNumber, )), ); }} > { props.updateConfig( (config) => (config.frequency_penalty = ModalConfigValidator.frequency_penalty( e.currentTarget.valueAsNumber, )), ); }} > props.updateConfig( (config) => (config.enableInjectSystemPrompts = e.currentTarget.checked), ) } > props.updateConfig( (config) => (config.template = e.currentTarget.value), ) } > props.updateConfig( (config) => (config.historyMessageCount = e.target.valueAsNumber), ) } > props.updateConfig( (config) => (config.compressMessageLengthThreshold = e.currentTarget.valueAsNumber), ) } > props.updateConfig( (config) => (config.sendMemory = e.currentTarget.checked), ) } > ); }