From f40b212b0457d5bcbf34eadf30d540e3f7f79629 Mon Sep 17 00:00:00 2001 From: Joel Date: Thu, 28 Nov 2024 12:00:02 +0800 Subject: [PATCH 01/12] feat: support update if installed from marketplace --- .../hooks/use-check-installed.tsx | 34 +++++++++++ .../steps/install.tsx | 57 ++++++++++++++----- web/service/use-plugins.ts | 30 ++++++++++ 3 files changed, 106 insertions(+), 15 deletions(-) create mode 100644 web/app/components/plugins/install-plugin/hooks/use-check-installed.tsx diff --git a/web/app/components/plugins/install-plugin/hooks/use-check-installed.tsx b/web/app/components/plugins/install-plugin/hooks/use-check-installed.tsx new file mode 100644 index 0000000000..5b35128049 --- /dev/null +++ b/web/app/components/plugins/install-plugin/hooks/use-check-installed.tsx @@ -0,0 +1,34 @@ +import { useCheckInstalled as useDoCheckInstalled } from '@/service/use-plugins' + +import { useMemo } from 'react' +type Props = { + pluginIds: string[], + enabled: boolean +} +const useCheckInstalled = (props: Props) => { + const { data, isLoading, error } = useDoCheckInstalled(props) + + const installedInfo = useMemo(() => { + if (!data) + return undefined + + const res: Record = {} + data?.plugins.forEach((plugin) => { + res[plugin.plugin_id] = { + installedVersion: plugin.declaration.version, + uniqueIdentifier: plugin.plugin_unique_identifier, + } + }) + return res + }, [data]) + return { + installedInfo, + isLoading, + error, + } +} + +export default useCheckInstalled diff --git a/web/app/components/plugins/install-plugin/install-from-marketplace/steps/install.tsx b/web/app/components/plugins/install-plugin/install-from-marketplace/steps/install.tsx index cc7303a4c4..1cb0594e32 100644 --- a/web/app/components/plugins/install-plugin/install-from-marketplace/steps/install.tsx +++ b/web/app/components/plugins/install-plugin/install-from-marketplace/steps/install.tsx @@ -1,7 +1,7 @@ 'use client' import type { FC } from 'react' import React, { useMemo } from 'react' -import { RiInformation2Line } from '@remixicon/react' +// import { RiInformation2Line } from '@remixicon/react' import type { Plugin, PluginManifestInMarket } from '../../../types' import Card from '../../../card' import { pluginManifestInMarketToPluginProps } from '../../utils' @@ -9,8 +9,9 @@ import Button from '@/app/components/base/button' import { useTranslation } from 'react-i18next' import { RiLoader2Line } from '@remixicon/react' import Badge, { BadgeState } from '@/app/components/base/badge/index' -import { useInstallPackageFromMarketPlace } from '@/service/use-plugins' +import { useInstallPackageFromMarketPlace, useUpdatePackageFromMarketPlace } from '@/service/use-plugins' import checkTaskStatus from '../../base/check-task-status' +import useCheckInstalled from '@/app/components/plugins/install-plugin/hooks/use-check-installed' const i18nPrefix = 'plugin.installModal' @@ -32,7 +33,18 @@ const Installed: FC = ({ onFailed, }) => { const { t } = useTranslation() + const toInstallVersion = payload.version || payload.latest_version + const pluginId = (payload as Plugin).plugin_id + const { installedInfo } = useCheckInstalled({ + pluginIds: [pluginId], + enabled: !!pluginId, + }) + const installedInfoPayload = installedInfo?.[pluginId] + const installedVersion = installedInfoPayload?.installedVersion + const hasInstalled = !!installedVersion + const { mutateAsync: installPackageFromMarketPlace } = useInstallPackageFromMarketPlace() + const { mutateAsync: updatePackageFromMarketPlace } = useUpdatePackageFromMarketPlace() const [isInstalling, setIsInstalling] = React.useState(false) const { check, @@ -50,10 +62,28 @@ const Installed: FC = ({ setIsInstalling(true) try { - const { - all_installed: isInstalled, - task_id: taskId, - } = await installPackageFromMarketPlace(uniqueIdentifier) + let taskId + let isInstalled + if (hasInstalled) { + const { + all_installed, + task_id, + } = await updatePackageFromMarketPlace({ + original_plugin_unique_identifier: installedInfoPayload.uniqueIdentifier, + new_plugin_unique_identifier: uniqueIdentifier, + }) + taskId = task_id + isInstalled = all_installed + } + else { + const { + all_installed, + task_id, + } = await installPackageFromMarketPlace(uniqueIdentifier) + taskId = task_id + isInstalled = all_installed + } + if (isInstalled) { onInstalled() return @@ -73,28 +103,25 @@ const Installed: FC = ({ } } - const toInstallVersion = '1.3.0' - const supportCheckInstalled = false // TODO: check installed in beta version. - const versionInfo = useMemo(() => { return (<>{ - payload.latest_version === toInstallVersion || !supportCheckInstalled + !installedVersion ? ( - {payload.version || payload.latest_version} + { } ) : ( <> - {`${payload.latest_version} -> ${toInstallVersion}`} + {`${installedVersion} -> ${toInstallVersion}`} -
+ {/*
Used in 3 apps
-
+
*/} ) }) - }, [payload.latest_version, payload.version, supportCheckInstalled]) + }, [installedVersion, payload]) return ( <> diff --git a/web/service/use-plugins.ts b/web/service/use-plugins.ts index 9bdf63c5c5..50003a2f1a 100644 --- a/web/service/use-plugins.ts +++ b/web/service/use-plugins.ts @@ -8,6 +8,7 @@ import type { PackageDependency, Permissions, Plugin, + PluginDetail, PluginTask, PluginsFromMarketplaceByInfoResponse, PluginsFromMarketplaceResponse, @@ -29,6 +30,25 @@ import { useInvalidateAllBuiltInTools } from './use-tools' const NAME_SPACE = 'plugins' const useInstalledPluginListKey = [NAME_SPACE, 'installedPluginList'] +export const useCheckInstalled = ({ + pluginIds, + enabled, +}: { + pluginIds: string[], + enabled: boolean +}) => { + return useQuery<{ plugins: PluginDetail[] }>({ + queryKey: [NAME_SPACE, 'checkInstalled'], + queryFn: () => post<{ plugins: PluginDetail[] }>('/workspaces/current/plugin/list/installations/ids', { + body: { + plugin_ids: pluginIds, + }, + }), + enabled, + staleTime: 0, // always fresh + }) +} + export const useInstalledPluginList = (disable?: boolean) => { return useQuery({ queryKey: useInstalledPluginListKey, @@ -58,6 +78,16 @@ export const useInstallPackageFromMarketPlace = () => { }) } +export const useUpdatePackageFromMarketPlace = () => { + return useMutation({ + mutationFn: (body: object) => { + return post('/workspaces/current/plugin/upgrade/marketplace', { + body, + }) + }, + }) +} + export const useVersionListOfPlugin = (pluginID: string) => { return useQuery<{ data: VersionListResponse }>({ queryKey: [NAME_SPACE, 'versions', pluginID], From fba468e8ad562ffec78ea19b8de793e9bc351b4e Mon Sep 17 00:00:00 2001 From: Joel Date: Thu, 28 Nov 2024 13:50:04 +0800 Subject: [PATCH 02/12] fix: handle install the same version --- .../install-from-marketplace/steps/install.tsx | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/web/app/components/plugins/install-plugin/install-from-marketplace/steps/install.tsx b/web/app/components/plugins/install-plugin/install-from-marketplace/steps/install.tsx index 1cb0594e32..d8de71c4de 100644 --- a/web/app/components/plugins/install-plugin/install-from-marketplace/steps/install.tsx +++ b/web/app/components/plugins/install-plugin/install-from-marketplace/steps/install.tsx @@ -1,6 +1,6 @@ 'use client' import type { FC } from 'react' -import React, { useMemo } from 'react' +import React, { useEffect, useMemo } from 'react' // import { RiInformation2Line } from '@remixicon/react' import type { Plugin, PluginManifestInMarket } from '../../../types' import Card from '../../../card' @@ -51,6 +51,11 @@ const Installed: FC = ({ stop, } = checkTaskStatus() + useEffect(() => { + if (hasInstalled && toInstallVersion === installedVersion) + onInstalled() + }, [hasInstalled, toInstallVersion, installedVersion]) + const handleCancel = () => { stop() onCancel() @@ -107,7 +112,7 @@ const Installed: FC = ({ return (<>{ !installedVersion ? ( - { } + {toInstallVersion} ) : ( <> From 3e601c4ef52c9a35f542d39cca6641a97c759f48 Mon Sep 17 00:00:00 2001 From: Joel Date: Thu, 28 Nov 2024 14:09:05 +0800 Subject: [PATCH 03/12] feat: local support upgrade --- .../plugins/install-plugin/base/version.tsx | 39 +++++++++++++++ .../steps/install.tsx | 49 ++++++++++++++++--- .../steps/install.tsx | 26 +++------- 3 files changed, 87 insertions(+), 27 deletions(-) create mode 100644 web/app/components/plugins/install-plugin/base/version.tsx diff --git a/web/app/components/plugins/install-plugin/base/version.tsx b/web/app/components/plugins/install-plugin/base/version.tsx new file mode 100644 index 0000000000..891294f095 --- /dev/null +++ b/web/app/components/plugins/install-plugin/base/version.tsx @@ -0,0 +1,39 @@ +'use client' +import type { FC } from 'react' +import React from 'react' +import Badge, { BadgeState } from '@/app/components/base/badge/index' + +type Props = { + hasInstalled: boolean + installedVersion?: string + toInstallVersion: string +} + +const Version: FC = ({ + hasInstalled, + installedVersion, + toInstallVersion, +}) => { + return ( + <> + { + !hasInstalled + ? ( + {toInstallVersion} + ) + : ( + <> + + {`${installedVersion} -> ${toInstallVersion}`} + + {/*
+
Used in 3 apps
+ +
*/} + + ) + } + + ) +} +export default React.memo(Version) diff --git a/web/app/components/plugins/install-plugin/install-from-local-package/steps/install.tsx b/web/app/components/plugins/install-plugin/install-from-local-package/steps/install.tsx index 43c2a03319..e917199a81 100644 --- a/web/app/components/plugins/install-plugin/install-from-local-package/steps/install.tsx +++ b/web/app/components/plugins/install-plugin/install-from-local-package/steps/install.tsx @@ -7,10 +7,10 @@ import { pluginManifestToCardPluginProps } from '../../utils' import Button from '@/app/components/base/button' import { Trans, useTranslation } from 'react-i18next' import { RiLoader2Line } from '@remixicon/react' -import Badge, { BadgeState } from '@/app/components/base/badge/index' -import { useInstallPackageFromLocal } from '@/service/use-plugins' import checkTaskStatus from '../../base/check-task-status' -import { usePluginTaskList } from '@/service/use-plugins' +import { useInstallPackageFromLocal, usePluginTaskList, useUpdatePackageFromMarketPlace } from '@/service/use-plugins' +import useCheckInstalled from '@/app/components/plugins/install-plugin/hooks/use-check-installed' +import Version from '../../base/version' const i18nPrefix = 'plugin.installModal' @@ -32,8 +32,19 @@ const Installed: FC = ({ onFailed, }) => { const { t } = useTranslation() + const toInstallVersion = payload.version + const pluginId = `${payload.author}/${payload.name}` + const { installedInfo } = useCheckInstalled({ + pluginIds: [pluginId], + enabled: !!pluginId, + }) + const installedInfoPayload = installedInfo?.[pluginId] + const installedVersion = installedInfoPayload?.installedVersion + const hasInstalled = !!installedVersion + const [isInstalling, setIsInstalling] = React.useState(false) const { mutateAsync: installPackageFromLocal } = useInstallPackageFromLocal() + const { mutateAsync: updatePackageFromMarketPlace } = useUpdatePackageFromMarketPlace() const { check, @@ -52,10 +63,28 @@ const Installed: FC = ({ onStartToInstall?.() try { - const { - all_installed: isInstalled, - task_id: taskId, - } = await installPackageFromLocal(uniqueIdentifier) + let taskId + let isInstalled + if (hasInstalled) { + const { + all_installed, + task_id, + } = await updatePackageFromMarketPlace({ + original_plugin_unique_identifier: installedInfoPayload.uniqueIdentifier, + new_plugin_unique_identifier: uniqueIdentifier, + }) + taskId = task_id + isInstalled = all_installed + } + else { + const { + all_installed, + task_id, + } = await installPackageFromLocal(uniqueIdentifier) + taskId = task_id + isInstalled = all_installed + } + if (isInstalled) { onInstalled() return @@ -92,7 +121,11 @@ const Installed: FC = ({ {payload.version}} + titleLeft={} /> diff --git a/web/app/components/plugins/install-plugin/install-from-marketplace/steps/install.tsx b/web/app/components/plugins/install-plugin/install-from-marketplace/steps/install.tsx index d8de71c4de..5059460fad 100644 --- a/web/app/components/plugins/install-plugin/install-from-marketplace/steps/install.tsx +++ b/web/app/components/plugins/install-plugin/install-from-marketplace/steps/install.tsx @@ -8,10 +8,10 @@ import { pluginManifestInMarketToPluginProps } from '../../utils' import Button from '@/app/components/base/button' import { useTranslation } from 'react-i18next' import { RiLoader2Line } from '@remixicon/react' -import Badge, { BadgeState } from '@/app/components/base/badge/index' import { useInstallPackageFromMarketPlace, useUpdatePackageFromMarketPlace } from '@/service/use-plugins' import checkTaskStatus from '../../base/check-task-status' import useCheckInstalled from '@/app/components/plugins/install-plugin/hooks/use-check-installed' +import Version from '../../base/version' const i18nPrefix = 'plugin.installModal' @@ -109,23 +109,7 @@ const Installed: FC = ({ } const versionInfo = useMemo(() => { - return (<>{ - !installedVersion - ? ( - {toInstallVersion} - ) - : ( - <> - - {`${installedVersion} -> ${toInstallVersion}`} - - {/*
-
Used in 3 apps
- -
*/} - - ) - }) + return (<>) }, [installedVersion, payload]) return ( @@ -138,7 +122,11 @@ const Installed: FC = ({ } /> From 073e8475242672c2f851be85d5dbf9a386fc5c4b Mon Sep 17 00:00:00 2001 From: Joel Date: Thu, 28 Nov 2024 14:13:43 +0800 Subject: [PATCH 04/12] fix: installed --- .../install-from-local-package/steps/install.tsx | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/web/app/components/plugins/install-plugin/install-from-local-package/steps/install.tsx b/web/app/components/plugins/install-plugin/install-from-local-package/steps/install.tsx index e917199a81..37f2bde06f 100644 --- a/web/app/components/plugins/install-plugin/install-from-local-package/steps/install.tsx +++ b/web/app/components/plugins/install-plugin/install-from-local-package/steps/install.tsx @@ -1,6 +1,6 @@ 'use client' import type { FC } from 'react' -import React from 'react' +import React, { useEffect } from 'react' import type { PluginDeclaration } from '../../../types' import Card from '../../../card' import { pluginManifestToCardPluginProps } from '../../utils' @@ -42,6 +42,11 @@ const Installed: FC = ({ const installedVersion = installedInfoPayload?.installedVersion const hasInstalled = !!installedVersion + useEffect(() => { + if (hasInstalled && toInstallVersion === installedVersion) + onInstalled() + }, [hasInstalled, toInstallVersion, installedVersion]) + const [isInstalling, setIsInstalling] = React.useState(false) const { mutateAsync: installPackageFromLocal } = useInstallPackageFromLocal() const { mutateAsync: updatePackageFromMarketPlace } = useUpdatePackageFromMarketPlace() From 51f0f21a4770dc638fabab98a6eaaa9859045927 Mon Sep 17 00:00:00 2001 From: Joel Date: Thu, 28 Nov 2024 14:30:31 +0800 Subject: [PATCH 05/12] chore: not load updateInfo can not install --- .../install-from-local-package/steps/install.tsx | 6 +++--- .../install-from-marketplace/steps/install.tsx | 12 ++++-------- 2 files changed, 7 insertions(+), 11 deletions(-) diff --git a/web/app/components/plugins/install-plugin/install-from-local-package/steps/install.tsx b/web/app/components/plugins/install-plugin/install-from-local-package/steps/install.tsx index 37f2bde06f..d37275f19a 100644 --- a/web/app/components/plugins/install-plugin/install-from-local-package/steps/install.tsx +++ b/web/app/components/plugins/install-plugin/install-from-local-package/steps/install.tsx @@ -34,7 +34,7 @@ const Installed: FC = ({ const { t } = useTranslation() const toInstallVersion = payload.version const pluginId = `${payload.author}/${payload.name}` - const { installedInfo } = useCheckInstalled({ + const { installedInfo, isLoading } = useCheckInstalled({ pluginIds: [pluginId], enabled: !!pluginId, }) @@ -126,7 +126,7 @@ const Installed: FC = ({ = ({ - + From 3ddb3d2bffa30a24f939cab1e2c4b7d6500b4a77 Mon Sep 17 00:00:00 2001 From: JzoNg Date: Thu, 28 Nov 2024 15:45:47 +0800 Subject: [PATCH 08/12] fix: deleted tools in agent --- web/app/components/app/configuration/index.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/web/app/components/app/configuration/index.tsx b/web/app/components/app/configuration/index.tsx index 70ce4274d7..fbb375aa27 100644 --- a/web/app/components/app/configuration/index.tsx +++ b/web/app/components/app/configuration/index.tsx @@ -622,7 +622,7 @@ const Configuration: FC = () => { }).map((tool: any) => { return { ...tool, - isDeleted: res.deleted_tools?.includes(tool.tool_name), + isDeleted: res.deleted_tools?.some((deletedTool: any) => deletedTool.id === tool.id && deletedTool.tool_name === tool.tool_name), notAuthor: collectionList.find(c => tool.provider_id === c.id)?.is_team_authorization === false, ...(tool.provider_type === 'builtin' ? { provider_id: correctProvider(tool.provider_name), From 5f76975e1262c4d9ced1bf89423ebe94be9af5ad Mon Sep 17 00:00:00 2001 From: JzoNg Date: Thu, 28 Nov 2024 15:57:56 +0800 Subject: [PATCH 09/12] fix: icon of tool provider in agent --- .../app/configuration/config/agent/agent-tools/index.tsx | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/web/app/components/app/configuration/config/agent/agent-tools/index.tsx b/web/app/components/app/configuration/config/agent/agent-tools/index.tsx index 40c4232270..285eabaed7 100644 --- a/web/app/components/app/configuration/config/agent/agent-tools/index.tsx +++ b/web/app/components/app/configuration/config/agent/agent-tools/index.tsx @@ -50,7 +50,11 @@ const AgentTools: FC = () => { const [isShowSettingTool, setIsShowSettingTool] = useState(false) const [isShowSettingAuth, setShowSettingAuth] = useState(false) const tools = (modelConfig?.agentConfig?.tools as AgentTool[] || []).map((item) => { - const collection = collectionList.find(collection => collection.id === item.provider_id.split('/').pop() && collection.type === item.provider_type) + const collection = collectionList.find( + collection => + collection.id.split('/').pop() === item.provider_id.split('/').pop() + && collection.type === item.provider_type, + ) const icon = collection?.icon return { ...item, From 73825c59e423d6e4f61537912957bb9b90aa78d3 Mon Sep 17 00:00:00 2001 From: JzoNg Date: Thu, 28 Nov 2024 16:03:32 +0800 Subject: [PATCH 10/12] fix: crash of tool authorization in agent --- .../app/configuration/config/agent/agent-tools/index.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/web/app/components/app/configuration/config/agent/agent-tools/index.tsx b/web/app/components/app/configuration/config/agent/agent-tools/index.tsx index 285eabaed7..9beb50eeba 100644 --- a/web/app/components/app/configuration/config/agent/agent-tools/index.tsx +++ b/web/app/components/app/configuration/config/agent/agent-tools/index.tsx @@ -44,7 +44,7 @@ const AgentTools: FC = () => { const [currentTool, setCurrentTool] = useState(null) const currentCollection = useMemo(() => { if (!currentTool) return null - const collection = collectionList.find(collection => collection.id === currentTool?.provider_id.split('/').pop() && collection.type === currentTool?.provider_type) + const collection = collectionList.find(collection => collection.id.split('/').pop() === currentTool?.provider_id.split('/').pop() && collection.type === currentTool?.provider_type) return collection }, [currentTool, collectionList]) const [isShowSettingTool, setIsShowSettingTool] = useState(false) From 3bcd470ec629f713ceb7529961ee32b83b8f3bfe Mon Sep 17 00:00:00 2001 From: JzoNg Date: Thu, 28 Nov 2024 17:22:36 +0800 Subject: [PATCH 11/12] fix: authorization in debugging plugin --- .../plugins/plugin-detail-panel/action-list.tsx | 15 +++++++++------ web/service/use-tools.ts | 2 +- 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/web/app/components/plugins/plugin-detail-panel/action-list.tsx b/web/app/components/plugins/plugin-detail-panel/action-list.tsx index 334587ce31..02e59a005c 100644 --- a/web/app/components/plugins/plugin-detail-panel/action-list.tsx +++ b/web/app/components/plugins/plugin-detail-panel/action-list.tsx @@ -1,4 +1,4 @@ -import React, { useState } from 'react' +import React, { useMemo, useState } from 'react' import { useTranslation } from 'react-i18next' import { useAppContext } from '@/context/app-context' import Button from '@/app/components/base/button' @@ -7,9 +7,9 @@ import Indicator from '@/app/components/header/indicator' import ToolItem from '@/app/components/tools/provider/tool-item' import ConfigCredential from '@/app/components/tools/setting/build-in/config-credentials' import { - useBuiltinProviderInfo, + useAllToolProviders, useBuiltinTools, - useInvalidateBuiltinProviderInfo, + useInvalidateAllToolProviders, useRemoveProviderCredentials, useUpdateProviderCredentials, } from '@/service/use-tools' @@ -26,14 +26,17 @@ const ActionList = ({ const { isCurrentWorkspaceManager } = useAppContext() const providerBriefInfo = detail.declaration.tool.identity const providerKey = `${detail.plugin_id}/${providerBriefInfo.name}` - const { data: provider } = useBuiltinProviderInfo(providerKey) - const invalidateProviderInfo = useInvalidateBuiltinProviderInfo() + const { data: collectionList = [] } = useAllToolProviders() + const invalidateAllToolProviders = useInvalidateAllToolProviders() + const provider = useMemo(() => { + return collectionList.find(collection => collection.name === providerKey) + }, [collectionList, providerKey]) const { data } = useBuiltinTools(providerKey) const [showSettingAuth, setShowSettingAuth] = useState(false) const handleCredentialSettingUpdate = () => { - invalidateProviderInfo(providerKey) + invalidateAllToolProviders() Toast.notify({ type: 'success', message: t('common.api.actionSuccess'), diff --git a/web/service/use-tools.ts b/web/service/use-tools.ts index bf9678332f..ceaa4b14b3 100644 --- a/web/service/use-tools.ts +++ b/web/service/use-tools.ts @@ -15,7 +15,7 @@ const NAME_SPACE = 'tools' const useAllToolProvidersKey = [NAME_SPACE, 'allToolProviders'] export const useAllToolProviders = () => { - return useQuery({ + return useQuery({ queryKey: useAllToolProvidersKey, queryFn: () => get('/workspaces/current/tool-providers'), }) From be7fa93ffcfb225e48ef731e80a6dcade21f03e3 Mon Sep 17 00:00:00 2001 From: JzoNg Date: Thu, 28 Nov 2024 17:27:04 +0800 Subject: [PATCH 12/12] fix: modify tip of default embedding model --- web/i18n/en-US/dataset-creation.ts | 2 +- web/i18n/zh-Hans/dataset-creation.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/web/i18n/en-US/dataset-creation.ts b/web/i18n/en-US/dataset-creation.ts index de885671a7..88b55182c9 100644 --- a/web/i18n/en-US/dataset-creation.ts +++ b/web/i18n/en-US/dataset-creation.ts @@ -117,7 +117,7 @@ const translation = { qualified: 'High Quality', recommend: 'Recommend', qualifiedTip: 'Call default system embedding interface for processing to provide higher accuracy when users query.', - warning: 'Please set up the model provider API key first.', + warning: 'Please set up the default embedding model first.', click: 'Go to settings', economical: 'Economical', economicalTip: 'Use offline vector engines, keyword indexes, etc. to reduce accuracy without spending tokens', diff --git a/web/i18n/zh-Hans/dataset-creation.ts b/web/i18n/zh-Hans/dataset-creation.ts index fac809d7e2..5cd27fcbda 100644 --- a/web/i18n/zh-Hans/dataset-creation.ts +++ b/web/i18n/zh-Hans/dataset-creation.ts @@ -117,7 +117,7 @@ const translation = { qualified: '高质量', recommend: '推荐', qualifiedTip: '调用系统默认的嵌入接口进行处理,以在用户查询时提供更高的准确度', - warning: '请先完成模型供应商的 API KEY 设置。.', + warning: '请先设置默认 embedding 模型', click: '前往设置', economical: '经济', economicalTip: '使用离线的向量引擎、关键词索引等方式,降低了准确度但无需花费 Token',