Fix: Every variable in the chat settings is required. (#17727)

This commit is contained in:
balibabu
2026-08-03 16:41:47 +08:00
committed by GitHub
parent 8494f242d7
commit 10db22c756
4 changed files with 4 additions and 2 deletions

View File

@@ -1114,6 +1114,7 @@ This auto-tagging feature enhances retrieval by adding another layer of domain-s
variableTip: `Used together with RAGFlow's chat assistant management APIs, variables can help develop more flexible system prompt strategies. The defined variables will be used by 'System prompt' as part of the prompts for the LLM. {knowledge} is a reserved special variable representing chunks retrieved from specified dataset(s), and all variables should be enclosed in curly braces {} in the 'System prompt'. See https://ragflow.io/docs/dev/set_chat_variables for details.`,
add: 'Add',
key: 'Key',
variableKeyMessage: 'Please input the variable key',
optional: 'Optional',
operation: 'Operation',
model: 'Model',

View File

@@ -1008,6 +1008,7 @@ NER使用 spaCy NER 和基于规则的关键词提取来抽取实体和关系
“系统提示词”中的所有变量都必须用大括号{}括起来。详见 https://ragflow.io/docs/dev/set_chat_variables。`,
add: '新增',
key: '关键字',
variableKeyMessage: '请输入变量 key',
optional: '可选的',
operation: '操作',
model: '模型',

View File

@@ -33,7 +33,7 @@ export function DynamicVariableForm({
const add = useCallback(() => {
append({
key: undefined,
key: '',
optional: false,
});
}, [append]);

View File

@@ -26,7 +26,7 @@ export function useChatSettingSchema() {
parameters: z
.array(
z.object({
key: z.string(),
key: z.string().min(1, { message: t('variableKeyMessage') }),
optional: z.boolean(),
}),
)