From 7f8a1b6ea4a923787d50a3d8b85167659c7fa860 Mon Sep 17 00:00:00 2001 From: Arvin Xu Date: Wed, 8 Jan 2025 12:33:39 +0800 Subject: [PATCH 1/3] =?UTF-8?q?=F0=9F=90=9B=20fix:=20add=20provider=20id?= =?UTF-8?q?=20validate=20(#5336)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * fix loading issue * fix provider id issue --- locales/ar/modelProvider.json | 2 ++ locales/bg-BG/modelProvider.json | 2 ++ locales/de-DE/modelProvider.json | 2 ++ locales/en-US/modelProvider.json | 2 ++ locales/es-ES/modelProvider.json | 2 ++ locales/fa-IR/modelProvider.json | 2 ++ locales/fr-FR/modelProvider.json | 2 ++ locales/it-IT/modelProvider.json | 2 ++ locales/ja-JP/modelProvider.json | 2 ++ locales/ko-KR/modelProvider.json | 2 ++ locales/nl-NL/modelProvider.json | 2 ++ locales/pl-PL/modelProvider.json | 2 ++ locales/pt-BR/modelProvider.json | 2 ++ locales/ru-RU/modelProvider.json | 2 ++ locales/tr-TR/modelProvider.json | 2 ++ locales/vi-VN/modelProvider.json | 2 ++ locales/zh-CN/modelProvider.json | 4 +++- locales/zh-TW/modelProvider.json | 2 ++ .../features/CreateNewProvider/index.tsx | 9 ++++++++- .../features/ProviderConfig/Checker.tsx | 15 +++++++++------ .../features/ProviderConfig/index.tsx | 18 +++++++++++++++--- src/config/aiModels/siliconcloud.ts | 13 ------------- src/locales/default/modelProvider.ts | 4 +++- src/store/aiInfra/slices/aiProvider/action.ts | 19 +++++++++++++++++-- .../aiInfra/slices/aiProvider/initialState.ts | 2 ++ .../aiInfra/slices/aiProvider/selectors.ts | 4 ++++ 26 files changed, 95 insertions(+), 27 deletions(-) diff --git a/locales/ar/modelProvider.json b/locales/ar/modelProvider.json index c9470d772353..e87210e45129 100644 --- a/locales/ar/modelProvider.json +++ b/locales/ar/modelProvider.json @@ -78,6 +78,8 @@ "title": "نبذة عن مزود الخدمة" }, "id": { + "desc": "معرف فريد لمزود الخدمة، لا يمكن تعديله بعد الإنشاء", + "format": "يمكن أن يحتوي فقط على أحرف صغيرة، وشرطات (-) وشرطات سفلية (_)", "placeholder": "يفضل أن يكون بالكامل بحروف صغيرة، مثل openai، لن يمكن تعديله بعد الإنشاء", "required": "يرجى إدخال معرف المزود", "title": "معرف المزود" diff --git a/locales/bg-BG/modelProvider.json b/locales/bg-BG/modelProvider.json index a90989426b8a..0779b950eef3 100644 --- a/locales/bg-BG/modelProvider.json +++ b/locales/bg-BG/modelProvider.json @@ -78,6 +78,8 @@ "title": "Описание на доставчика" }, "id": { + "desc": "Уникален идентификатор за доставчика на услуги, който не може да бъде променян след създаването му", + "format": "Може да съдържа само малки букви, тирета (-) и долни черти (_)", "placeholder": "Препоръчително изцяло с малки букви, например openai, след създаването не може да се промени", "required": "Моля, въведете ID на доставчика", "title": "ID на доставчика" diff --git a/locales/de-DE/modelProvider.json b/locales/de-DE/modelProvider.json index b6ec6aa307a1..c5905fb4959a 100644 --- a/locales/de-DE/modelProvider.json +++ b/locales/de-DE/modelProvider.json @@ -78,6 +78,8 @@ "title": "Beschreibung des Anbieters" }, "id": { + "desc": "Eindeutige Kennung des Anbieters, die nach der Erstellung nicht mehr geändert werden kann", + "format": "Darf nur aus Kleinbuchstaben, Bindestrichen (-) und Unterstrichen (_) bestehen", "placeholder": "Empfohlen in Kleinbuchstaben, z.B. openai, nach der Erstellung nicht mehr änderbar", "required": "Bitte geben Sie die Anbieter-ID ein", "title": "Anbieter-ID" diff --git a/locales/en-US/modelProvider.json b/locales/en-US/modelProvider.json index a428ff581e4b..c09f1d842812 100644 --- a/locales/en-US/modelProvider.json +++ b/locales/en-US/modelProvider.json @@ -78,6 +78,8 @@ "title": "Provider Description" }, "id": { + "desc": "Unique identifier for the service provider, which cannot be modified after creation", + "format": "Can only contain lowercase letters, hyphens (-), and underscores (_) ", "placeholder": "Suggested all lowercase, e.g., openai, cannot be modified after creation", "required": "Please enter the provider ID", "title": "Provider ID" diff --git a/locales/es-ES/modelProvider.json b/locales/es-ES/modelProvider.json index 809c7a257a18..6f5fa34f7336 100644 --- a/locales/es-ES/modelProvider.json +++ b/locales/es-ES/modelProvider.json @@ -78,6 +78,8 @@ "title": "Descripción del proveedor" }, "id": { + "desc": "Identificador único del proveedor de servicios, no se puede modificar una vez creado", + "format": "Solo puede contener letras minúsculas, guiones (-) y guiones bajos (_)", "placeholder": "Se recomienda en minúsculas, por ejemplo openai, no se puede modificar después de crear", "required": "Por favor, introduce el ID del proveedor", "title": "ID del proveedor" diff --git a/locales/fa-IR/modelProvider.json b/locales/fa-IR/modelProvider.json index cd6f70e2715f..79457b89f291 100644 --- a/locales/fa-IR/modelProvider.json +++ b/locales/fa-IR/modelProvider.json @@ -78,6 +78,8 @@ "title": "توضیحات ارائه‌دهنده" }, "id": { + "desc": "به عنوان شناسه منحصر به فرد ارائه‌دهنده خدمات، پس از ایجاد قابل ویرایش نخواهد بود", + "format": "فقط می‌تواند شامل حروف کوچک، خط تیره (-) و زیرخط (_) باشد", "placeholder": "توصیه می‌شود تماماً با حروف کوچک باشد، مانند openai، پس از ایجاد قابل ویرایش نخواهد بود", "required": "لطفاً شناسه ارائه‌دهنده را وارد کنید", "title": "شناسه ارائه‌دهنده" diff --git a/locales/fr-FR/modelProvider.json b/locales/fr-FR/modelProvider.json index e075ec58c68b..27ec9dc52617 100644 --- a/locales/fr-FR/modelProvider.json +++ b/locales/fr-FR/modelProvider.json @@ -78,6 +78,8 @@ "title": "Description du fournisseur" }, "id": { + "desc": "Identifiant unique du fournisseur de services, qui ne peut pas être modifié après sa création", + "format": "Ne peut contenir que des lettres minuscules, des tirets (-) et des underscores (_) ", "placeholder": "Utilisez uniquement des lettres minuscules, par exemple openai, non modifiable après création", "required": "Veuillez entrer l'ID du fournisseur", "title": "ID du fournisseur" diff --git a/locales/it-IT/modelProvider.json b/locales/it-IT/modelProvider.json index c333a5eb182f..9be4ad414284 100644 --- a/locales/it-IT/modelProvider.json +++ b/locales/it-IT/modelProvider.json @@ -78,6 +78,8 @@ "title": "Descrizione del fornitore" }, "id": { + "desc": "Identificatore unico del fornitore di servizi, non modificabile dopo la creazione", + "format": "Può contenere solo lettere minuscole, trattini (-) e underscore (_)", "placeholder": "Si consiglia di utilizzare solo lettere minuscole, ad esempio openai, non modificabile dopo la creazione", "required": "Inserisci l'ID del fornitore", "title": "ID del fornitore" diff --git a/locales/ja-JP/modelProvider.json b/locales/ja-JP/modelProvider.json index 19f4b9a7dbaf..fde58db18e94 100644 --- a/locales/ja-JP/modelProvider.json +++ b/locales/ja-JP/modelProvider.json @@ -78,6 +78,8 @@ "title": "サービスプロバイダーの紹介" }, "id": { + "desc": "サービスプロバイダーの一意の識別子であり、作成後は変更できません", + "format": "小文字のアルファベット、ハイフン(-)、およびアンダースコア(_)のみを含むことができます", "placeholder": "小文字で入力してください(例: openai)。作成後は変更できません", "required": "サービスプロバイダー ID を入力してください", "title": "サービスプロバイダー ID" diff --git a/locales/ko-KR/modelProvider.json b/locales/ko-KR/modelProvider.json index 34c187879f6f..53ed7de115fa 100644 --- a/locales/ko-KR/modelProvider.json +++ b/locales/ko-KR/modelProvider.json @@ -78,6 +78,8 @@ "title": "서비스 제공자 소개" }, "id": { + "desc": "서비스 제공자의 고유 식별자로, 생성 후에는 수정할 수 없습니다.", + "format": "소문자, 하이픈(-), 및 언더스코어(_)만 포함할 수 있습니다.", "placeholder": "소문자로 입력하세요, 예: openai, 생성 후 수정할 수 없습니다", "required": "서비스 제공자 ID를 입력하세요", "title": "서비스 제공자 ID" diff --git a/locales/nl-NL/modelProvider.json b/locales/nl-NL/modelProvider.json index d29e9942cfb5..9ec6dabc856f 100644 --- a/locales/nl-NL/modelProvider.json +++ b/locales/nl-NL/modelProvider.json @@ -78,6 +78,8 @@ "title": "Beschrijving van de provider" }, "id": { + "desc": "Een unieke identificatie voor de dienstverlener, kan na creatie niet meer worden gewijzigd", + "format": "Mag alleen kleine letters, koppeltekens (-) en underscores (_) bevatten", "placeholder": "Gebruik alleen kleine letters, bijvoorbeeld openai, kan niet worden gewijzigd na aanmaak", "required": "Vul de provider ID in", "title": "Provider ID" diff --git a/locales/pl-PL/modelProvider.json b/locales/pl-PL/modelProvider.json index d2d2b28d5a11..81926714f805 100644 --- a/locales/pl-PL/modelProvider.json +++ b/locales/pl-PL/modelProvider.json @@ -78,6 +78,8 @@ "title": "Opis dostawcy usług" }, "id": { + "desc": "Unikalny identyfikator dostawcy usług, po utworzeniu nie można go zmienić", + "format": "Może zawierać tylko małe litery, myślniki (-) i podkreślenia (_)", "placeholder": "Zaleca się użycie małych liter, np. openai, po utworzeniu nie można edytować", "required": "Proszę wpisać identyfikator dostawcy", "title": "Identyfikator dostawcy" diff --git a/locales/pt-BR/modelProvider.json b/locales/pt-BR/modelProvider.json index 5af0c227a193..e7a9bfc4cd17 100644 --- a/locales/pt-BR/modelProvider.json +++ b/locales/pt-BR/modelProvider.json @@ -78,6 +78,8 @@ "title": "Descrição do Provedor" }, "id": { + "desc": "Identificador único do provedor de serviços, não pode ser modificado após a criação", + "format": "Pode conter apenas letras minúsculas, hífens (-) e sublinhados (_)", "placeholder": "Sugestão: tudo em minúsculas, por exemplo, openai, não poderá ser modificado após a criação", "required": "Por favor, insira o ID do provedor", "title": "ID do Provedor" diff --git a/locales/ru-RU/modelProvider.json b/locales/ru-RU/modelProvider.json index f99390a83aa0..19848e035c2e 100644 --- a/locales/ru-RU/modelProvider.json +++ b/locales/ru-RU/modelProvider.json @@ -78,6 +78,8 @@ "title": "Описание провайдера" }, "id": { + "desc": "Уникальный идентификатор для поставщика услуг, который нельзя изменить после создания", + "format": "Может содержать только строчные буквы, дефисы (-) и подчеркивания (_)", "placeholder": "Рекомендуется использовать строчные буквы, например, openai, после создания изменить нельзя", "required": "Пожалуйста, введите ID провайдера", "title": "ID провайдера" diff --git a/locales/tr-TR/modelProvider.json b/locales/tr-TR/modelProvider.json index 64cb2fb1a103..9a105367b766 100644 --- a/locales/tr-TR/modelProvider.json +++ b/locales/tr-TR/modelProvider.json @@ -78,6 +78,8 @@ "title": "Hizmet Sağlayıcı Tanımı" }, "id": { + "desc": "Hizmet sağlayıcının benzersiz kimliği, oluşturulduktan sonra değiştirilemez", + "format": "Sadece küçük harfler, tire (-) ve alt çizgi (_) içerebilir", "placeholder": "Küçük harflerle yazılması önerilir, örneğin openai, oluşturduktan sonra değiştirilemez", "required": "Lütfen hizmet sağlayıcı ID'sini girin", "title": "Hizmet Sağlayıcı ID" diff --git a/locales/vi-VN/modelProvider.json b/locales/vi-VN/modelProvider.json index 099d6313f03b..adfbc6c5df1f 100644 --- a/locales/vi-VN/modelProvider.json +++ b/locales/vi-VN/modelProvider.json @@ -78,6 +78,8 @@ "title": "Giới thiệu về nhà cung cấp" }, "id": { + "desc": "Là định danh duy nhất của nhà cung cấp dịch vụ, không thể sửa đổi sau khi tạo", + "format": "Chỉ có thể chứa chữ cái thường, dấu gạch ngang (-) và dấu gạch dưới (_)", "placeholder": "Nên viết toàn bộ bằng chữ thường, ví dụ openai, không thể sửa sau khi tạo", "required": "Vui lòng nhập ID nhà cung cấp", "title": "ID nhà cung cấp" diff --git a/locales/zh-CN/modelProvider.json b/locales/zh-CN/modelProvider.json index 9b97ce95b838..533bd82235f1 100644 --- a/locales/zh-CN/modelProvider.json +++ b/locales/zh-CN/modelProvider.json @@ -78,7 +78,9 @@ "title": "服务商简介" }, "id": { - "placeholder": "建议全小写,例如 openai,创建后将不可修改", + "desc": "作为服务商唯一标识,创建后将不可修改", + "format": "只能包含小写字母、连字符(-)和下划线(_)", + "placeholder": "例如 openai、gemini 等", "required": "请填写服务商 ID", "title": "服务商 ID" }, diff --git a/locales/zh-TW/modelProvider.json b/locales/zh-TW/modelProvider.json index b676af5dcee8..d1772d398e12 100644 --- a/locales/zh-TW/modelProvider.json +++ b/locales/zh-TW/modelProvider.json @@ -78,6 +78,8 @@ "title": "服務商簡介" }, "id": { + "desc": "作為服務商唯一標識,創建後將不可修改", + "format": "只能包含小寫字母、連字符(-)和下劃線(_)", "placeholder": "建議全小寫,例如 openai,創建後將不可修改", "required": "請填寫服務商 ID", "title": "服務商 ID" diff --git a/src/app/(main)/settings/provider/features/CreateNewProvider/index.tsx b/src/app/(main)/settings/provider/features/CreateNewProvider/index.tsx index a57d2040847f..e7284d245789 100644 --- a/src/app/(main)/settings/provider/features/CreateNewProvider/index.tsx +++ b/src/app/(main)/settings/provider/features/CreateNewProvider/index.tsx @@ -43,10 +43,17 @@ const CreateNewProvider = memo(({ onClose, open }) => { children: ( ), + desc: t('createNewAiProvider.id.desc'), label: t('createNewAiProvider.id.title'), minWidth: 400, name: 'id', - rules: [{ message: t('createNewAiProvider.id.required'), required: true }], + rules: [ + { message: t('createNewAiProvider.id.required'), required: true }, + { + message: t('createNewAiProvider.id.format'), + pattern: /^[_a-z-]+$/, + }, + ], }, { children: ( diff --git a/src/app/(main)/settings/provider/features/ProviderConfig/Checker.tsx b/src/app/(main)/settings/provider/features/ProviderConfig/Checker.tsx index 0e2f2fa7e37e..22d60164bf0d 100644 --- a/src/app/(main)/settings/provider/features/ProviderConfig/Checker.tsx +++ b/src/app/(main)/settings/provider/features/ProviderConfig/Checker.tsx @@ -12,13 +12,9 @@ import { TraceNameMap } from '@/const/trace'; import { useIsMobile } from '@/hooks/useIsMobile'; import { useProviderName } from '@/hooks/useProviderName'; import { chatService } from '@/services/chat'; +import { aiProviderSelectors, useAiInfraStore } from '@/store/aiInfra'; import { ChatMessageError } from '@/types/message'; -interface ConnectionCheckerProps { - model: string; - provider: string; -} - const Error = memo<{ error: ChatMessageError }>(({ error }) => { const { t } = useTranslation('error'); const providerName = useProviderName(error.body?.provider); @@ -42,9 +38,16 @@ const Error = memo<{ error: ChatMessageError }>(({ error }) => { ); }); +interface ConnectionCheckerProps { + model: string; + provider: string; +} + const Checker = memo(({ model, provider }) => { const { t } = useTranslation('setting'); + const disabled = useAiInfraStore(aiProviderSelectors.isProviderConfigUpdating(provider)); + const [loading, setLoading] = useState(false); const [pass, setPass] = useState(false); @@ -108,7 +111,7 @@ const Checker = memo(({ model, provider }) => { {t('llm.checker.pass')} )} - diff --git a/src/app/(main)/settings/provider/features/ProviderConfig/index.tsx b/src/app/(main)/settings/provider/features/ProviderConfig/index.tsx index 791614286927..4331b89b4aba 100644 --- a/src/app/(main)/settings/provider/features/ProviderConfig/index.tsx +++ b/src/app/(main)/settings/provider/features/ProviderConfig/index.tsx @@ -5,7 +5,7 @@ import { Avatar, Form, type FormItemProps, Icon, type ItemGroup, Tooltip } from import { useDebounceFn } from 'ahooks'; import { Input, Skeleton, Switch } from 'antd'; import { createStyles } from 'antd-style'; -import { LockIcon } from 'lucide-react'; +import { Loader2Icon, LockIcon } from 'lucide-react'; import Link from 'next/link'; import { ReactNode, memo, useLayoutEffect } from 'react'; import { Trans, useTranslation } from 'react-i18next'; @@ -128,7 +128,7 @@ const ProviderConfig = memo( } = settings; const { t } = useTranslation('modelProvider'); const [form] = Form.useForm(); - const { cx, styles } = useStyles(); + const { cx, styles, theme } = useStyles(); const [ toggleProviderEnabled, @@ -136,6 +136,7 @@ const ProviderConfig = memo( updateAiProviderConfig, enabled, isLoading, + configUpdating, isFetchOnClient, isProviderEndpointNotEmpty, isProviderApiKeyNotEmpty, @@ -145,6 +146,7 @@ const ProviderConfig = memo( s.updateAiProviderConfig, aiProviderSelectors.isProviderEnabled(id)(s), aiProviderSelectors.isAiProviderConfigLoading(id)(s), + aiProviderSelectors.isProviderConfigUpdating(id)(s), aiProviderSelectors.isProviderFetchOnClient(id)(s), aiProviderSelectors.isActiveProviderEndpointNotEmpty(s), aiProviderSelectors.isActiveProviderApiKeyNotEmpty(s), @@ -173,6 +175,11 @@ const ProviderConfig = memo( + ) + } /> ), desc: t(`providerModels.config.apiKey.desc`, { name }), @@ -211,6 +218,11 @@ const ProviderConfig = memo( (!!proxyUrl && proxyUrl?.placeholder) || t('providerModels.config.baseURL.placeholder') } + suffix={ + configUpdating && ( + + ) + } /> ), desc: (!!proxyUrl && proxyUrl?.desc) || t('providerModels.config.baseURL.desc'), @@ -235,7 +247,7 @@ const ProviderConfig = memo( children: isLoading ? ( ) : ( - + ), desc: t('providerModels.config.fetchOnClient.desc'), label: t('providerModels.config.fetchOnClient.title'), diff --git a/src/config/aiModels/siliconcloud.ts b/src/config/aiModels/siliconcloud.ts index 53d3fdea438f..a861ca15e822 100644 --- a/src/config/aiModels/siliconcloud.ts +++ b/src/config/aiModels/siliconcloud.ts @@ -303,19 +303,6 @@ const siliconcloudChatModels: AIChatModelCard[] = [ }, type: 'chat', }, - { - contextWindowTokens: 32_768, - description: - 'Qwen2-72B-Instruct 是 Qwen2 系列中的指令微调大语言模型,参数规模为 72B。该模型基于 Transformer 架构,采用了 SwiGLU 激活函数、注意力 QKV 偏置和组查询注意力等技术。它能够处理大规模输入。该模型在语言理解、生成、多语言能力、编码、数学和推理等多个基准测试中表现出色,超越了大多数开源模型,并在某些任务上展现出与专有模型相当的竞争力', - displayName: 'Qwen2 72B Instruct', - id: 'Qwen/Qwen2-7B-Instruct', - pricing: { - currency: 'CNY', - input: 4.13, - output: 4.13, - }, - type: 'chat', - }, { contextWindowTokens: 32_768, description: diff --git a/src/locales/default/modelProvider.ts b/src/locales/default/modelProvider.ts index ea9f084ca061..4d15d69210ed 100644 --- a/src/locales/default/modelProvider.ts +++ b/src/locales/default/modelProvider.ts @@ -79,7 +79,9 @@ export default { title: '服务商简介', }, id: { - placeholder: '建议全小写,例如 openai,创建后将不可修改', + desc: '作为服务商唯一标识,创建后将不可修改', + format: '只能包含小写字母、连字符(-)和下划线(_)', + placeholder: '例如 openai、gemini 等', required: '请填写服务商 ID', title: '服务商 ID', }, diff --git a/src/store/aiInfra/slices/aiProvider/action.ts b/src/store/aiInfra/slices/aiProvider/action.ts index 4879fa39a889..e972b0285bf9 100644 --- a/src/store/aiInfra/slices/aiProvider/action.ts +++ b/src/store/aiInfra/slices/aiProvider/action.ts @@ -28,6 +28,7 @@ enum AiProviderSwrKey { export interface AiProviderAction { createNewAiProvider: (params: CreateAiProviderParams) => Promise; deleteAiProvider: (id: string) => Promise; + internal_toggleAiProviderConfigUpdating: (id: string, loading: boolean) => void; internal_toggleAiProviderLoading: (id: string, loading: boolean) => void; refreshAiProviderDetail: () => Promise; refreshAiProviderList: () => Promise; @@ -64,6 +65,20 @@ export const createAiProviderSlice: StateCreator< await get().refreshAiProviderList(); }, + internal_toggleAiProviderConfigUpdating: (id, loading) => { + set( + (state) => { + if (loading) + return { aiProviderConfigUpdatingIds: [...state.aiProviderConfigUpdatingIds, id] }; + + return { + aiProviderConfigUpdatingIds: state.aiProviderConfigUpdatingIds.filter((i) => i !== id), + }; + }, + false, + 'toggleAiProviderLoading', + ); + }, internal_toggleAiProviderLoading: (id, loading) => { set( (state) => { @@ -109,11 +124,11 @@ export const createAiProviderSlice: StateCreator< }, updateAiProviderConfig: async (id, value) => { - get().internal_toggleAiProviderLoading(id, true); + get().internal_toggleAiProviderConfigUpdating(id, true); await aiProviderService.updateAiProviderConfig(id, value); await get().refreshAiProviderDetail(); - get().internal_toggleAiProviderLoading(id, false); + get().internal_toggleAiProviderConfigUpdating(id, false); }, updateAiProviderSort: async (items) => { diff --git a/src/store/aiInfra/slices/aiProvider/initialState.ts b/src/store/aiInfra/slices/aiProvider/initialState.ts index f84bf23b1a00..7c2376a4ea08 100644 --- a/src/store/aiInfra/slices/aiProvider/initialState.ts +++ b/src/store/aiInfra/slices/aiProvider/initialState.ts @@ -10,6 +10,7 @@ import { export interface AIProviderState { activeAiProvider?: string; activeProviderModelList: any[]; + aiProviderConfigUpdatingIds: string[]; aiProviderDetail?: AiProviderDetailItem | null; aiProviderList: AiProviderListItem[]; aiProviderLoadingIds: string[]; @@ -24,6 +25,7 @@ export interface AIProviderState { export const initialAIProviderState: AIProviderState = { activeProviderModelList: [], + aiProviderConfigUpdatingIds: [], aiProviderList: [], aiProviderLoadingIds: [], aiProviderRuntimeConfig: {}, diff --git a/src/store/aiInfra/slices/aiProvider/selectors.ts b/src/store/aiInfra/slices/aiProvider/selectors.ts index cce6c73c942d..e2de2c626e38 100644 --- a/src/store/aiInfra/slices/aiProvider/selectors.ts +++ b/src/store/aiInfra/slices/aiProvider/selectors.ts @@ -84,6 +84,9 @@ const providerConfigById = return s.aiProviderRuntimeConfig?.[id]; }; +const isProviderConfigUpdating = (id: string) => (s: AIProviderStoreState) => + s.aiProviderConfigUpdatingIds.includes(id); + export const aiProviderSelectors = { activeProviderConfig, disabledAiProviderList, @@ -91,6 +94,7 @@ export const aiProviderSelectors = { isActiveProviderApiKeyNotEmpty, isActiveProviderEndpointNotEmpty, isAiProviderConfigLoading, + isProviderConfigUpdating, isProviderEnabled, isProviderFetchOnClient, isProviderLoading, From 90e0198cabb6ee51a1801e6a25eae565f04c053a Mon Sep 17 00:00:00 2001 From: semantic-release-bot Date: Wed, 8 Jan 2025 04:42:22 +0000 Subject: [PATCH 2/3] :bookmark: chore(release): v1.44.2 [skip ci] MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ### [Version 1.44.2](https://github.com/lobehub/lobe-chat/compare/v1.44.1...v1.44.2) Released on **2025-01-08** #### 🐛 Bug Fixes - **misc**: Add provider id validate.
Improvements and Fixes #### What's fixed * **misc**: Add provider id validate, closes [#5336](https://github.com/lobehub/lobe-chat/issues/5336) ([7f8a1b6](https://github.com/lobehub/lobe-chat/commit/7f8a1b6))
[![](https://img.shields.io/badge/-BACK_TO_TOP-151515?style=flat-square)](#readme-top)
--- CHANGELOG.md | 25 +++++++++++++++++++++++++ package.json | 2 +- 2 files changed, 26 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 979ccc7730ce..62f324109f9c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,31 @@ # Changelog +### [Version 1.44.2](https://github.com/lobehub/lobe-chat/compare/v1.44.1...v1.44.2) + +Released on **2025-01-08** + +#### 🐛 Bug Fixes + +- **misc**: Add provider id validate. + +
+ +
+Improvements and Fixes + +#### What's fixed + +- **misc**: Add provider id validate, closes [#5336](https://github.com/lobehub/lobe-chat/issues/5336) ([7f8a1b6](https://github.com/lobehub/lobe-chat/commit/7f8a1b6)) + +
+ +
+ +[![](https://img.shields.io/badge/-BACK_TO_TOP-151515?style=flat-square)](#readme-top) + +
+ ### [Version 1.44.1](https://github.com/lobehub/lobe-chat/compare/v1.44.0...v1.44.1) Released on **2025-01-08** diff --git a/package.json b/package.json index de049096bc72..f9a862e938f2 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@lobehub/chat", - "version": "1.44.1", + "version": "1.44.2", "description": "Lobe Chat - an open-source, high-performance chatbot framework that supports speech synthesis, multimodal, and extensible Function Call plugin system. Supports one-click free deployment of your private ChatGPT/LLM web application.", "keywords": [ "framework", From 62ba16b1167177844d83ae4d4638f69bbb36bdef Mon Sep 17 00:00:00 2001 From: lobehubbot Date: Wed, 8 Jan 2025 04:43:25 +0000 Subject: [PATCH 3/3] =?UTF-8?q?=F0=9F=93=9D=20docs(bot):=20Auto=20sync=20a?= =?UTF-8?q?gents=20&=20plugin=20to=20readme?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- changelog/v1.json | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/changelog/v1.json b/changelog/v1.json index a8e829900cfb..f3a583cf826e 100644 --- a/changelog/v1.json +++ b/changelog/v1.json @@ -1,4 +1,11 @@ [ + { + "children": { + "fixes": ["Add provider id validate."] + }, + "date": "2025-01-08", + "version": "1.44.2" + }, { "children": { "fixes": ["Fix model select not auto update and sort issue."]