fix: transformer toc prompt text incorrect (#12116)

### What problem does this PR solve?

Fix incorrect prompt texts in **Agent** canvas > **Transformer** >
**Result destination: Table of contents**

### Type of change

- [x] Bug Fix (non-breaking change which fixes an issue)
This commit is contained in:
Jimmy Ben Klieve
2025-12-23 15:59:09 +08:00
committed by GitHub
parent 2369be7244
commit b47f1afa35
2 changed files with 25 additions and 16 deletions

View File

@ -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 && (