diff --git a/client/src/components/Input/OpenAIOptions/ModelDropDown.jsx b/client/src/components/Input/OpenAIOptions/ModelDropDown.jsx index c4da1cbd21..433883d031 100644 --- a/client/src/components/Input/OpenAIOptions/ModelDropDown.jsx +++ b/client/src/components/Input/OpenAIOptions/ModelDropDown.jsx @@ -1,14 +1,16 @@ import React from 'react'; import CheckMark from '../../svg/CheckMark'; -import { Listbox } from '@headlessui/react'; +import { Listbox, Transition } from '@headlessui/react'; import { useRecoilValue } from 'recoil'; import { cn } from '~/utils/'; import store from '~/store'; -function ModelDropDown({ model, setModel, endpoint }) { +function ModelDropDown({ model, setModel, endpoint, showAbove = false, showLabel = true, className = '' }) { const endpointsConfig = useRecoilValue(store.endpointsConfig); const models = endpointsConfig?.[endpoint]?.['availableModels'] || []; + console.log('className', className); + return (
@@ -16,59 +18,98 @@ function ModelDropDown({ model, setModel, endpoint }) { value={model} onChange={setModel} > - - - Model - - - {model} - - - ( + <> + - - - - - - {models.map((modelOption, i) => ( - - - - {modelOption} + Model + + )} + + {/* {!showLabel && ( + + Model + + )} */} + + {!showLabel && ( + + Model: + + )} + {`${!showLabel ? '' : ''} ${model}`} + {/* {`${!showLabel ? 'Model: ' : ''} ${model}`} */} - {modelOption === model && ( - - - - )} - - ))} - + + + + + + + + + {models.map((modelOption, i) => ( + + + + {modelOption} + + {modelOption === model && ( + + + + )} + + + ))} + + + + )}
diff --git a/client/src/components/Input/OpenAIOptions/index.jsx b/client/src/components/Input/OpenAIOptions/index.jsx index 801ae6c88b..8a4a47b0e8 100644 --- a/client/src/components/Input/OpenAIOptions/index.jsx +++ b/client/src/components/Input/OpenAIOptions/index.jsx @@ -2,6 +2,7 @@ import React, { useEffect, useState } from 'react'; import { Settings2 } from 'lucide-react'; import { useRecoilState, useRecoilValue } from 'recoil'; import ModelSelect from './ModelSelect'; +import ModelDropDown from './ModelDropDown'; import EndpointOptionsPopover from '../../ui/EndpointOptionsPopover'; import DialogTemplate from '../../ui/DialogTemplate'; import { Button } from '../../ui/Button.tsx'; @@ -79,7 +80,7 @@ function OpenAIOptions() { (!advancedMode ? ' show' : '') } > - */} +