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
9a9f094e
authored
Aug 14, 2025
by
heheer
Committed by
GitHub
Aug 14, 2025
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
prompt optimze loading (#5461)
parent
c5cabd0e
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
19 additions
and
4 deletions
+19
-4
packages/web/i18n/en/app.json
+2
-0
packages/web/i18n/zh-CN/app.json
+2
-0
packages/web/i18n/zh-Hant/app.json
+2
-0
projects/app/src/components/common/PromptEditor/OptimizerPopover/index.tsx
+13
-4
No files found.
packages/web/i18n/en/app.json
View file @
9a9f094e
...
@@ -18,8 +18,10 @@
...
@@ -18,8 +18,10 @@
"Optimizer_EmptyPrompt"
:
"Please enter optimization requirements"
,
"Optimizer_EmptyPrompt"
:
"Please enter optimization requirements"
,
"Optimizer_Generating"
:
"Generating..."
,
"Optimizer_Generating"
:
"Generating..."
,
"Optimizer_Placeholder"
:
"How do you want to write or optimize prompt words?"
,
"Optimizer_Placeholder"
:
"How do you want to write or optimize prompt words?"
,
"Optimizer_Placeholder_loading"
:
"Generating...please wait"
,
"Optimizer_Reoptimize"
:
"Re-optimize"
,
"Optimizer_Reoptimize"
:
"Re-optimize"
,
"Optimizer_Replace"
:
"replace"
,
"Optimizer_Replace"
:
"replace"
,
"Optimizer_Tooltip"
:
"AI Optimization"
,
"Role_setting"
:
"Permission"
,
"Role_setting"
:
"Permission"
,
"Run"
:
"Execute"
,
"Run"
:
"Execute"
,
"Search_dataset"
:
"Search dataset"
,
"Search_dataset"
:
"Search dataset"
,
...
...
packages/web/i18n/zh-CN/app.json
View file @
9a9f094e
...
@@ -18,8 +18,10 @@
...
@@ -18,8 +18,10 @@
"Optimizer_EmptyPrompt"
:
"请输入优化要求"
,
"Optimizer_EmptyPrompt"
:
"请输入优化要求"
,
"Optimizer_Generating"
:
"生成中…"
,
"Optimizer_Generating"
:
"生成中…"
,
"Optimizer_Placeholder"
:
"你希望如何编写或优化提示词?"
,
"Optimizer_Placeholder"
:
"你希望如何编写或优化提示词?"
,
"Optimizer_Placeholder_loading"
:
"正在生成...请稍候"
,
"Optimizer_Reoptimize"
:
"重新优化"
,
"Optimizer_Reoptimize"
:
"重新优化"
,
"Optimizer_Replace"
:
"替换"
,
"Optimizer_Replace"
:
"替换"
,
"Optimizer_Tooltip"
:
"AI 优化"
,
"Role_setting"
:
"权限设置"
,
"Role_setting"
:
"权限设置"
,
"Run"
:
"运行"
,
"Run"
:
"运行"
,
"Search_dataset"
:
"搜索知识库"
,
"Search_dataset"
:
"搜索知识库"
,
...
...
packages/web/i18n/zh-Hant/app.json
View file @
9a9f094e
...
@@ -18,8 +18,10 @@
...
@@ -18,8 +18,10 @@
"Optimizer_EmptyPrompt"
:
"請輸入優化要求"
,
"Optimizer_EmptyPrompt"
:
"請輸入優化要求"
,
"Optimizer_Generating"
:
"生成中…"
,
"Optimizer_Generating"
:
"生成中…"
,
"Optimizer_Placeholder"
:
"你希望如何編寫或優化提示詞?"
,
"Optimizer_Placeholder"
:
"你希望如何編寫或優化提示詞?"
,
"Optimizer_Placeholder_loading"
:
"正在生成...請稍候"
,
"Optimizer_Reoptimize"
:
"重新優化"
,
"Optimizer_Reoptimize"
:
"重新優化"
,
"Optimizer_Replace"
:
"替換"
,
"Optimizer_Replace"
:
"替換"
,
"Optimizer_Tooltip"
:
"AI 優化"
,
"Role_setting"
:
"權限設定"
,
"Role_setting"
:
"權限設定"
,
"Run"
:
"執行"
,
"Run"
:
"執行"
,
"Search_dataset"
:
"搜尋知識庫"
,
"Search_dataset"
:
"搜尋知識庫"
,
...
...
projects/app/src/components/common/PromptEditor/OptimizerPopover/index.tsx
View file @
9a9f094e
...
@@ -12,6 +12,7 @@ import { useLocalStorageState } from 'ahooks';
...
@@ -12,6 +12,7 @@ import { useLocalStorageState } from 'ahooks';
import
AIModelSelector
from
'../../../Select/AIModelSelector'
;
import
AIModelSelector
from
'../../../Select/AIModelSelector'
;
import
{
useSystemStore
}
from
'@/web/common/system/useSystemStore'
;
import
{
useSystemStore
}
from
'@/web/common/system/useSystemStore'
;
import
{
onOptimizePrompt
}
from
'@/web/common/api/fetch'
;
import
{
onOptimizePrompt
}
from
'@/web/common/api/fetch'
;
import
MyTooltip
from
'@fastgpt/web/components/common/MyTooltip'
;
export
type
OptimizerPromptProps
=
{
export
type
OptimizerPromptProps
=
{
onChangeText
:
(
text
:
string
)
=>
void
;
onChangeText
:
(
text
:
string
)
=>
void
;
...
@@ -120,7 +121,9 @@ const OptimizerPopover = ({
...
@@ -120,7 +121,9 @@ const OptimizerPopover = ({
<
MyPopover
<
MyPopover
Trigger=
{
Trigger=
{
<
Flex
{
...
iconButtonStyle
}
>
<
Flex
{
...
iconButtonStyle
}
>
<
MyTooltip
label=
{
t
(
'app:Optimizer_Tooltip'
)
}
>
<
MyIcon
name=
{
'optimizer'
}
w=
{
'18px'
}
/>
<
MyIcon
name=
{
'optimizer'
}
w=
{
'18px'
}
/>
</
MyTooltip
>
</
Flex
>
</
Flex
>
}
}
trigger=
"click"
trigger=
"click"
...
@@ -155,7 +158,7 @@ const OptimizerPopover = ({
...
@@ -155,7 +158,7 @@ const OptimizerPopover = ({
)
}
)
}
{
/* Button */
}
{
/* Button */
}
<
Flex
mb=
{
3
}
alignItems=
{
'center'
}
gap=
{
3
}
>
<
Flex
mb=
{
3
}
alignItems=
{
'center'
}
gap=
{
3
}
>
{
!
loading
&&
(
{
!
loading
?
(
<>
<>
{
!
optimizedResult
&&
!!
defaultPrompt
&&
(
{
!
optimizedResult
&&
!!
defaultPrompt
&&
(
<
Button
<
Button
...
@@ -197,8 +200,6 @@ const OptimizerPopover = ({
...
@@ -197,8 +200,6 @@ const OptimizerPopover = ({
</
Button
>
</
Button
>
</>
</>
)
}
)
}
</>
)
}
<
Box
flex=
{
1
}
/>
<
Box
flex=
{
1
}
/>
{
modelOptions
&&
modelOptions
.
length
>
0
&&
(
{
modelOptions
&&
modelOptions
.
length
>
0
&&
(
...
@@ -214,6 +215,10 @@ const OptimizerPopover = ({
...
@@ -214,6 +215,10 @@ const OptimizerPopover = ({
onChange=
{
setSelectedModel
}
onChange=
{
setSelectedModel
}
/>
/>
)
}
)
}
</>
)
:
(
<
MyIcon
name=
{
'common/ellipsis'
}
w=
{
6
}
ml=
{
3
}
color=
{
'myGray.400'
}
/>
)
}
</
Flex
>
</
Flex
>
{
/* Input */
}
{
/* Input */
}
...
@@ -229,7 +234,11 @@ const OptimizerPopover = ({
...
@@ -229,7 +234,11 @@ const OptimizerPopover = ({
>
>
<
MyIcon
name=
{
'optimizer'
}
alignSelf=
{
'flex-start'
}
mt=
{
0.5
}
w=
{
5
}
/>
<
MyIcon
name=
{
'optimizer'
}
alignSelf=
{
'flex-start'
}
mt=
{
0.5
}
w=
{
5
}
/>
<
Textarea
<
Textarea
placeholder=
{
t
(
'app:Optimizer_Placeholder'
)
}
placeholder=
{
!
loading
?
t
(
'app:Optimizer_Placeholder'
)
:
t
(
'app:Optimizer_Placeholder_loading'
)
}
resize=
{
'none'
}
resize=
{
'none'
}
rows=
{
1
}
rows=
{
1
}
minHeight=
{
'24px'
}
minHeight=
{
'24px'
}
...
...
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