mirror of
https://github.com/infiniflow/ragflow.git
synced 2025-12-08 20:42:30 +08:00
### What problem does this PR solve? Fix: Optimize the MultiSelect component and system prompt templates #3221 - Modify the conditional statements in the MultiSelect component, using the ?. operator to improve code readability - Optimize the formatting of the system prompt template to make it more standardized and easier to read - Update the Chinese translation, changing "ExeSQL" to "Execute SQL" ### Type of change - [x] Bug Fix (non-breaking change which fixes an issue) --------- Co-authored-by: Kevin Hu <kevinhu.sh@gmail.com>
This commit is contained in:
@ -209,13 +209,13 @@ export const MultiSelect = React.forwardRef<
|
|||||||
const [isAnimating, setIsAnimating] = React.useState(false);
|
const [isAnimating, setIsAnimating] = React.useState(false);
|
||||||
|
|
||||||
React.useEffect(() => {
|
React.useEffect(() => {
|
||||||
if (!selectedValues && props.value) {
|
if (!selectedValues?.length && props.value) {
|
||||||
setSelectedValues(props.value as string[]);
|
setSelectedValues(props.value as string[]);
|
||||||
}
|
}
|
||||||
}, [props.value, selectedValues]);
|
}, [props.value, selectedValues]);
|
||||||
|
|
||||||
React.useEffect(() => {
|
React.useEffect(() => {
|
||||||
if (!selectedValues && !props.value && defaultValue) {
|
if (!selectedValues?.length && !props.value && defaultValue) {
|
||||||
setSelectedValues(defaultValue);
|
setSelectedValues(defaultValue);
|
||||||
}
|
}
|
||||||
}, [defaultValue, props.value, selectedValues]);
|
}, [defaultValue, props.value, selectedValues]);
|
||||||
|
|||||||
@ -916,7 +916,8 @@ This auto-tagging feature enhances retrieval by adding another layer of domain-s
|
|||||||
maxRetries: 'Max retries',
|
maxRetries: 'Max retries',
|
||||||
advancedSettings: 'Advanced Settings',
|
advancedSettings: 'Advanced Settings',
|
||||||
addTools: 'Add Tools',
|
addTools: 'Add Tools',
|
||||||
sysPromptDefultValue: `<role>
|
sysPromptDefultValue: `
|
||||||
|
<role>
|
||||||
You are {{agent_name}}, an AI assistant specialized in {{domain_or_task}}.
|
You are {{agent_name}}, an AI assistant specialized in {{domain_or_task}}.
|
||||||
</role>
|
</role>
|
||||||
<instructions>
|
<instructions>
|
||||||
|
|||||||
@ -872,8 +872,9 @@ General:实体和关系提取提示来自 GitHub - microsoft/graphrag:基于
|
|||||||
maxRetries: '最大重试次数',
|
maxRetries: '最大重试次数',
|
||||||
advancedSettings: '高级设置',
|
advancedSettings: '高级设置',
|
||||||
addTools: '添加工具',
|
addTools: '添加工具',
|
||||||
sysPromptDefultValue: `<role>
|
sysPromptDefultValue: `
|
||||||
您是{{agent_name}},一位专注于{{领域_or_任务}}的AI助手。
|
<role>
|
||||||
|
你是{{agent_name}},一位专注于{{领域_or_任务}}的AI助手。
|
||||||
</role>
|
</role>
|
||||||
<instructions>
|
<instructions>
|
||||||
1. 理解用户请求。
|
1. 理解用户请求。
|
||||||
@ -1129,7 +1130,7 @@ General:实体和关系提取提示来自 GitHub - microsoft/graphrag:基于
|
|||||||
'30d': '30天',
|
'30d': '30天',
|
||||||
},
|
},
|
||||||
publish: 'API',
|
publish: 'API',
|
||||||
exeSQL: 'ExeSQL',
|
exeSQL: '执行 SQL',
|
||||||
exeSQLDescription:
|
exeSQLDescription:
|
||||||
'该组件通过SQL语句从相应的关系数据库中查询结果。支持MySQL,PostgreSQL,MariaDB。',
|
'该组件通过SQL语句从相应的关系数据库中查询结果。支持MySQL,PostgreSQL,MariaDB。',
|
||||||
dbType: '数据库类型',
|
dbType: '数据库类型',
|
||||||
|
|||||||
Reference in New Issue
Block a user