diff --git a/client/src/components/Endpoints/BingAI/Settings.jsx b/client/src/components/Endpoints/BingAI/Settings.jsx index dc53c98bb7..db3e0b8a96 100644 --- a/client/src/components/Endpoints/BingAI/Settings.jsx +++ b/client/src/components/Endpoints/BingAI/Settings.jsx @@ -1,22 +1,14 @@ -import React, { useEffect, useState } from 'react'; +import { useEffect, useState } from 'react'; import TextareaAutosize from 'react-textarea-autosize'; -import { Input } from '~/components/ui/Input.tsx'; import { Label } from '~/components/ui/Label.tsx'; import { Checkbox } from '~/components/ui/Checkbox.tsx'; import SelectDropDown from '../../ui/SelectDropDown'; import { axiosPost } from '~/utils/fetchers.js'; import { cn } from '~/utils/'; import debounce from 'lodash/debounce'; -// import ModelDropDown from '../../ui/ModelDropDown'; -// import { Slider } from '~/components/ui/Slider.tsx'; -// import OptionHover from './OptionHover'; -// import { HoverCard, HoverCardTrigger } from '~/components/ui/HoverCard.tsx'; 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'; - function Settings(props) { const { readonly, context, systemMessage, jailbreak, toneStyle, setOption } = props; const [tokenCount, setTokenCount] = useState(0); @@ -27,7 +19,6 @@ function Settings(props) { const setToneStyle = value => setOption('toneStyle')(value.toLowerCase()); // useEffect to update token count - useEffect(() => { if (!context || context.trim() === '') { setTokenCount(0); @@ -49,8 +40,6 @@ function Settings(props) { return () => debouncedPost.cancel(); }, [context]); - // console.log('data', data); - return ( <>
@@ -151,14 +140,6 @@ function Settings(props) { />
)} - {/* - - - - */} diff --git a/client/src/components/Endpoints/OpenAI/Settings.jsx b/client/src/components/Endpoints/OpenAI/Settings.jsx index 46e643ba15..2b95ea1c70 100644 --- a/client/src/components/Endpoints/OpenAI/Settings.jsx +++ b/client/src/components/Endpoints/OpenAI/Settings.jsx @@ -1,4 +1,3 @@ -import React from 'react'; import { useRecoilValue } from 'recoil'; import TextareaAutosize from 'react-textarea-autosize'; import SelectDropDown from '../../ui/SelectDropDown'; @@ -6,7 +5,6 @@ import { Input } from '~/components/ui/Input.tsx'; import { Label } from '~/components/ui/Label.tsx'; import { Slider } from '~/components/ui/Slider.tsx'; import { InputNumber } from '~/components/ui/InputNumber.tsx'; -// import { InputNumber } from '../../ui/InputNumber'; import OptionHover from './OptionHover'; import { HoverCard, HoverCardTrigger } from '~/components/ui/HoverCard.tsx'; import { cn } from '~/utils/'; @@ -49,23 +47,6 @@ function Settings(props) { )} containerClassName="flex w-full resize-none" /> - {/* - setModel(e.target.value)} - placeholder="Set a custom name for ChatGPT" - className={cn( - defaultTextProps, - 'flex h-10 max-h-10 w-full resize-none px-3 py-2 focus:outline-none focus:ring-0 focus:ring-opacity-0 focus:ring-offset-0' - )} - /> */}
@@ -160,43 +131,6 @@ function Settings(props) { side="left" /> - - {/* - -
- - setMaxTokens(e.target.value)} - className={cn( - defaultTextProps, - cn(optionText, 'h-auto w-12 border-0 group-hover/temp:border-gray-200') - )} - /> -
- setMaxTokens(value[0])} - max={2048} // should be dynamic to the currently selected model - min={1} - step={1} - className="flex h-4 w-full" - /> -
- -
*/} -
diff --git a/client/src/components/Input/BingAIOptions/index.jsx b/client/src/components/Input/BingAIOptions/index.jsx index 3ebe2c0532..a5efc1ce02 100644 --- a/client/src/components/Input/BingAIOptions/index.jsx +++ b/client/src/components/Input/BingAIOptions/index.jsx @@ -1,5 +1,5 @@ -import React, { useState, useEffect } from 'react'; -import { useRecoilValue, useRecoilState } from 'recoil'; +import { useState } from 'react'; +import { useRecoilState } from 'recoil'; import { cn } from '~/utils'; import { Button } from '../../ui/Button.tsx'; import { Settings2 } from 'lucide-react'; @@ -18,25 +18,12 @@ function BingAIOptions() { const { endpoint, conversationId } = conversation; const { toneStyle, context, systemMessage, jailbreak } = conversation; - // useEffect(() => { - // if (endpoint !== 'bingAI') return; - - // const mustInAdvancedMode = context !== null || systemMessage !== null; - - // if (mustInAdvancedMode && !advancedMode) setAdvancedMode(true); - // }, [conversation, advancedMode]); - if (endpoint !== 'bingAI') return null; if (conversationId !== 'new') return null; const triggerAdvancedMode = () => setAdvancedMode(prev => !prev); const switchToSimpleMode = () => { - // setConversation(prevState => ({ - // ...prevState, - // context: null, - // systemMessage: null - // })); setAdvancedMode(false); }; diff --git a/client/src/components/Input/ChatGPTOptions/index.jsx b/client/src/components/Input/ChatGPTOptions/index.jsx index 951daf9b8b..e0f89f15b6 100644 --- a/client/src/components/Input/ChatGPTOptions/index.jsx +++ b/client/src/components/Input/ChatGPTOptions/index.jsx @@ -12,21 +12,11 @@ function ChatGPTOptions() { const endpointsConfig = useRecoilValue(store.endpointsConfig); - // useEffect(() => { - // if (endpoint !== 'chatGPTBrowser') return; - // }, [conversation]); - if (endpoint !== 'chatGPTBrowser') return null; if (conversationId !== 'new') return null; const models = endpointsConfig?.['chatGPTBrowser']?.['availableModels'] || []; - // const modelMap = new Map([ - // ['Default (GPT-3.5)', 'text-davinci-002-render-sha'], - // ['Legacy (GPT-3.5)', 'text-davinci-002-render-paid'], - // ['GPT-4', 'gpt-4'] - // ]); - const setOption = param => newValue => { let update = {}; update[param] = newValue; diff --git a/client/src/components/Input/OpenAIOptions/index.jsx b/client/src/components/Input/OpenAIOptions/index.jsx index 3d90409adb..1167abe356 100644 --- a/client/src/components/Input/OpenAIOptions/index.jsx +++ b/client/src/components/Input/OpenAIOptions/index.jsx @@ -1,4 +1,4 @@ -import React, { useEffect, useState } from 'react'; +import { useState } from 'react'; import { Settings2 } from 'lucide-react'; import { useRecoilState, useRecoilValue } from 'recoil'; import SelectDropDown from '../../ui/SelectDropDown'; @@ -21,20 +21,6 @@ function OpenAIOptions() { const endpointsConfig = useRecoilValue(store.endpointsConfig); - // useEffect(() => { - // if (endpoint !== 'openAI') return; - - // const mustInAdvancedMode = - // chatGptLabel !== null || - // promptPrefix !== null || - // temperature !== 1 || - // top_p !== 1 || - // presence_penalty !== 0 || - // frequency_penalty !== 0; - - // if (mustInAdvancedMode && !advancedMode) setAdvancedMode(true); - // }, [conversation, advancedMode]); - if (endpoint !== 'openAI') return null; if (conversationId !== 'new') return null; @@ -43,15 +29,6 @@ function OpenAIOptions() { const triggerAdvancedMode = () => setAdvancedMode(prev => !prev); const switchToSimpleMode = () => { - // setConversation(prevState => ({ - // ...prevState, - // chatGptLabel: null, - // promptPrefix: null, - // temperature: 1, - // top_p: 1, - // presence_penalty: 0, - // frequency_penalty: 0 - // })); setAdvancedMode(false); }; @@ -79,16 +56,6 @@ function OpenAIOptions() { (!advancedMode ? ' show' : '') } > - {/* */}