Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
赵月辉
/
fastgpt-migrated
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Unverified
Commit
ef537f39
authored
May 06, 2025
by
Archer
Committed by
GitHub
May 06, 2025
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: rerank usage (#4751)
* remove invalid index * perf: i18n * fix: rerank usage
parent
367ee517
Show whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
38 additions
and
34 deletions
+38
-34
packages/global/support/wallet/bill/type.d.ts
+5
-0
packages/service/core/chat/chatItemSchema.ts
+0
-2
packages/web/components/common/Textarea/JsonEditor/index.tsx
+1
-1
packages/web/hooks/useCopyData.tsx
+1
-1
packages/web/i18n/en/common.json
+6
-7
packages/web/i18n/zh-CN/common.json
+6
-7
packages/web/i18n/zh-Hant/common.json
+6
-7
projects/app/src/pages/api/core/dataset/searchTest.ts
+1
-1
projects/app/src/pages/dataset/list/index.tsx
+10
-6
projects/app/src/web/common/hooks/useSpeech.ts
+2
-2
No files found.
packages/global/support/wallet/bill/type.d.ts
View file @
ef537f39
...
@@ -21,6 +21,11 @@ export type BillSchemaType = {
...
@@ -21,6 +21,11 @@ export type BillSchemaType = {
datasetSize
?:
number
;
datasetSize
?:
number
;
extraPoints
?:
number
;
extraPoints
?:
number
;
};
};
refundData
?:
{
amount
:
number
;
refundId
:
string
;
refundTime
:
Date
;
};
};
};
export
type
ChatNodeUsageType
=
{
export
type
ChatNodeUsageType
=
{
...
...
packages/service/core/chat/chatItemSchema.ts
View file @
ef537f39
...
@@ -95,8 +95,6 @@ try {
...
@@ -95,8 +95,6 @@ try {
close custom feedback;
close custom feedback;
*/
*/
ChatItemSchema
.
index
({
appId
:
1
,
chatId
:
1
,
dataId
:
1
});
ChatItemSchema
.
index
({
appId
:
1
,
chatId
:
1
,
dataId
:
1
});
// admin charts
ChatItemSchema
.
index
({
time
:
-
1
,
obj
:
1
});
// timer, clear history
// timer, clear history
ChatItemSchema
.
index
({
teamId
:
1
,
time
:
-
1
});
ChatItemSchema
.
index
({
teamId
:
1
,
time
:
-
1
});
...
...
packages/web/components/common/Textarea/JsonEditor/index.tsx
View file @
ef537f39
...
@@ -178,7 +178,7 @@ const JSONEditor = ({
...
@@ -178,7 +178,7 @@ const JSONEditor = ({
}
catch
(
error
)
{
}
catch
(
error
)
{
toast
({
toast
({
status
:
'warning'
,
status
:
'warning'
,
title
:
t
(
'common:json
Editor.Parse
error'
)
title
:
t
(
'common:json
_parse_
error'
)
});
});
}
}
},
[
value
]);
},
[
value
]);
...
...
packages/web/hooks/useCopyData.tsx
View file @
ef537f39
...
@@ -20,7 +20,7 @@ export const useCopyData = () => {
...
@@ -20,7 +20,7 @@ export const useCopyData = () => {
const
copyData
=
useCallback
(
const
copyData
=
useCallback
(
async
(
async
(
data
:
string
,
data
:
string
,
title
:
string
|
null
|
undefined
=
t
(
'common:
Copy S
uccessful'
),
title
:
string
|
null
|
undefined
=
t
(
'common:
copy_s
uccessful'
),
duration
=
1000
duration
=
1000
)
=>
{
)
=>
{
data
=
data
.
trim
();
data
=
data
.
trim
();
...
...
packages/web/i18n/en/common.json
View file @
ef537f39
...
@@ -135,7 +135,7 @@
...
@@ -135,7 +135,7 @@
"comfirm_leave_page"
:
"Confirm to Leave This Page?"
,
"comfirm_leave_page"
:
"Confirm to Leave This Page?"
,
"Continue_Adding"
:
"Continue adding"
,
"Continue_Adding"
:
"Continue adding"
,
"Copy"
:
"Copy"
,
"Copy"
:
"Copy"
,
"
Copy S
uccessful"
:
"Copied Successfully"
,
"
copy_s
uccessful"
:
"Copied Successfully"
,
"create_failed"
:
"Creation Failed"
,
"create_failed"
:
"Creation Failed"
,
"create_success"
:
"Created Successfully"
,
"create_success"
:
"Created Successfully"
,
"create_time"
:
"Creation Time"
,
"create_time"
:
"Creation Time"
,
...
@@ -239,7 +239,7 @@
...
@@ -239,7 +239,7 @@
"have_done"
:
"Completed"
,
"have_done"
:
"Completed"
,
"input.Repeat Value"
:
"Duplicate Value"
,
"input.Repeat Value"
:
"Duplicate Value"
,
"is_requesting"
:
"Requesting..."
,
"is_requesting"
:
"Requesting..."
,
"json
Editor.Parse
error"
:
"Possible JSON Error, Please Check Carefully"
,
"json
_parse_
error"
:
"Possible JSON Error, Please Check Carefully"
,
"json_config"
:
"JSON Configuration"
,
"json_config"
:
"JSON Configuration"
,
"link.UnValid"
:
"Invalid Link"
,
"link.UnValid"
:
"Invalid Link"
,
"month"
:
"Month"
,
"month"
:
"Month"
,
...
@@ -251,13 +251,13 @@
...
@@ -251,13 +251,13 @@
"redo_tip_mac"
:
"Redo ⌘ shift z"
,
"redo_tip_mac"
:
"Redo ⌘ shift z"
,
"request_end"
:
"All Loaded"
,
"request_end"
:
"All Loaded"
,
"request_more"
:
"Click to Load More"
,
"request_more"
:
"Click to Load More"
,
"speech
.error
tip"
:
"Speech to Text Failed"
,
"speech
_error_
tip"
:
"Speech to Text Failed"
,
"speech
.not
support"
:
"Your Browser Does Not Support Speech Input"
,
"speech
_not_
support"
:
"Your Browser Does Not Support Speech Input"
,
"submit_success"
:
"Submitted Successfully"
,
"submit_success"
:
"Submitted Successfully"
,
"submitted"
:
"Submitted"
,
"submitted"
:
"Submitted"
,
"support"
:
"Support"
,
"support"
:
"Support"
,
"system
.Help C
hatbot"
:
"Help Chatbot"
,
"system
_help_c
hatbot"
:
"Help Chatbot"
,
"
system.Use H
elper"
:
"Use Helper"
,
"
use_h
elper"
:
"Use Helper"
,
"ui.textarea.Magnifying"
:
"Magnifying"
,
"ui.textarea.Magnifying"
:
"Magnifying"
,
"undo_tip"
:
"Undo ctrl z"
,
"undo_tip"
:
"Undo ctrl z"
,
"undo_tip_mac"
:
"Undo ⌘ z "
,
"undo_tip_mac"
:
"Undo ⌘ z "
,
...
@@ -274,7 +274,6 @@
...
@@ -274,7 +274,6 @@
"contact_way"
:
"Notification Received"
,
"contact_way"
:
"Notification Received"
,
"contribute_app_template"
:
"Contribute Template"
,
"contribute_app_template"
:
"Contribute Template"
,
"core.Chat"
:
"Chat"
,
"core.Chat"
:
"Chat"
,
"core.Max Token"
:
"Max Token"
,
"core.ai.Max context"
:
"Max Context"
,
"core.ai.Max context"
:
"Max Context"
,
"core.ai.Model"
:
"Model"
,
"core.ai.Model"
:
"Model"
,
"core.ai.Not deploy rerank model"
:
"Re-rank Model Not Deployed"
,
"core.ai.Not deploy rerank model"
:
"Re-rank Model Not Deployed"
,
...
...
packages/web/i18n/zh-CN/common.json
View file @
ef537f39
...
@@ -133,7 +133,7 @@
...
@@ -133,7 +133,7 @@
"comfirm_leave_page"
:
"确认离开该页面?"
,
"comfirm_leave_page"
:
"确认离开该页面?"
,
"Continue_Adding"
:
"继续添加"
,
"Continue_Adding"
:
"继续添加"
,
"Copy"
:
"复制"
,
"Copy"
:
"复制"
,
"
Copy S
uccessful"
:
"复制成功"
,
"
copy_s
uccessful"
:
"复制成功"
,
"create_failed"
:
"创建异常"
,
"create_failed"
:
"创建异常"
,
"create_success"
:
"创建成功"
,
"create_success"
:
"创建成功"
,
"create_time"
:
"创建时间"
,
"create_time"
:
"创建时间"
,
...
@@ -239,7 +239,7 @@
...
@@ -239,7 +239,7 @@
"have_done"
:
"已完成"
,
"have_done"
:
"已完成"
,
"input.Repeat Value"
:
"有重复的值"
,
"input.Repeat Value"
:
"有重复的值"
,
"is_requesting"
:
"请求中……"
,
"is_requesting"
:
"请求中……"
,
"json
Editor.Parse
error"
:
"JSON 可能有误,请仔细检查"
,
"json
_parse_
error"
:
"JSON 可能有误,请仔细检查"
,
"json_config"
:
"JSON 配置"
,
"json_config"
:
"JSON 配置"
,
"link.UnValid"
:
"无效的链接"
,
"link.UnValid"
:
"无效的链接"
,
"month"
:
"月"
,
"month"
:
"月"
,
...
@@ -251,13 +251,13 @@
...
@@ -251,13 +251,13 @@
"redo_tip_mac"
:
"恢复 ⌘ shift z"
,
"redo_tip_mac"
:
"恢复 ⌘ shift z"
,
"request_end"
:
"已加载全部"
,
"request_end"
:
"已加载全部"
,
"request_more"
:
"点击加载更多"
,
"request_more"
:
"点击加载更多"
,
"speech
.error
tip"
:
"语音转文字失败"
,
"speech
_error_
tip"
:
"语音转文字失败"
,
"speech
.not
support"
:
"您的浏览器不支持语音输入"
,
"speech
_not_
support"
:
"您的浏览器不支持语音输入"
,
"submit_success"
:
"提交成功"
,
"submit_success"
:
"提交成功"
,
"submitted"
:
"已提交"
,
"submitted"
:
"已提交"
,
"support"
:
"支持"
,
"support"
:
"支持"
,
"system
.Help C
hatbot"
:
"机器人助手"
,
"system
_help_c
hatbot"
:
"机器人助手"
,
"
system.Use H
elper"
:
"使用帮助"
,
"
use_h
elper"
:
"使用帮助"
,
"ui.textarea.Magnifying"
:
"放大"
,
"ui.textarea.Magnifying"
:
"放大"
,
"undo_tip"
:
"撤销 ctrl z"
,
"undo_tip"
:
"撤销 ctrl z"
,
"undo_tip_mac"
:
"撤销 ⌘ z "
,
"undo_tip_mac"
:
"撤销 ⌘ z "
,
...
@@ -273,7 +273,6 @@
...
@@ -273,7 +273,6 @@
"contact_way"
:
"通知接收"
,
"contact_way"
:
"通知接收"
,
"contribute_app_template"
:
"贡献模板"
,
"contribute_app_template"
:
"贡献模板"
,
"core.Chat"
:
"对话"
,
"core.Chat"
:
"对话"
,
"core.Max Token"
:
"单条数据上限"
,
"core.ai.Max context"
:
"最大上下文"
,
"core.ai.Max context"
:
"最大上下文"
,
"core.ai.Model"
:
"AI 模型"
,
"core.ai.Model"
:
"AI 模型"
,
"core.ai.Not deploy rerank model"
:
"未部署重排模型"
,
"core.ai.Not deploy rerank model"
:
"未部署重排模型"
,
...
...
packages/web/i18n/zh-Hant/common.json
View file @
ef537f39
...
@@ -132,7 +132,7 @@
...
@@ -132,7 +132,7 @@
"comfirm_leave_page"
:
"確認離開此頁面?"
,
"comfirm_leave_page"
:
"確認離開此頁面?"
,
"Continue_Adding"
:
"繼續新增"
,
"Continue_Adding"
:
"繼續新增"
,
"Copy"
:
"複製"
,
"Copy"
:
"複製"
,
"
Copy S
uccessful"
:
"複製成功"
,
"
copy_s
uccessful"
:
"複製成功"
,
"create_failed"
:
"建立失敗"
,
"create_failed"
:
"建立失敗"
,
"create_success"
:
"建立成功"
,
"create_success"
:
"建立成功"
,
"create_time"
:
"建立時間"
,
"create_time"
:
"建立時間"
,
...
@@ -238,7 +238,7 @@
...
@@ -238,7 +238,7 @@
"have_done"
:
"已完成"
,
"have_done"
:
"已完成"
,
"input.Repeat Value"
:
"重複的值"
,
"input.Repeat Value"
:
"重複的值"
,
"is_requesting"
:
"請求中..."
,
"is_requesting"
:
"請求中..."
,
"json
Editor.Parse
error"
:
"可能有 JSON 錯誤,請仔細檢查"
,
"json
_parse_
error"
:
"可能有 JSON 錯誤,請仔細檢查"
,
"json_config"
:
"JSON 設定"
,
"json_config"
:
"JSON 設定"
,
"link.UnValid"
:
"無效的連結"
,
"link.UnValid"
:
"無效的連結"
,
"month"
:
"月"
,
"month"
:
"月"
,
...
@@ -250,13 +250,13 @@
...
@@ -250,13 +250,13 @@
"redo_tip_mac"
:
"重做 ⌘ shift z"
,
"redo_tip_mac"
:
"重做 ⌘ shift z"
,
"request_end"
:
"已載入全部"
,
"request_end"
:
"已載入全部"
,
"request_more"
:
"點選載入更多"
,
"request_more"
:
"點選載入更多"
,
"speech
.error
tip"
:
"語音轉文字失敗"
,
"speech
_error_
tip"
:
"語音轉文字失敗"
,
"speech
.not
support"
:
"您的瀏覽器不支援語音輸入"
,
"speech
_not_
support"
:
"您的瀏覽器不支援語音輸入"
,
"submit_success"
:
"送出成功"
,
"submit_success"
:
"送出成功"
,
"submitted"
:
"已送出"
,
"submitted"
:
"已送出"
,
"support"
:
"支援"
,
"support"
:
"支援"
,
"system
.Help C
hatbot"
:
"機器人助手"
,
"system
_help_c
hatbot"
:
"機器人助手"
,
"
system.Use H
elper"
:
"使用說明"
,
"
use_h
elper"
:
"使用說明"
,
"ui.textarea.Magnifying"
:
"放大"
,
"ui.textarea.Magnifying"
:
"放大"
,
"undo_tip"
:
"復原 ctrl z"
,
"undo_tip"
:
"復原 ctrl z"
,
"undo_tip_mac"
:
"復原 ⌘ z "
,
"undo_tip_mac"
:
"復原 ⌘ z "
,
...
@@ -273,7 +273,6 @@
...
@@ -273,7 +273,6 @@
"contact_way"
:
"通知接收"
,
"contact_way"
:
"通知接收"
,
"contribute_app_template"
:
"貢獻範本"
,
"contribute_app_template"
:
"貢獻範本"
,
"core.Chat"
:
"對話"
,
"core.Chat"
:
"對話"
,
"core.Max Token"
:
"單筆資料上限"
,
"core.ai.Max context"
:
"最大上下文"
,
"core.ai.Max context"
:
"最大上下文"
,
"core.ai.Model"
:
"AI 模型"
,
"core.ai.Model"
:
"AI 模型"
,
"core.ai.Not deploy rerank model"
:
"未部署重新排名模型"
,
"core.ai.Not deploy rerank model"
:
"未部署重新排名模型"
,
...
...
projects/app/src/pages/api/core/dataset/searchTest.ts
View file @
ef537f39
...
@@ -98,7 +98,7 @@ async function handler(req: ApiRequestProps<SearchTestProps>): Promise<SearchTes
...
@@ -98,7 +98,7 @@ async function handler(req: ApiRequestProps<SearchTestProps>): Promise<SearchTes
const
{
totalPoints
:
embeddingTotalPoints
}
=
pushGenerateVectorUsage
({
const
{
totalPoints
:
embeddingTotalPoints
}
=
pushGenerateVectorUsage
({
teamId
,
teamId
,
tmbId
,
tmbId
,
inputTokens
:
reRankInput
Tokens
,
inputTokens
:
embedding
Tokens
,
model
:
dataset
.
vectorModel
,
model
:
dataset
.
vectorModel
,
source
:
apikey
?
UsageSourceEnum
.
api
:
UsageSourceEnum
.
fastgpt
,
source
:
apikey
?
UsageSourceEnum
.
api
:
UsageSourceEnum
.
fastgpt
,
...
...
projects/app/src/pages/dataset/list/index.tsx
View file @
ef537f39
...
@@ -162,16 +162,20 @@ const Dataset = () => {
...
@@ -162,16 +162,20 @@ const Dataset = () => {
onClick
:
()
=>
onSelectDatasetType
(
DatasetTypeEnum
.
dataset
)
onClick
:
()
=>
onSelectDatasetType
(
DatasetTypeEnum
.
dataset
)
},
},
{
{
icon
:
'core/dataset/externalDatasetColor'
,
label
:
t
(
'dataset:api_file'
),
description
:
t
(
'dataset:external_file_dataset_desc'
),
onClick
:
()
=>
onSelectDatasetType
(
DatasetTypeEnum
.
apiDataset
)
},
{
icon
:
'core/dataset/websiteDatasetColor'
,
icon
:
'core/dataset/websiteDatasetColor'
,
label
:
t
(
'dataset:website_dataset'
),
label
:
t
(
'dataset:website_dataset'
),
description
:
t
(
'dataset:website_dataset_desc'
),
description
:
t
(
'dataset:website_dataset_desc'
),
onClick
:
()
=>
onSelectDatasetType
(
DatasetTypeEnum
.
websiteDataset
)
onClick
:
()
=>
onSelectDatasetType
(
DatasetTypeEnum
.
websiteDataset
)
}
]
},
{
children
:
[
{
icon
:
'core/dataset/externalDatasetColor'
,
label
:
t
(
'dataset:api_file'
),
description
:
t
(
'dataset:external_file_dataset_desc'
),
onClick
:
()
=>
onSelectDatasetType
(
DatasetTypeEnum
.
apiDataset
)
},
},
{
{
icon
:
'core/dataset/feishuDatasetColor'
,
icon
:
'core/dataset/feishuDatasetColor'
,
...
...
projects/app/src/web/common/hooks/useSpeech.ts
View file @
ef537f39
...
@@ -120,7 +120,7 @@ export const useSpeech = (props?: OutLinkChatAuthProps & { appId?: string }) =>
...
@@ -120,7 +120,7 @@ export const useSpeech = (props?: OutLinkChatAuthProps & { appId?: string }) =>
if
(
!
navigator
?.
mediaDevices
?.
getUserMedia
)
{
if
(
!
navigator
?.
mediaDevices
?.
getUserMedia
)
{
return
toast
({
return
toast
({
status
:
'warning'
,
status
:
'warning'
,
title
:
t
(
'common:speech
.not
support'
)
title
:
t
(
'common:speech
_not_
support'
)
});
});
}
}
...
@@ -230,7 +230,7 @@ export const useSpeech = (props?: OutLinkChatAuthProps & { appId?: string }) =>
...
@@ -230,7 +230,7 @@ export const useSpeech = (props?: OutLinkChatAuthProps & { appId?: string }) =>
}
catch
(
error
)
{
}
catch
(
error
)
{
toast
({
toast
({
status
:
'warning'
,
status
:
'warning'
,
title
:
getErrText
(
error
,
t
(
'common:speech
.error
tip'
))
title
:
getErrText
(
error
,
t
(
'common:speech
_error_
tip'
))
});
});
}
}
setIsTransCription
(
false
);
setIsTransCription
(
false
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment