diff --git a/src/settings.tsx b/src/settings.tsx index 9f5b815..300a65c 100644 --- a/src/settings.tsx +++ b/src/settings.tsx @@ -47,23 +47,45 @@ const SelectModel = (props: { setChatStore: (cs: ChatStore) => void; help: string; }) => { + let shouldIUseCustomModel: boolean = true + for (const model in models) { + if (props.chatStore.model === model) { + shouldIUseCustomModel = false + } + } + const [useCustomModel, setUseCustomModel] = useState(shouldIUseCustomModel); return ( - + { + setUseCustomModel(!useCustomModel); + }} className="m-2 p-2"> + + + + { + useCustomModel ? + { + const model = event.target.value as string; + props.chatStore.model = model; + props.setChatStore({ ...props.chatStore }); + }} /> : + } ); };