Skip to content

RAGFlow is an agent-native database: a Retrieval-Augmented Generation (RAG) engine that grew into context infrastructure.

fix: transformer toc prompt text incorrect (#12116)

Jimmy Ben Klieveb47f1afa3590
diff --git a/web/src/locales/en.ts b/web/src/locales/en.ts
index 5318a2c5b7..69bf0561fe 100644
--- a/web/src/locales/en.ts
+++ b/web/src/locales/en.ts
@@ -1789,6 +1789,7 @@ This delimiter is used to split the input text into several text pieces echo of
variableSettings: 'Variable settings',
systemPrompt: 'System prompt',
userPrompt: 'User prompt',
+ tocDataSource: 'Data source',
addCategory: 'Add category',
categoryName: 'Category name',
nextStep: 'Next step',
@@ -2024,6 +2025,7 @@ Key Instructions:
metadata: `Extract important structured information from the given content. Output ONLY a valid JSON string with no additional text. If no important structured information is found, output an empty JSON object: {}.
Important structured information may include: names, dates, locations, events, key facts, numerical data, or other extractable entities.`,
+ toc: '',
},
user: {
keywords: `Text Content
@@ -2033,6 +2035,7 @@ Important structured information may include: names, dates, locations, events, k
summary: `Text to Summarize:
[Insert text here]`,
metadata: `Content: [INSERT CONTENT HERE]`,
+ toc: '[Insert text here]',
},
},
cancel: 'Cancel',
diff --git a/web/src/pages/agent/form/extractor-form/index.tsx b/web/src/pages/agent/form/extractor-form/index.tsx
index 78480d6656..33ab5eff2e 100644
--- a/web/src/pages/agent/form/extractor-form/index.tsx
+++ b/web/src/pages/agent/form/extractor-form/index.tsx
@@ -59,6 +59,8 @@ const ExtractorForm = ({ node }: INextOperatorForm) => {
useWatchFormChange(node?.id, form);
+ const isToc = form.getValues('field_name') === 'toc';
+
return (
<Form {...form}>
<FormWrapper>
@@ -76,23 +78,27 @@ const ExtractorForm = ({ node }: INextOperatorForm) => {
></SelectWithSearch>
)}
</RAGFlowFormItem>
- {form.getValues('field_name') !== 'toc' && (
- <>
- <RAGFlowFormItem label={t('flow.systemPrompt')} name="sys_prompt">
- <PromptEditor
- placeholder={t('flow.messagePlaceholder')}
- showToolbar={true}
- baseOptions={promptOptions}
- ></PromptEditor>
- </RAGFlowFormItem>
- <RAGFlowFormItem label={t('flow.userPrompt')} name="prompts">
- <PromptEditor
- showToolbar={true}
- baseOptions={promptOptions}
- ></PromptEditor>
- </RAGFlowFormItem>
- </>
+
+ {!isToc && (
+ <RAGFlowFormItem label={t('flow.systemPrompt')} name="sys_prompt">
+ <PromptEditor
+ placeholder={t('flow.messagePlaceholder')}
+ showToolbar={true}
+ baseOptions={promptOptions}
+ ></PromptEditor>
+ </RAGFlowFormItem>
)}
+
+ <RAGFlowFormItem
+ label={isToc ? t('flow.tocDataSource') : t('flow.userPrompt')}
+ name="prompts"
+ >
+ <PromptEditor
+ showToolbar={true}
+ baseOptions={promptOptions}
+ ></PromptEditor>
+ </RAGFlowFormItem>
+
<Output list={outputList}></Output>
</FormWrapper>
{visible && (