diff --git a/src/app/settings/llm/Ollama/index.tsx b/src/app/settings/llm/Ollama/index.tsx index 0a31644870eb..4752f09e77e7 100644 --- a/src/app/settings/llm/Ollama/index.tsx +++ b/src/app/settings/llm/Ollama/index.tsx @@ -22,7 +22,6 @@ const OllamaProvider = memo(() => { }} provider={ModelProvider.Ollama} showApiKey={false} - showCustomModelName showEndpoint title={ diff --git a/src/app/settings/llm/components/CustomModelList/index.tsx b/src/app/settings/llm/components/CustomModelList/index.tsx index 60ccf1e2c6e4..f68794cd4ef1 100644 --- a/src/app/settings/llm/components/CustomModelList/index.tsx +++ b/src/app/settings/llm/components/CustomModelList/index.tsx @@ -5,7 +5,8 @@ import { memo } from 'react'; import { filterEnabledModels } from '@/config/modelProviders'; import { useGlobalStore } from '@/store/global'; -import { modelConfigSelectors } from '@/store/global/selectors'; +import { modelConfigSelectors, modelProviderSelectors } from '@/store/global/selectors'; +import { GlobalLLMProviderKey } from '@/types/settings'; import { OptionRender } from './Option'; @@ -18,22 +19,31 @@ const popup = css` `; interface CustomModelSelectProps { + onChange?: (value: string[]) => void; placeholder?: string; provider: string; + value?: string[]; } -const CustomModelSelect = memo(({ provider, placeholder }) => { +const CustomModelSelect = memo(({ provider, placeholder, onChange }) => { const providerCard = useGlobalStore( - (s) => modelConfigSelectors.modelSelectList(s).find((s) => s.id === provider), + (s) => modelProviderSelectors.providerModelList(s).find((s) => s.id === provider), isEqual, ); + const providerConfig = useGlobalStore((s) => + modelConfigSelectors.providerConfig(provider as GlobalLLMProviderKey)(s), + ); + const defaultEnableModel = providerCard ? filterEnabledModels(providerCard) : []; return ( -