From abe082b9abd0b286edf6bfec6235c5c813124e78 Mon Sep 17 00:00:00 2001
From: Archer <545436317@qq.com>
Date: Wed, 12 Feb 2025 16:36:21 +0800
Subject: [PATCH] i18n perf (#3770)
* model config
* feat: normalization embedding
* perf: mark ui
* perf: i18n
* fix: rerank error tip
---
.../zh-cn/docs/development/upgrading/490.md | 15 ---------------
packages/service/core/ai/rerank/index.ts | 3 +++
.../service/core/dataset/search/controller.ts | 2 +-
packages/service/core/workflow/dispatch/utils.ts | 2 +-
packages/web/i18n/en/common.json | 4 ++--
packages/web/i18n/zh-CN/common.json | 4 ++--
packages/web/i18n/zh-Hant/common.json | 4 ++--
.../src/components/common/folder/SlideCard.tsx | 2 +-
.../app/src/components/core/app/VariableEdit.tsx | 4 ++--
.../ChatBox/components/SelectMarkCollection.tsx | 6 ++----
.../Flow/nodes/NodeFormInput/index.tsx | 2 +-
.../Flow/nodes/NodeToolParams/index.tsx | 2 +-
.../render/RenderToolInput/EditFieldModal.tsx | 2 +-
13 files changed, 19 insertions(+), 33 deletions(-)
delete mode 100644 docSite/content/zh-cn/docs/development/upgrading/490.md
diff --git a/docSite/content/zh-cn/docs/development/upgrading/490.md b/docSite/content/zh-cn/docs/development/upgrading/490.md
deleted file mode 100644
index 7ded0c9b9..000000000
--- a/docSite/content/zh-cn/docs/development/upgrading/490.md
+++ /dev/null
@@ -1,15 +0,0 @@
----
-title: 'V4.9.0(进行中)'
-description: 'FastGPT V4.9.0 更新说明'
-icon: 'upgrade'
-draft: false
-toc: true
-weight: 804
----
-
-
-
-## 完整更新内容
-
-1. 修复 - 简易模式,切换到其他非视觉模型时候,会强制关闭图片识别。
-2. 修复 - o1,o3 模型,在测试时候字段映射未生效导致报错。
\ No newline at end of file
diff --git a/packages/service/core/ai/rerank/index.ts b/packages/service/core/ai/rerank/index.ts
index 7a019d73b..9d72dc551 100644
--- a/packages/service/core/ai/rerank/index.ts
+++ b/packages/service/core/ai/rerank/index.ts
@@ -25,6 +25,9 @@ export function reRankRecall({
if (!model) {
return Promise.reject('no rerank model');
}
+ if (documents.length === 0) {
+ return Promise.resolve([]);
+ }
const { baseUrl, authorization } = getAxiosConfig();
diff --git a/packages/service/core/dataset/search/controller.ts b/packages/service/core/dataset/search/controller.ts
index 3ae4e5aef..e39084121 100644
--- a/packages/service/core/dataset/search/controller.ts
+++ b/packages/service/core/dataset/search/controller.ts
@@ -635,7 +635,7 @@ export async function searchDatasetData(
return true;
});
try {
- return datasetDataReRank({
+ return await datasetDataReRank({
query: reRankQuery,
data: filterSameDataResults
});
diff --git a/packages/service/core/workflow/dispatch/utils.ts b/packages/service/core/workflow/dispatch/utils.ts
index 55e68815c..d73da3147 100644
--- a/packages/service/core/workflow/dispatch/utils.ts
+++ b/packages/service/core/workflow/dispatch/utils.ts
@@ -142,7 +142,7 @@ export const checkQuoteQAValue = (quoteQA?: SearchDataResponseItemType[]) => {
if (quoteQA.length === 0) {
return [];
}
- if (quoteQA.some((item) => !item.q)) {
+ if (quoteQA.some((item) => typeof item !== 'object' || !item.q)) {
return undefined;
}
return quoteQA;
diff --git a/packages/web/i18n/en/common.json b/packages/web/i18n/en/common.json
index d26a51fb0..fd3acd586 100644
--- a/packages/web/i18n/en/common.json
+++ b/packages/web/i18n/en/common.json
@@ -165,7 +165,7 @@
"common.Not open": "Not Open",
"common.OK": "OK",
"common.Open": "Open",
- "common.Operation": "Operation",
+ "Operation": "Operation",
"common.Other": "Other",
"common.Output": "Output",
"common.Params": "Parameters",
@@ -179,7 +179,7 @@
"common.Remove": "Remove",
"common.Rename": "Rename",
"common.Request Error": "Request Error",
- "common.Require Input": "Required",
+ "Required_input": "Required",
"common.Reset": "Reset",
"common.Restart": "Restart",
"common.Role": "Permission",
diff --git a/packages/web/i18n/zh-CN/common.json b/packages/web/i18n/zh-CN/common.json
index e98c7028d..27d345137 100644
--- a/packages/web/i18n/zh-CN/common.json
+++ b/packages/web/i18n/zh-CN/common.json
@@ -169,7 +169,7 @@
"common.Not open": "未开启",
"common.OK": "好的",
"common.Open": "打开",
- "common.Operation": "操作",
+ "Operation": "操作",
"common.Other": "其他",
"common.Output": "输出",
"common.Params": "参数",
@@ -183,7 +183,7 @@
"common.Remove": "移除",
"common.Rename": "重命名",
"common.Request Error": "请求异常",
- "common.Require Input": "必填",
+ "Required_input": "必填",
"common.Reset": "恢复默认",
"common.Restart": "重新开始",
"common.Role": "权限",
diff --git a/packages/web/i18n/zh-Hant/common.json b/packages/web/i18n/zh-Hant/common.json
index e0278cfc7..18c33bab3 100644
--- a/packages/web/i18n/zh-Hant/common.json
+++ b/packages/web/i18n/zh-Hant/common.json
@@ -164,7 +164,7 @@
"common.Not open": "未開啟",
"common.OK": "確定",
"common.Open": "開啟",
- "common.Operation": "操作",
+ "Operation": "操作",
"common.Other": "其他",
"common.Output": "輸出",
"common.Params": "參數",
@@ -178,7 +178,7 @@
"common.Remove": "移除",
"common.Rename": "重新命名",
"common.Request Error": "請求錯誤",
- "common.Require Input": "必填",
+ "Required_input": "必填",
"common.Reset": "恢復預設",
"common.Restart": "重新開始",
"common.Role": "權限",
diff --git a/projects/app/src/components/common/folder/SlideCard.tsx b/projects/app/src/components/common/folder/SlideCard.tsx
index 0f39051c0..c69de0b89 100644
--- a/projects/app/src/components/common/folder/SlideCard.tsx
+++ b/projects/app/src/components/common/folder/SlideCard.tsx
@@ -76,7 +76,7 @@ const FolderSlideCard = ({
- {t('common:common.Operation')}
+ {t('common:Operation')}