@lobehub/chat 1.43.5 → 1.44.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +50 -0
- package/changelog/v1.json +18 -0
- package/docs/self-hosting/server-database/docker-compose.mdx +2 -2
- package/locales/ar/common.json +1 -0
- package/locales/ar/modelProvider.json +176 -0
- package/locales/ar/setting.json +1 -0
- package/locales/bg-BG/common.json +1 -0
- package/locales/bg-BG/modelProvider.json +176 -0
- package/locales/bg-BG/setting.json +1 -0
- package/locales/de-DE/common.json +1 -0
- package/locales/de-DE/modelProvider.json +176 -0
- package/locales/de-DE/setting.json +1 -0
- package/locales/en-US/common.json +1 -0
- package/locales/en-US/modelProvider.json +176 -0
- package/locales/en-US/setting.json +1 -0
- package/locales/es-ES/common.json +1 -0
- package/locales/es-ES/modelProvider.json +176 -0
- package/locales/es-ES/setting.json +1 -0
- package/locales/fa-IR/common.json +1 -0
- package/locales/fa-IR/modelProvider.json +176 -0
- package/locales/fa-IR/setting.json +1 -0
- package/locales/fr-FR/common.json +1 -0
- package/locales/fr-FR/modelProvider.json +176 -0
- package/locales/fr-FR/setting.json +1 -0
- package/locales/it-IT/common.json +1 -0
- package/locales/it-IT/modelProvider.json +176 -0
- package/locales/it-IT/setting.json +1 -0
- package/locales/ja-JP/common.json +1 -0
- package/locales/ja-JP/modelProvider.json +176 -0
- package/locales/ja-JP/setting.json +1 -0
- package/locales/ko-KR/common.json +1 -0
- package/locales/ko-KR/modelProvider.json +176 -0
- package/locales/ko-KR/setting.json +1 -0
- package/locales/nl-NL/common.json +1 -0
- package/locales/nl-NL/modelProvider.json +176 -0
- package/locales/nl-NL/setting.json +1 -0
- package/locales/pl-PL/common.json +1 -0
- package/locales/pl-PL/modelProvider.json +176 -0
- package/locales/pl-PL/setting.json +1 -0
- package/locales/pt-BR/common.json +1 -0
- package/locales/pt-BR/modelProvider.json +176 -0
- package/locales/pt-BR/setting.json +1 -0
- package/locales/ru-RU/common.json +1 -0
- package/locales/ru-RU/modelProvider.json +176 -0
- package/locales/ru-RU/setting.json +1 -0
- package/locales/tr-TR/common.json +1 -0
- package/locales/tr-TR/modelProvider.json +176 -0
- package/locales/tr-TR/setting.json +1 -0
- package/locales/vi-VN/common.json +1 -0
- package/locales/vi-VN/modelProvider.json +176 -0
- package/locales/vi-VN/setting.json +1 -0
- package/locales/zh-CN/common.json +1 -0
- package/locales/zh-CN/modelProvider.json +176 -0
- package/locales/zh-CN/setting.json +1 -0
- package/locales/zh-TW/common.json +1 -0
- package/locales/zh-TW/modelProvider.json +176 -0
- package/locales/zh-TW/setting.json +1 -0
- package/package.json +4 -4
- package/src/app/(main)/(mobile)/me/settings/features/Category.tsx +1 -1
- package/src/app/(main)/(mobile)/me/settings/features/useCategory.tsx +12 -5
- package/src/app/(main)/changelog/features/VersionTag.tsx +1 -2
- package/src/app/(main)/chat/(workspace)/@conversation/features/ChatList/ChatItem/Thread.tsx +1 -1
- package/src/app/(main)/chat/(workspace)/@conversation/features/ChatList/ChatItem/ThreadItem.tsx +1 -2
- package/src/app/(main)/chat/(workspace)/@conversation/features/ChatList/ChatItem/index.tsx +0 -1
- package/src/app/(main)/chat/(workspace)/@conversation/features/ChatList/WelcomeChatItem/InboxWelcome/AgentsSuggest.tsx +1 -1
- package/src/app/(main)/chat/(workspace)/@conversation/features/ChatList/WelcomeChatItem/InboxWelcome/QuestionSuggest.tsx +1 -1
- package/src/app/(main)/chat/(workspace)/@conversation/features/ZenModeToast/Toast.tsx +1 -1
- package/src/app/(main)/chat/(workspace)/@topic/features/TopicListContent/ThreadItem/index.tsx +0 -2
- package/src/app/(main)/chat/(workspace)/@topic/features/TopicListContent/TopicItem/index.tsx +0 -1
- package/src/app/(main)/chat/(workspace)/_layout/Desktop/ChatHeader/Tags.tsx +2 -3
- package/src/app/(main)/chat/(workspace)/_layout/Desktop/index.tsx +6 -1
- package/src/app/(main)/chat/@session/features/SessionListContent/CollapseGroup/index.tsx +1 -1
- package/src/app/(main)/chat/features/Migration/Start.tsx +1 -1
- package/src/app/(main)/discover/(detail)/assistant/[slug]/features/ConversationExample/TopicList.tsx +4 -3
- package/src/app/(main)/discover/(detail)/assistant/[slug]/features/Header.tsx +1 -1
- package/src/app/(main)/discover/(detail)/features/ShareButton.tsx +2 -1
- package/src/app/(main)/discover/(detail)/model/[...slugs]/features/Header.tsx +1 -1
- package/src/app/(main)/discover/(detail)/plugin/[slug]/features/Header.tsx +1 -1
- package/src/app/(main)/discover/(detail)/provider/[slug]/features/Header.tsx +1 -1
- package/src/app/(main)/discover/(list)/_layout/Desktop/Nav.tsx +0 -1
- package/src/app/(main)/discover/(list)/assistants/features/Card.tsx +1 -1
- package/src/app/(main)/discover/(list)/models/features/Card.tsx +1 -1
- package/src/app/(main)/discover/(list)/plugins/features/Card.tsx +1 -1
- package/src/app/(main)/discover/(list)/providers/features/Card.tsx +1 -1
- package/src/app/(main)/discover/components/GridLoadingCard.tsx +2 -1
- package/src/app/(main)/discover/components/Title.tsx +1 -1
- package/src/app/(main)/files/(content)/@menu/features/KnowledgeBase/EmptyStatus.tsx +1 -1
- package/src/app/(main)/files/(content)/@menu/features/KnowledgeBase/Item/index.tsx +0 -1
- package/src/app/(main)/files/(content)/@modal/(.)[id]/FullscreenModal.tsx +2 -2
- package/src/app/(main)/files/(content)/NotSupportClient.tsx +2 -2
- package/src/app/(main)/profile/_layout/Desktop/SideBar.tsx +1 -1
- package/src/app/(main)/profile/stats/features/ShareButton/Preview.tsx +5 -5
- package/src/app/(main)/repos/[id]/evals/components/Container.tsx +1 -1
- package/src/app/(main)/repos/[id]/evals/dataset/DatasetList/Item.tsx +0 -1
- package/src/app/(main)/settings/_layout/Desktop/SideBar.tsx +1 -1
- package/src/app/(main)/settings/about/features/ItemCard.tsx +3 -3
- package/src/app/(main)/settings/about/features/Version.tsx +1 -1
- package/src/app/(main)/settings/hooks/useCategory.tsx +22 -9
- package/src/app/(main)/settings/llm/components/ProviderConfig/index.tsx +2 -1
- package/src/app/(main)/settings/llm/components/ProviderModelList/ModelFetcher.tsx +0 -1
- package/src/app/(main)/settings/provider/(detail)/[id]/index.tsx +19 -0
- package/src/app/(main)/settings/provider/(detail)/[id]/page.tsx +95 -0
- package/src/app/(main)/settings/provider/(detail)/azure/page.tsx +119 -0
- package/src/app/(main)/settings/provider/(detail)/bedrock/page.tsx +91 -0
- package/src/app/(main)/settings/provider/(detail)/cloudflare/page.tsx +58 -0
- package/src/app/(main)/settings/provider/(detail)/github/page.tsx +67 -0
- package/src/app/(main)/settings/provider/(detail)/huggingface/page.tsx +67 -0
- package/src/app/(main)/settings/provider/(detail)/ollama/Checker.tsx +73 -0
- package/src/app/(main)/settings/provider/(detail)/ollama/page.tsx +34 -0
- package/src/app/(main)/settings/provider/(detail)/openai/page.tsx +23 -0
- package/src/app/(main)/settings/provider/(detail)/wenxin/page.tsx +61 -0
- package/src/app/(main)/settings/provider/(list)/Footer.tsx +36 -0
- package/src/app/(main)/settings/provider/(list)/ProviderGrid/Card.tsx +134 -0
- package/src/app/(main)/settings/provider/(list)/ProviderGrid/index.tsx +91 -0
- package/src/app/(main)/settings/provider/(list)/index.tsx +19 -0
- package/src/app/(main)/settings/provider/ProviderMenu/AddNew.tsx +28 -0
- package/src/app/(main)/settings/provider/ProviderMenu/All.tsx +29 -0
- package/src/app/(main)/settings/provider/ProviderMenu/Item.tsx +69 -0
- package/src/app/(main)/settings/provider/ProviderMenu/List.tsx +76 -0
- package/src/app/(main)/settings/provider/ProviderMenu/SearchResult.tsx +43 -0
- package/src/app/(main)/settings/provider/ProviderMenu/SkeletonList.tsx +60 -0
- package/src/app/(main)/settings/provider/ProviderMenu/SortProviderModal/GroupItem.tsx +30 -0
- package/src/app/(main)/settings/provider/ProviderMenu/SortProviderModal/index.tsx +91 -0
- package/src/app/(main)/settings/provider/ProviderMenu/index.tsx +80 -0
- package/src/app/(main)/settings/provider/_layout/Desktop.tsx +37 -0
- package/src/app/(main)/settings/provider/_layout/Mobile.tsx +14 -0
- package/src/app/(main)/settings/provider/const.ts +20 -0
- package/src/app/(main)/settings/provider/features/CreateNewProvider/index.tsx +146 -0
- package/src/app/(main)/settings/provider/features/ModelList/CreateNewModelModal/Form.tsx +105 -0
- package/src/app/(main)/settings/provider/features/ModelList/CreateNewModelModal/index.tsx +69 -0
- package/src/app/(main)/settings/provider/features/ModelList/DisabledModels.tsx +29 -0
- package/src/app/(main)/settings/provider/features/ModelList/EmptyModels.tsx +101 -0
- package/src/app/(main)/settings/provider/features/ModelList/EnabledModelList/index.tsx +85 -0
- package/src/app/(main)/settings/provider/features/ModelList/ModelConfigModal/Form.tsx +109 -0
- package/src/app/(main)/settings/provider/features/ModelList/ModelConfigModal/index.tsx +76 -0
- package/src/app/(main)/settings/provider/features/ModelList/ModelItem.tsx +346 -0
- package/src/app/(main)/settings/provider/features/ModelList/ModelTitle/Search.tsx +37 -0
- package/src/app/(main)/settings/provider/features/ModelList/ModelTitle/index.tsx +145 -0
- package/src/app/(main)/settings/provider/features/ModelList/SearchResult.tsx +67 -0
- package/src/app/(main)/settings/provider/features/ModelList/SkeletonList.tsx +63 -0
- package/src/app/(main)/settings/provider/features/ModelList/SortModelModal/ListItem.tsx +20 -0
- package/src/app/(main)/settings/provider/features/ModelList/SortModelModal/index.tsx +96 -0
- package/src/app/(main)/settings/provider/features/ModelList/index.tsx +59 -0
- package/src/app/(main)/settings/provider/features/ProviderConfig/Checker.tsx +120 -0
- package/src/app/(main)/settings/provider/features/ProviderConfig/SkeletonInput.tsx +5 -0
- package/src/app/(main)/settings/provider/features/ProviderConfig/UpdateProviderInfo/SettingModal.tsx +137 -0
- package/src/app/(main)/settings/provider/features/ProviderConfig/UpdateProviderInfo/index.tsx +49 -0
- package/src/app/(main)/settings/provider/features/ProviderConfig/index.tsx +343 -0
- package/src/app/(main)/settings/provider/layout.tsx +21 -0
- package/src/app/(main)/settings/provider/page.tsx +17 -0
- package/src/app/(main)/settings/provider/type.ts +5 -0
- package/src/app/(main)/settings/sync/features/DeviceInfo/Card.tsx +1 -1
- package/src/app/(main)/settings/sync/features/DeviceInfo/index.tsx +1 -1
- package/src/app/@modal/(.)changelog/modal/features/ReadDetail.tsx +1 -1
- package/src/app/@modal/(.)changelog/modal/features/VersionTag.tsx +1 -2
- package/src/app/@modal/(.)changelog/modal/layout.tsx +1 -1
- package/src/components/Cell/index.tsx +1 -1
- package/src/components/DragUpload/index.tsx +2 -3
- package/src/components/FeatureList/index.tsx +1 -1
- package/src/components/FileParsingStatus/EmbeddingStatus.tsx +1 -1
- package/src/components/FileParsingStatus/index.tsx +1 -1
- package/src/components/FunctionModal/style.tsx +2 -2
- package/src/components/GoBack/index.tsx +1 -2
- package/src/components/HotKeys/index.tsx +1 -1
- package/src/components/InstantSwitch/index.tsx +28 -0
- package/src/components/Menu/index.tsx +1 -1
- package/src/components/ModelSelect/index.tsx +2 -3
- package/src/components/Notification/index.tsx +2 -1
- package/src/components/StatisticCard/index.tsx +5 -6
- package/src/config/aiModels/ai21.ts +38 -0
- package/src/config/aiModels/ai360.ts +71 -0
- package/src/config/aiModels/anthropic.ts +152 -0
- package/src/config/aiModels/azure.ts +86 -0
- package/src/config/aiModels/baichuan.ts +107 -0
- package/src/config/aiModels/bedrock.ts +315 -0
- package/src/config/aiModels/cloudflare.ts +88 -0
- package/src/config/aiModels/deepseek.ts +27 -0
- package/src/config/aiModels/fireworksai.ts +232 -0
- package/src/config/aiModels/giteeai.ts +137 -0
- package/src/config/aiModels/github.ts +273 -0
- package/src/config/aiModels/google.ts +317 -0
- package/src/config/aiModels/groq.ts +202 -0
- package/src/config/aiModels/higress.ts +2828 -0
- package/src/config/aiModels/huggingface.ts +56 -0
- package/src/config/aiModels/hunyuan.ts +151 -0
- package/src/config/aiModels/index.ts +98 -0
- package/src/config/aiModels/internlm.ts +40 -0
- package/src/config/aiModels/minimax.ts +55 -0
- package/src/config/aiModels/mistral.ts +172 -0
- package/src/config/aiModels/moonshot.ts +44 -0
- package/src/config/aiModels/novita.ts +124 -0
- package/src/config/aiModels/ollama.ts +412 -0
- package/src/config/aiModels/openai.ts +537 -0
- package/src/config/aiModels/openrouter.ts +252 -0
- package/src/config/aiModels/perplexity.ts +67 -0
- package/src/config/aiModels/qwen.ts +302 -0
- package/src/config/aiModels/sensenova.ts +114 -0
- package/src/config/aiModels/siliconcloud.ts +679 -0
- package/src/config/aiModels/spark.ts +68 -0
- package/src/config/aiModels/stepfun.ts +153 -0
- package/src/config/aiModels/taichu.ts +19 -0
- package/src/config/aiModels/togetherai.ts +334 -0
- package/src/config/aiModels/upstage.ts +37 -0
- package/src/config/aiModels/wenxin.ts +171 -0
- package/src/config/aiModels/xai.ts +72 -0
- package/src/config/aiModels/zeroone.ts +156 -0
- package/src/config/aiModels/zhipu.ts +235 -0
- package/src/config/featureFlags/schema.ts +3 -0
- package/src/config/modelProviders/anthropic.ts +1 -0
- package/src/config/modelProviders/github.ts +0 -1
- package/src/config/modelProviders/google.ts +1 -0
- package/src/config/modelProviders/stepfun.ts +2 -0
- package/src/database/migrations/0013_add_ai_infra.sql +44 -0
- package/src/database/migrations/meta/0013_snapshot.json +3598 -0
- package/src/database/migrations/meta/_journal.json +7 -0
- package/src/database/repositories/aiInfra/index.ts +115 -0
- package/src/database/schemas/aiInfra.ts +69 -0
- package/src/database/schemas/index.ts +1 -0
- package/src/database/server/models/__tests__/aiModel.test.ts +318 -0
- package/src/database/server/models/__tests__/aiProvider.test.ts +373 -0
- package/src/database/server/models/aiModel.ts +250 -0
- package/src/database/server/models/aiProvider.ts +234 -0
- package/src/features/AgentSetting/AgentPrompt/index.tsx +2 -2
- package/src/features/ChatInput/ActionBar/Token/TokenTag.tsx +2 -1
- package/src/features/ChatInput/ActionBar/Tools/index.tsx +2 -3
- package/src/features/ChatInput/ActionBar/Upload/ServerMode.tsx +2 -3
- package/src/features/ChatInput/Desktop/FilePreview/FileItem/index.tsx +3 -2
- package/src/features/ChatInput/Desktop/FilePreview/FileList.tsx +2 -2
- package/src/features/ChatInput/Mobile/Files/FileItem/File.tsx +2 -2
- package/src/features/ChatInput/Mobile/InputArea/index.tsx +1 -1
- package/src/features/ChatInput/STT/common.tsx +1 -1
- package/src/features/Conversation/Error/style.tsx +2 -2
- package/src/features/Conversation/Messages/Assistant/FileChunks/Item/style.ts +2 -2
- package/src/features/Conversation/Messages/Assistant/FileChunks/index.tsx +1 -1
- package/src/features/Conversation/Messages/Assistant/ToolCallItem/Inspector/style.ts +2 -3
- package/src/features/Conversation/Messages/Assistant/ToolCallItem/style.ts +2 -3
- package/src/features/Conversation/Messages/User/FileListViewer/Item.tsx +0 -1
- package/src/features/Conversation/components/BackBottom/style.ts +2 -2
- package/src/features/Conversation/components/MarkdownElements/LobeArtifact/Render/Icon.tsx +2 -3
- package/src/features/Conversation/components/MarkdownElements/LobeArtifact/Render/index.tsx +3 -3
- package/src/features/Conversation/components/MarkdownElements/LobeThinking/Render.tsx +1 -1
- package/src/features/Conversation/components/OTPInput.tsx +2 -2
- package/src/features/DataImporter/Loading.tsx +1 -1
- package/src/features/FileManager/FileList/EmptyStatus.tsx +1 -1
- package/src/features/FileManager/FileList/index.tsx +1 -1
- package/src/features/FileManager/UploadDock/Item.tsx +1 -1
- package/src/features/FileManager/UploadDock/index.tsx +4 -4
- package/src/features/FileViewer/NotSupport/index.tsx +1 -1
- package/src/features/FileViewer/Renderer/MSDoc/index.tsx +0 -1
- package/src/features/FileViewer/Renderer/TXT/index.tsx +1 -1
- package/src/features/InitClientDB/EnableModal.tsx +1 -1
- package/src/features/InitClientDB/ErrorResult.tsx +1 -1
- package/src/features/InitClientDB/InitIndicator.tsx +1 -1
- package/src/features/KnowledgeBaseModal/AddFilesToKnowledgeBase/SelectForm.tsx +0 -1
- package/src/features/ModelSwitchPanel/index.tsx +2 -2
- package/src/features/PluginsUI/Render/Loading.tsx +0 -1
- package/src/features/Portal/Home/Body/Files/FileList/Item.tsx +1 -1
- package/src/features/Portal/Home/Body/Plugins/ArtifactList/Item/style.ts +1 -2
- package/src/features/Setting/SettingContainer.tsx +8 -1
- package/src/features/ShareModal/ShareImage/style.ts +2 -2
- package/src/features/ShareModal/style.ts +2 -2
- package/src/features/User/DataStatistics.tsx +1 -1
- package/src/hooks/useEnabledChatModels.ts +10 -1
- package/src/hooks/useModelSupportToolUse.ts +15 -0
- package/src/hooks/useModelSupportVision.ts +15 -0
- package/src/layout/AuthProvider/Clerk/useAppearance.ts +3 -3
- package/src/layout/GlobalProvider/AppTheme.tsx +1 -1
- package/src/layout/GlobalProvider/StoreInitialization.tsx +5 -0
- package/src/locales/default/common.ts +1 -0
- package/src/locales/default/modelProvider.ts +178 -0
- package/src/locales/default/setting.ts +1 -0
- package/src/server/modules/KeyVaultsEncrypt/index.ts +1 -1
- package/src/server/routers/lambda/aiModel.ts +128 -0
- package/src/server/routers/lambda/aiProvider.ts +127 -0
- package/src/server/routers/lambda/index.ts +4 -0
- package/src/services/__tests__/_auth.test.ts +16 -49
- package/src/services/__tests__/chat.test.ts +2 -0
- package/src/services/_auth.ts +42 -25
- package/src/services/aiModel.ts +52 -0
- package/src/services/aiProvider.ts +47 -0
- package/src/services/chat.ts +62 -18
- package/src/store/aiInfra/index.ts +2 -0
- package/src/store/aiInfra/initialState.ts +11 -0
- package/src/store/aiInfra/selectors.ts +2 -0
- package/src/store/aiInfra/slices/aiModel/action.ts +146 -0
- package/src/store/aiInfra/slices/aiModel/index.ts +3 -0
- package/src/store/aiInfra/slices/aiModel/initialState.ts +14 -0
- package/src/store/aiInfra/slices/aiModel/selectors.ts +63 -0
- package/src/store/aiInfra/slices/aiProvider/action.ts +208 -0
- package/src/store/aiInfra/slices/aiProvider/index.ts +3 -0
- package/src/store/aiInfra/slices/aiProvider/initialState.ts +32 -0
- package/src/store/aiInfra/slices/aiProvider/selectors.ts +99 -0
- package/src/store/aiInfra/store.ts +25 -0
- package/src/store/global/initialState.ts +1 -0
- package/src/store/serverConfig/selectors.test.ts +1 -0
- package/src/styles/global.ts +1 -1
- package/src/types/aiModel.ts +32 -6
- package/src/types/aiProvider.ts +11 -4
- package/src/utils/fetch/fetchSSE.ts +3 -1
@@ -0,0 +1,105 @@
|
|
1
|
+
import { Checkbox, Form, FormInstance, Input } from 'antd';
|
2
|
+
import { memo, useEffect } from 'react';
|
3
|
+
import { useTranslation } from 'react-i18next';
|
4
|
+
|
5
|
+
import MaxTokenSlider from '@/components/MaxTokenSlider';
|
6
|
+
import { useIsMobile } from '@/hooks/useIsMobile';
|
7
|
+
import { AiModelType } from '@/types/aiModel';
|
8
|
+
import { ChatModelCard } from '@/types/llm';
|
9
|
+
|
10
|
+
interface ModelConfigFormProps {
|
11
|
+
initialValues?: ChatModelCard;
|
12
|
+
onFormInstanceReady: (instance: FormInstance) => void;
|
13
|
+
showAzureDeployName?: boolean;
|
14
|
+
type?: AiModelType;
|
15
|
+
}
|
16
|
+
|
17
|
+
const ModelConfigForm = memo<ModelConfigFormProps>(
|
18
|
+
({ showAzureDeployName, onFormInstanceReady, initialValues }) => {
|
19
|
+
const { t } = useTranslation('setting');
|
20
|
+
|
21
|
+
const [formInstance] = Form.useForm();
|
22
|
+
|
23
|
+
const isMobile = useIsMobile();
|
24
|
+
|
25
|
+
useEffect(() => {
|
26
|
+
onFormInstanceReady(formInstance);
|
27
|
+
}, []);
|
28
|
+
|
29
|
+
return (
|
30
|
+
<div
|
31
|
+
onClick={(e) => {
|
32
|
+
e.stopPropagation();
|
33
|
+
}}
|
34
|
+
onKeyDown={(e) => {
|
35
|
+
e.stopPropagation();
|
36
|
+
}}
|
37
|
+
>
|
38
|
+
<Form
|
39
|
+
colon={false}
|
40
|
+
form={formInstance}
|
41
|
+
initialValues={initialValues}
|
42
|
+
labelCol={{ span: 4 }}
|
43
|
+
style={{ marginTop: 16 }}
|
44
|
+
wrapperCol={isMobile ? { span: 18 } : { offset: 1, span: 18 }}
|
45
|
+
>
|
46
|
+
<Form.Item
|
47
|
+
extra={t('llm.customModelCards.modelConfig.id.extra')}
|
48
|
+
label={t('llm.customModelCards.modelConfig.id.title')}
|
49
|
+
name={'id'}
|
50
|
+
>
|
51
|
+
<Input placeholder={t('llm.customModelCards.modelConfig.id.placeholder')} />
|
52
|
+
</Form.Item>
|
53
|
+
{showAzureDeployName && (
|
54
|
+
<Form.Item
|
55
|
+
extra={t('llm.customModelCards.modelConfig.azureDeployName.extra')}
|
56
|
+
label={t('llm.customModelCards.modelConfig.azureDeployName.title')}
|
57
|
+
name={['config', 'deploymentName']}
|
58
|
+
>
|
59
|
+
<Input
|
60
|
+
placeholder={t('llm.customModelCards.modelConfig.azureDeployName.placeholder')}
|
61
|
+
/>
|
62
|
+
</Form.Item>
|
63
|
+
)}
|
64
|
+
<Form.Item
|
65
|
+
label={t('llm.customModelCards.modelConfig.displayName.title')}
|
66
|
+
name={'displayName'}
|
67
|
+
>
|
68
|
+
<Input placeholder={t('llm.customModelCards.modelConfig.displayName.placeholder')} />
|
69
|
+
</Form.Item>
|
70
|
+
<Form.Item
|
71
|
+
label={t('llm.customModelCards.modelConfig.tokens.title')}
|
72
|
+
name={'contextWindowTokens'}
|
73
|
+
>
|
74
|
+
<MaxTokenSlider />
|
75
|
+
</Form.Item>
|
76
|
+
<Form.Item
|
77
|
+
extra={t('llm.customModelCards.modelConfig.functionCall.extra')}
|
78
|
+
label={t('llm.customModelCards.modelConfig.functionCall.title')}
|
79
|
+
name={['abilities', 'functionCall']}
|
80
|
+
valuePropName={'checked'}
|
81
|
+
>
|
82
|
+
<Checkbox />
|
83
|
+
</Form.Item>
|
84
|
+
<Form.Item
|
85
|
+
extra={t('llm.customModelCards.modelConfig.vision.extra')}
|
86
|
+
label={t('llm.customModelCards.modelConfig.vision.title')}
|
87
|
+
name={['abilities', 'vision']}
|
88
|
+
valuePropName={'checked'}
|
89
|
+
>
|
90
|
+
<Checkbox />
|
91
|
+
</Form.Item>
|
92
|
+
{/*<Form.Item*/}
|
93
|
+
{/* extra={t('llm.customModelCards.modelConfig.files.extra')}*/}
|
94
|
+
{/* label={t('llm.customModelCards.modelConfig.files.title')}*/}
|
95
|
+
{/* name={['abilities', 'files']}*/}
|
96
|
+
{/* valuePropName={'checked'}*/}
|
97
|
+
{/*>*/}
|
98
|
+
{/* <Checkbox />*/}
|
99
|
+
{/*</Form.Item>*/}
|
100
|
+
</Form>
|
101
|
+
</div>
|
102
|
+
);
|
103
|
+
},
|
104
|
+
);
|
105
|
+
export default ModelConfigForm;
|
@@ -0,0 +1,69 @@
|
|
1
|
+
import { Modal } from '@lobehub/ui';
|
2
|
+
import { Button, FormInstance } from 'antd';
|
3
|
+
import { memo, useState } from 'react';
|
4
|
+
import { useTranslation } from 'react-i18next';
|
5
|
+
|
6
|
+
import { ModelProvider } from '@/libs/agent-runtime';
|
7
|
+
import { useAiInfraStore } from '@/store/aiInfra';
|
8
|
+
|
9
|
+
import ModelConfigForm from './Form';
|
10
|
+
|
11
|
+
interface ModelConfigModalProps {
|
12
|
+
open: boolean;
|
13
|
+
setOpen: (open: boolean) => void;
|
14
|
+
}
|
15
|
+
|
16
|
+
const ModelConfigModal = memo<ModelConfigModalProps>(({ open, setOpen }) => {
|
17
|
+
const { t } = useTranslation(['modelProvider', 'common']);
|
18
|
+
const [formInstance, setFormInstance] = useState<FormInstance>();
|
19
|
+
const [loading, setLoading] = useState(false);
|
20
|
+
const [editingProvider, createNewAiModel] = useAiInfraStore((s) => [
|
21
|
+
s.activeAiProvider!,
|
22
|
+
s.createNewAiModel,
|
23
|
+
]);
|
24
|
+
|
25
|
+
const closeModal = () => {
|
26
|
+
setOpen(false);
|
27
|
+
};
|
28
|
+
|
29
|
+
return (
|
30
|
+
<Modal
|
31
|
+
destroyOnClose
|
32
|
+
footer={[
|
33
|
+
<Button key="cancel" onClick={closeModal}>
|
34
|
+
{t('cancel', { ns: 'common' })}
|
35
|
+
</Button>,
|
36
|
+
|
37
|
+
<Button
|
38
|
+
key="ok"
|
39
|
+
loading={loading}
|
40
|
+
onClick={async () => {
|
41
|
+
if (!editingProvider || !formInstance) return;
|
42
|
+
const data = formInstance.getFieldsValue();
|
43
|
+
|
44
|
+
setLoading(true);
|
45
|
+
await createNewAiModel({ ...data, providerId: editingProvider });
|
46
|
+
setLoading(false);
|
47
|
+
|
48
|
+
closeModal();
|
49
|
+
}}
|
50
|
+
style={{ marginInlineStart: '16px' }}
|
51
|
+
type="primary"
|
52
|
+
>
|
53
|
+
{t('ok', { ns: 'common' })}
|
54
|
+
</Button>,
|
55
|
+
]}
|
56
|
+
maskClosable
|
57
|
+
onCancel={closeModal}
|
58
|
+
open={open}
|
59
|
+
title={t('providerModels.createNew.title')}
|
60
|
+
zIndex={1251} // Select is 1150
|
61
|
+
>
|
62
|
+
<ModelConfigForm
|
63
|
+
onFormInstanceReady={setFormInstance}
|
64
|
+
showAzureDeployName={editingProvider === ModelProvider.Azure}
|
65
|
+
/>
|
66
|
+
</Modal>
|
67
|
+
);
|
68
|
+
});
|
69
|
+
export default ModelConfigModal;
|
@@ -0,0 +1,29 @@
|
|
1
|
+
import { Typography } from 'antd';
|
2
|
+
import isEqual from 'fast-deep-equal';
|
3
|
+
import { memo } from 'react';
|
4
|
+
import { useTranslation } from 'react-i18next';
|
5
|
+
import { Flexbox } from 'react-layout-kit';
|
6
|
+
|
7
|
+
import { useAiInfraStore } from '@/store/aiInfra';
|
8
|
+
import { aiModelSelectors } from '@/store/aiInfra/selectors';
|
9
|
+
|
10
|
+
import ModelItem from './ModelItem';
|
11
|
+
|
12
|
+
const DisabledModels = memo(() => {
|
13
|
+
const { t } = useTranslation('modelProvider');
|
14
|
+
|
15
|
+
const disabledModels = useAiInfraStore(aiModelSelectors.disabledAiProviderModelList, isEqual);
|
16
|
+
|
17
|
+
return (
|
18
|
+
<Flexbox>
|
19
|
+
<Typography.Text style={{ fontSize: 12, marginTop: 8 }} type={'secondary'}>
|
20
|
+
{t('providerModels.list.disabled')}
|
21
|
+
</Typography.Text>
|
22
|
+
{disabledModels.map((item) => (
|
23
|
+
<ModelItem {...item} key={item.id} />
|
24
|
+
))}
|
25
|
+
</Flexbox>
|
26
|
+
);
|
27
|
+
});
|
28
|
+
|
29
|
+
export default DisabledModels;
|
@@ -0,0 +1,101 @@
|
|
1
|
+
import { Icon } from '@lobehub/ui';
|
2
|
+
import { Button } from 'antd';
|
3
|
+
import { createStyles } from 'antd-style';
|
4
|
+
import { BrainIcon, LucideRefreshCcwDot, PlusIcon } from 'lucide-react';
|
5
|
+
import { memo, useState } from 'react';
|
6
|
+
import { useTranslation } from 'react-i18next';
|
7
|
+
import { Center, Flexbox } from 'react-layout-kit';
|
8
|
+
|
9
|
+
import { useAiInfraStore } from '@/store/aiInfra';
|
10
|
+
|
11
|
+
import CreateNewModelModal from './CreateNewModelModal';
|
12
|
+
|
13
|
+
const useStyles = createStyles(({ css, token }) => ({
|
14
|
+
circle: css`
|
15
|
+
width: 80px;
|
16
|
+
height: 80px;
|
17
|
+
border-radius: 50%;
|
18
|
+
background: ${token.colorFillSecondary};
|
19
|
+
`,
|
20
|
+
container: css`
|
21
|
+
width: 100%;
|
22
|
+
border: 1px dashed ${token.colorBorder};
|
23
|
+
border-radius: 12px;
|
24
|
+
background: ${token.colorBgContainer};
|
25
|
+
`,
|
26
|
+
description: css`
|
27
|
+
max-width: 280px;
|
28
|
+
|
29
|
+
font-size: ${token.fontSize}px;
|
30
|
+
color: ${token.colorTextDescription};
|
31
|
+
text-align: center;
|
32
|
+
text-wrap: balance;
|
33
|
+
`,
|
34
|
+
iconWrapper: css`
|
35
|
+
position: relative;
|
36
|
+
width: 64px;
|
37
|
+
height: 64px;
|
38
|
+
`,
|
39
|
+
sparklesIcon: css`
|
40
|
+
font-size: 40px;
|
41
|
+
color: ${token.colorText};
|
42
|
+
`,
|
43
|
+
title: css`
|
44
|
+
font-size: ${token.fontSizeLG}px;
|
45
|
+
font-weight: 500;
|
46
|
+
`,
|
47
|
+
}));
|
48
|
+
|
49
|
+
const EmptyState = memo<{ provider: string }>(({ provider }) => {
|
50
|
+
const { t } = useTranslation('modelProvider');
|
51
|
+
const { styles } = useStyles();
|
52
|
+
|
53
|
+
const [fetchRemoteModelList] = useAiInfraStore((s) => [s.fetchRemoteModelList]);
|
54
|
+
|
55
|
+
const [fetchRemoteModelsLoading, setFetchRemoteModelsLoading] = useState(false);
|
56
|
+
const [showModal, setShowModal] = useState(false);
|
57
|
+
|
58
|
+
return (
|
59
|
+
<Center className={styles.container} gap={24} paddingBlock={40}>
|
60
|
+
<Center className={styles.circle}>
|
61
|
+
<Icon className={styles.sparklesIcon} icon={BrainIcon} />
|
62
|
+
</Center>
|
63
|
+
<Flexbox align={'center'} gap={8}>
|
64
|
+
<div className={styles.title}>{t('providerModels.list.empty.title')}</div>
|
65
|
+
<div className={styles.description}>{t('providerModels.list.empty.desc')}</div>
|
66
|
+
</Flexbox>
|
67
|
+
|
68
|
+
<Flexbox gap={8} horizontal>
|
69
|
+
<Button
|
70
|
+
icon={<Icon icon={PlusIcon} />}
|
71
|
+
onClick={() => {
|
72
|
+
setShowModal(true);
|
73
|
+
}}
|
74
|
+
>
|
75
|
+
{t('providerModels.list.addNew')}
|
76
|
+
</Button>
|
77
|
+
<CreateNewModelModal open={showModal} setOpen={setShowModal} />
|
78
|
+
<Button
|
79
|
+
icon={<Icon icon={LucideRefreshCcwDot} />}
|
80
|
+
loading={fetchRemoteModelsLoading}
|
81
|
+
onClick={async () => {
|
82
|
+
setFetchRemoteModelsLoading(true);
|
83
|
+
try {
|
84
|
+
await fetchRemoteModelList(provider);
|
85
|
+
} catch (e) {
|
86
|
+
console.error(e);
|
87
|
+
}
|
88
|
+
setFetchRemoteModelsLoading(false);
|
89
|
+
}}
|
90
|
+
type={'primary'}
|
91
|
+
>
|
92
|
+
{fetchRemoteModelsLoading
|
93
|
+
? t('providerModels.list.fetcher.fetching')
|
94
|
+
: t('providerModels.list.fetcher.fetch')}
|
95
|
+
</Button>
|
96
|
+
</Flexbox>
|
97
|
+
</Center>
|
98
|
+
);
|
99
|
+
});
|
100
|
+
|
101
|
+
export default EmptyState;
|
@@ -0,0 +1,85 @@
|
|
1
|
+
import { ActionIcon } from '@lobehub/ui';
|
2
|
+
import { Typography } from 'antd';
|
3
|
+
import isEqual from 'fast-deep-equal';
|
4
|
+
import { ArrowDownUpIcon, ToggleLeft } from 'lucide-react';
|
5
|
+
import { useState } from 'react';
|
6
|
+
import { useTranslation } from 'react-i18next';
|
7
|
+
import { Center, Flexbox } from 'react-layout-kit';
|
8
|
+
|
9
|
+
import { useAiInfraStore } from '@/store/aiInfra';
|
10
|
+
import { aiModelSelectors } from '@/store/aiInfra/selectors';
|
11
|
+
|
12
|
+
import ModelItem from '../ModelItem';
|
13
|
+
import SortModelModal from '../SortModelModal';
|
14
|
+
|
15
|
+
const EnabledModelList = () => {
|
16
|
+
const { t } = useTranslation('modelProvider');
|
17
|
+
|
18
|
+
const enabledModels = useAiInfraStore(aiModelSelectors.enabledAiProviderModelList, isEqual);
|
19
|
+
const batchToggleAiModels = useAiInfraStore((s) => s.batchToggleAiModels);
|
20
|
+
const [open, setOpen] = useState(false);
|
21
|
+
const [batchLoading, setBatchLoading] = useState(false);
|
22
|
+
|
23
|
+
const isEmpty = enabledModels.length === 0;
|
24
|
+
return (
|
25
|
+
<>
|
26
|
+
<Flexbox horizontal justify={'space-between'}>
|
27
|
+
<Typography.Text style={{ fontSize: 12, marginTop: 8 }} type={'secondary'}>
|
28
|
+
{t('providerModels.list.enabled')}
|
29
|
+
</Typography.Text>
|
30
|
+
{!isEmpty && (
|
31
|
+
<Flexbox horizontal>
|
32
|
+
<ActionIcon
|
33
|
+
icon={ToggleLeft}
|
34
|
+
loading={batchLoading}
|
35
|
+
onClick={async () => {
|
36
|
+
setBatchLoading(true);
|
37
|
+
await batchToggleAiModels(
|
38
|
+
enabledModels.map((i) => i.id),
|
39
|
+
false,
|
40
|
+
);
|
41
|
+
setBatchLoading(false);
|
42
|
+
}}
|
43
|
+
size={'small'}
|
44
|
+
title={t('providerModels.list.enabledActions.disableAll')}
|
45
|
+
/>
|
46
|
+
|
47
|
+
<ActionIcon
|
48
|
+
icon={ArrowDownUpIcon}
|
49
|
+
onClick={() => {
|
50
|
+
setOpen(true);
|
51
|
+
}}
|
52
|
+
size={'small'}
|
53
|
+
title={t('providerModels.list.enabledActions.sort')}
|
54
|
+
/>
|
55
|
+
</Flexbox>
|
56
|
+
)}
|
57
|
+
{open && (
|
58
|
+
<SortModelModal
|
59
|
+
defaultItems={enabledModels}
|
60
|
+
onCancel={() => {
|
61
|
+
setOpen(false);
|
62
|
+
}}
|
63
|
+
open={open}
|
64
|
+
/>
|
65
|
+
)}
|
66
|
+
</Flexbox>
|
67
|
+
{isEmpty ? (
|
68
|
+
<Center padding={12}>
|
69
|
+
<Typography.Text style={{ fontSize: 12 }} type={'secondary'}>
|
70
|
+
{t('providerModels.list.enabledEmpty')}
|
71
|
+
</Typography.Text>
|
72
|
+
</Center>
|
73
|
+
) : (
|
74
|
+
<Flexbox gap={2}>
|
75
|
+
{enabledModels.map(({ displayName, id, ...res }) => {
|
76
|
+
const label = displayName || id;
|
77
|
+
|
78
|
+
return <ModelItem displayName={label as string} id={id as string} key={id} {...res} />;
|
79
|
+
})}
|
80
|
+
</Flexbox>
|
81
|
+
)}
|
82
|
+
</>
|
83
|
+
);
|
84
|
+
};
|
85
|
+
export default EnabledModelList;
|
@@ -0,0 +1,109 @@
|
|
1
|
+
import { Checkbox, Form, FormInstance, Input } from 'antd';
|
2
|
+
import { memo, useEffect } from 'react';
|
3
|
+
import { useTranslation } from 'react-i18next';
|
4
|
+
|
5
|
+
import MaxTokenSlider from '@/components/MaxTokenSlider';
|
6
|
+
import { useIsMobile } from '@/hooks/useIsMobile';
|
7
|
+
import { AiModelType } from '@/types/aiModel';
|
8
|
+
import { ChatModelCard } from '@/types/llm';
|
9
|
+
|
10
|
+
interface ModelConfigFormProps {
|
11
|
+
idEditable?: boolean;
|
12
|
+
initialValues?: ChatModelCard;
|
13
|
+
onFormInstanceReady: (instance: FormInstance) => void;
|
14
|
+
showAzureDeployName?: boolean;
|
15
|
+
type?: AiModelType;
|
16
|
+
}
|
17
|
+
|
18
|
+
const ModelConfigForm = memo<ModelConfigFormProps>(
|
19
|
+
({ showAzureDeployName, idEditable, onFormInstanceReady, initialValues }) => {
|
20
|
+
const { t } = useTranslation('setting');
|
21
|
+
|
22
|
+
const [formInstance] = Form.useForm();
|
23
|
+
|
24
|
+
const isMobile = useIsMobile();
|
25
|
+
|
26
|
+
useEffect(() => {
|
27
|
+
onFormInstanceReady(formInstance);
|
28
|
+
}, []);
|
29
|
+
|
30
|
+
return (
|
31
|
+
<div
|
32
|
+
onClick={(e) => {
|
33
|
+
e.stopPropagation();
|
34
|
+
}}
|
35
|
+
onKeyDown={(e) => {
|
36
|
+
e.stopPropagation();
|
37
|
+
}}
|
38
|
+
>
|
39
|
+
<Form
|
40
|
+
colon={false}
|
41
|
+
form={formInstance}
|
42
|
+
initialValues={initialValues}
|
43
|
+
labelCol={{ span: 4 }}
|
44
|
+
style={{ marginTop: 16 }}
|
45
|
+
wrapperCol={isMobile ? { span: 18 } : { offset: 1, span: 18 }}
|
46
|
+
>
|
47
|
+
<Form.Item
|
48
|
+
extra={t('llm.customModelCards.modelConfig.id.extra')}
|
49
|
+
label={t('llm.customModelCards.modelConfig.id.title')}
|
50
|
+
name={'id'}
|
51
|
+
>
|
52
|
+
<Input
|
53
|
+
disabled={!idEditable}
|
54
|
+
placeholder={t('llm.customModelCards.modelConfig.id.placeholder')}
|
55
|
+
/>
|
56
|
+
</Form.Item>
|
57
|
+
{showAzureDeployName && (
|
58
|
+
<Form.Item
|
59
|
+
extra={t('llm.customModelCards.modelConfig.azureDeployName.extra')}
|
60
|
+
label={t('llm.customModelCards.modelConfig.azureDeployName.title')}
|
61
|
+
name={['config', 'deploymentName']}
|
62
|
+
>
|
63
|
+
<Input
|
64
|
+
placeholder={t('llm.customModelCards.modelConfig.azureDeployName.placeholder')}
|
65
|
+
/>
|
66
|
+
</Form.Item>
|
67
|
+
)}
|
68
|
+
<Form.Item
|
69
|
+
label={t('llm.customModelCards.modelConfig.displayName.title')}
|
70
|
+
name={'displayName'}
|
71
|
+
>
|
72
|
+
<Input placeholder={t('llm.customModelCards.modelConfig.displayName.placeholder')} />
|
73
|
+
</Form.Item>
|
74
|
+
<Form.Item
|
75
|
+
label={t('llm.customModelCards.modelConfig.tokens.title')}
|
76
|
+
name={'contextWindowTokens'}
|
77
|
+
>
|
78
|
+
<MaxTokenSlider />
|
79
|
+
</Form.Item>
|
80
|
+
<Form.Item
|
81
|
+
extra={t('llm.customModelCards.modelConfig.functionCall.extra')}
|
82
|
+
label={t('llm.customModelCards.modelConfig.functionCall.title')}
|
83
|
+
name={['abilities', 'functionCall']}
|
84
|
+
valuePropName={'checked'}
|
85
|
+
>
|
86
|
+
<Checkbox />
|
87
|
+
</Form.Item>
|
88
|
+
<Form.Item
|
89
|
+
extra={t('llm.customModelCards.modelConfig.vision.extra')}
|
90
|
+
label={t('llm.customModelCards.modelConfig.vision.title')}
|
91
|
+
name={['abilities', 'vision']}
|
92
|
+
valuePropName={'checked'}
|
93
|
+
>
|
94
|
+
<Checkbox />
|
95
|
+
</Form.Item>
|
96
|
+
{/*<Form.Item*/}
|
97
|
+
{/* extra={t('llm.customModelCards.modelConfig.files.extra')}*/}
|
98
|
+
{/* label={t('llm.customModelCards.modelConfig.files.title')}*/}
|
99
|
+
{/* name={['abilities', 'files']}*/}
|
100
|
+
{/* valuePropName={'checked'}*/}
|
101
|
+
{/*>*/}
|
102
|
+
{/* <Checkbox />*/}
|
103
|
+
{/*</Form.Item>*/}
|
104
|
+
</Form>
|
105
|
+
</div>
|
106
|
+
);
|
107
|
+
},
|
108
|
+
);
|
109
|
+
export default ModelConfigForm;
|
@@ -0,0 +1,76 @@
|
|
1
|
+
import { Modal } from '@lobehub/ui';
|
2
|
+
import { Button, FormInstance } from 'antd';
|
3
|
+
import isEqual from 'fast-deep-equal';
|
4
|
+
import { memo, useState } from 'react';
|
5
|
+
import { useTranslation } from 'react-i18next';
|
6
|
+
|
7
|
+
import { ModelProvider } from '@/libs/agent-runtime';
|
8
|
+
import { aiModelSelectors, useAiInfraStore } from '@/store/aiInfra';
|
9
|
+
import { AiModelSourceEnum } from '@/types/aiModel';
|
10
|
+
|
11
|
+
import ModelConfigForm from './Form';
|
12
|
+
|
13
|
+
interface ModelConfigModalProps {
|
14
|
+
id: string;
|
15
|
+
open: boolean;
|
16
|
+
setOpen: (open: boolean) => void;
|
17
|
+
}
|
18
|
+
|
19
|
+
const ModelConfigModal = memo<ModelConfigModalProps>(({ id, open, setOpen }) => {
|
20
|
+
const { t } = useTranslation(['common', 'setting']);
|
21
|
+
const [formInstance, setFormInstance] = useState<FormInstance>();
|
22
|
+
const [loading, setLoading] = useState(false);
|
23
|
+
const [editingProvider, updateAiModelsConfig] = useAiInfraStore((s) => [
|
24
|
+
s.activeAiProvider!,
|
25
|
+
s.updateAiModelsConfig,
|
26
|
+
]);
|
27
|
+
const model = useAiInfraStore(aiModelSelectors.getAiModelById(id), isEqual);
|
28
|
+
|
29
|
+
const closeModal = () => {
|
30
|
+
setOpen(false);
|
31
|
+
};
|
32
|
+
|
33
|
+
return (
|
34
|
+
<Modal
|
35
|
+
destroyOnClose
|
36
|
+
footer={[
|
37
|
+
<Button key="cancel" onClick={closeModal}>
|
38
|
+
{t('cancel')}
|
39
|
+
</Button>,
|
40
|
+
|
41
|
+
<Button
|
42
|
+
key="ok"
|
43
|
+
loading={loading}
|
44
|
+
onClick={async () => {
|
45
|
+
if (!editingProvider || !id || !formInstance) return;
|
46
|
+
const data = formInstance.getFieldsValue();
|
47
|
+
|
48
|
+
setLoading(true);
|
49
|
+
await updateAiModelsConfig(id, editingProvider, data);
|
50
|
+
setLoading(false);
|
51
|
+
|
52
|
+
closeModal();
|
53
|
+
}}
|
54
|
+
style={{ marginInlineStart: '16px' }}
|
55
|
+
type="primary"
|
56
|
+
>
|
57
|
+
{t('ok')}
|
58
|
+
</Button>,
|
59
|
+
]}
|
60
|
+
maskClosable
|
61
|
+
onCancel={closeModal}
|
62
|
+
open={open}
|
63
|
+
title={t('llm.customModelCards.modelConfig.modalTitle', { ns: 'setting' })}
|
64
|
+
zIndex={1251} // Select is 1150
|
65
|
+
>
|
66
|
+
<ModelConfigForm
|
67
|
+
idEditable={model?.source !== AiModelSourceEnum.Builtin}
|
68
|
+
initialValues={model}
|
69
|
+
onFormInstanceReady={setFormInstance}
|
70
|
+
showAzureDeployName={editingProvider === ModelProvider.Azure}
|
71
|
+
type={model?.type}
|
72
|
+
/>
|
73
|
+
</Modal>
|
74
|
+
);
|
75
|
+
});
|
76
|
+
export default ModelConfigModal;
|