balibabu
commited on
Commit
·
efda1c9
1
Parent(s):
c5da52f
Fix: Modify the text of the category operator form #4412 (#4433)
Browse files### What problem does this PR solve?
Fix: Modify the text of the category operator form #4412
### Type of change
- [x] Bug Fix (non-breaking change which fixes an issue)
- web/src/locales/en.ts +4 -1
- web/src/locales/zh-traditional.ts +4 -1
- web/src/locales/zh.ts +4 -4
- web/src/pages/flow/constant.tsx +1 -4
- web/src/pages/flow/form/categorize-form/dynamic-categorize.tsx +3 -3
- web/src/pages/flow/form/components/dynamic-input-variable.tsx +2 -2
- web/src/pages/flow/form/rewrite-question-form/index.tsx +1 -8
web/src/locales/en.ts
CHANGED
@@ -729,7 +729,7 @@ This procedure will improve precision of retrieval by adding more information to
|
|
729 |
generateDescription: `A component that prompts the LLM to generate responses. Ensure the prompt is set correctly.`,
|
730 |
categorizeDescription: `A component that uses the LLM to classify user inputs into predefined categories. Ensure you specify the name, description, and examples for each category, along with the corresponding next component.`,
|
731 |
relevantDescription: `A component that uses the LLM to assess whether the upstream output is relevant to the user's latest query. Ensure you specify the next component for each judge result.`,
|
732 |
-
rewriteQuestionDescription: `A component that refines a user query if it fails to retrieve relevant information from the knowledge base. It repeats this process until the predefined looping upper limit is reached
|
733 |
messageDescription:
|
734 |
"A component that sends out a static message. If multiple messages are supplied, it randomly selects one to send. Ensure its downstream is 'Answer', the interface component.",
|
735 |
keywordDescription: `A component that retrieves top N search results from user's input. Ensure the TopN value is set properly before use.`,
|
@@ -1129,6 +1129,9 @@ This delimiter is used to split the input text into several text pieces echo of
|
|
1129 |
variableSettings: 'Variable settings',
|
1130 |
globalVariables: 'Global variables',
|
1131 |
systemPrompt: 'System prompt',
|
|
|
|
|
|
|
1132 |
},
|
1133 |
footer: {
|
1134 |
profile: 'All rights reserved @ React',
|
|
|
729 |
generateDescription: `A component that prompts the LLM to generate responses. Ensure the prompt is set correctly.`,
|
730 |
categorizeDescription: `A component that uses the LLM to classify user inputs into predefined categories. Ensure you specify the name, description, and examples for each category, along with the corresponding next component.`,
|
731 |
relevantDescription: `A component that uses the LLM to assess whether the upstream output is relevant to the user's latest query. Ensure you specify the next component for each judge result.`,
|
732 |
+
rewriteQuestionDescription: `A component that refines a user query if it fails to retrieve relevant information from the knowledge base. It repeats this process until the predefined looping upper limit is reached.`,
|
733 |
messageDescription:
|
734 |
"A component that sends out a static message. If multiple messages are supplied, it randomly selects one to send. Ensure its downstream is 'Answer', the interface component.",
|
735 |
keywordDescription: `A component that retrieves top N search results from user's input. Ensure the TopN value is set properly before use.`,
|
|
|
1129 |
variableSettings: 'Variable settings',
|
1130 |
globalVariables: 'Global variables',
|
1131 |
systemPrompt: 'System prompt',
|
1132 |
+
addCategory: 'Add category',
|
1133 |
+
categoryName: 'Category name',
|
1134 |
+
nextStep: 'Next step',
|
1135 |
},
|
1136 |
footer: {
|
1137 |
profile: 'All rights reserved @ React',
|
web/src/locales/zh-traditional.ts
CHANGED
@@ -699,7 +699,7 @@ export default {
|
|
699 |
generateDescription: `此元件用於呼叫LLM生成文本,請注意提示的設定。`,
|
700 |
categorizeDescription: `此組件用於對文字進行分類。請指定類別的名稱、描述和範例。每個類別都指向不同的下游組件。`,
|
701 |
relevantDescription: `此元件用來判斷upstream的輸出是否與使用者最新的問題相關,『是』代表相關,『否』代表不相關。`,
|
702 |
-
rewriteQuestionDescription:
|
703 |
messageDescription:
|
704 |
'此元件用於向使用者發送靜態訊息。您可以準備幾條訊息,這些訊息將隨機選擇。',
|
705 |
keywordDescription: `該組件用於從用戶的問題中提取關鍵字。 Top N指定需要提取的關鍵字數量。`,
|
@@ -1065,6 +1065,9 @@ export default {
|
|
1065 |
addVariable: '新增變數',
|
1066 |
variableSettings: '變數設定',
|
1067 |
systemPrompt: '系統提示詞',
|
|
|
|
|
|
|
1068 |
},
|
1069 |
footer: {
|
1070 |
profile: '“保留所有權利 @ react”',
|
|
|
699 |
generateDescription: `此元件用於呼叫LLM生成文本,請注意提示的設定。`,
|
700 |
categorizeDescription: `此組件用於對文字進行分類。請指定類別的名稱、描述和範例。每個類別都指向不同的下游組件。`,
|
701 |
relevantDescription: `此元件用來判斷upstream的輸出是否與使用者最新的問題相關,『是』代表相關,『否』代表不相關。`,
|
702 |
+
rewriteQuestionDescription: `此元件用於細化使用者的提問。通常,當使用者的原始提問無法從知識庫中檢索相關資訊時,此元件可協助您將問題變更為更符合知識庫表達方式的適當問題。`,
|
703 |
messageDescription:
|
704 |
'此元件用於向使用者發送靜態訊息。您可以準備幾條訊息,這些訊息將隨機選擇。',
|
705 |
keywordDescription: `該組件用於從用戶的問題中提取關鍵字。 Top N指定需要提取的關鍵字數量。`,
|
|
|
1065 |
addVariable: '新增變數',
|
1066 |
variableSettings: '變數設定',
|
1067 |
systemPrompt: '系統提示詞',
|
1068 |
+
addCategory: '新增分類',
|
1069 |
+
categoryName: '分類名稱',
|
1070 |
+
nextStep: '下一步',
|
1071 |
},
|
1072 |
footer: {
|
1073 |
profile: '“保留所有權利 @ react”',
|
web/src/locales/zh.ts
CHANGED
@@ -719,7 +719,7 @@ export default {
|
|
719 |
generateDescription: `此组件用于调用LLM生成文本,请注意提示的设置。`,
|
720 |
categorizeDescription: `此组件用于对文本进行分类。请指定类别的名称、描述和示例。每个类别都指向不同的下游组件。`,
|
721 |
relevantDescription: `该组件用来判断upstream的输出是否与用户最新的问题相关,‘是’代表相关,‘否’代表不相关。`,
|
722 |
-
rewriteQuestionDescription:
|
723 |
messageDescription:
|
724 |
'此组件用于向用户发送静态信息。您可以准备几条消息,这些消息将被随机选择。',
|
725 |
keywordDescription: `该组件用于从用户的问题中提取关键词。Top N指定需要提取的关键词数量。`,
|
@@ -1106,9 +1106,9 @@ export default {
|
|
1106 |
minus: '减号',
|
1107 |
semicolon: '分号',
|
1108 |
},
|
1109 |
-
|
1110 |
-
|
1111 |
-
|
1112 |
},
|
1113 |
footer: {
|
1114 |
profile: 'All rights reserved @ React',
|
|
|
719 |
generateDescription: `此组件用于调用LLM生成文本,请注意提示的设置。`,
|
720 |
categorizeDescription: `此组件用于对文本进行分类。请指定类别的名称、描述和示例。每个类别都指向不同的下游组件。`,
|
721 |
relevantDescription: `该组件用来判断upstream的输出是否与用户最新的问题相关,‘是’代表相关,‘否’代表不相关。`,
|
722 |
+
rewriteQuestionDescription: `此组件用于细化用户的提问。通常,当用户的原始提问无法从知识库中检索到相关信息时,此组件可帮助您将问题更改为更符合知识库表达方式的适当问题。`,
|
723 |
messageDescription:
|
724 |
'此组件用于向用户发送静态信息。您可以准备几条消息,这些消息将被随机选择。',
|
725 |
keywordDescription: `该组件用于从用户的问题中提取关键词。Top N指定需要提取的关键词数量。`,
|
|
|
1106 |
minus: '减号',
|
1107 |
semicolon: '分号',
|
1108 |
},
|
1109 |
+
addCategory: '新增分类',
|
1110 |
+
categoryName: '分类名称',
|
1111 |
+
nextStep: '下一步',
|
1112 |
},
|
1113 |
footer: {
|
1114 |
profile: 'All rights reserved @ React',
|
web/src/pages/flow/constant.tsx
CHANGED
@@ -298,9 +298,7 @@ export const componentMenuList = [
|
|
298 |
{
|
299 |
name: Operator.Message,
|
300 |
},
|
301 |
-
|
302 |
-
name: Operator.Relevant,
|
303 |
-
},
|
304 |
{
|
305 |
name: Operator.RewriteQuestion,
|
306 |
},
|
@@ -428,7 +426,6 @@ export const initialGenerateValues = {
|
|
428 |
|
429 |
export const initialRewriteQuestionValues = {
|
430 |
...initialLlmBaseValues,
|
431 |
-
loop: 1,
|
432 |
};
|
433 |
|
434 |
export const initialRelevantValues = {
|
|
|
298 |
{
|
299 |
name: Operator.Message,
|
300 |
},
|
301 |
+
|
|
|
|
|
302 |
{
|
303 |
name: Operator.RewriteQuestion,
|
304 |
},
|
|
|
426 |
|
427 |
export const initialRewriteQuestionValues = {
|
428 |
...initialLlmBaseValues,
|
|
|
429 |
};
|
430 |
|
431 |
export const initialRelevantValues = {
|
web/src/pages/flow/form/categorize-form/dynamic-categorize.tsx
CHANGED
@@ -138,7 +138,7 @@ const DynamicCategorize = ({ nodeId }: IProps) => {
|
|
138 |
}
|
139 |
>
|
140 |
<Form.Item
|
141 |
-
label={t('
|
142 |
name={[field.name, 'name']}
|
143 |
validateTrigger={['onChange', 'onBlur']}
|
144 |
rules={[
|
@@ -178,7 +178,7 @@ const DynamicCategorize = ({ nodeId }: IProps) => {
|
|
178 |
>
|
179 |
<Input.TextArea rows={3} />
|
180 |
</Form.Item>
|
181 |
-
<Form.Item label={t('
|
182 |
<Select
|
183 |
allowClear
|
184 |
options={buildCategorizeToOptions(
|
@@ -199,7 +199,7 @@ const DynamicCategorize = ({ nodeId }: IProps) => {
|
|
199 |
className={styles.addButton}
|
200 |
icon={<PlusOutlined />}
|
201 |
>
|
202 |
-
{t('
|
203 |
</Button>
|
204 |
</Flex>
|
205 |
);
|
|
|
138 |
}
|
139 |
>
|
140 |
<Form.Item
|
141 |
+
label={t('categoryName')}
|
142 |
name={[field.name, 'name']}
|
143 |
validateTrigger={['onChange', 'onBlur']}
|
144 |
rules={[
|
|
|
178 |
>
|
179 |
<Input.TextArea rows={3} />
|
180 |
</Form.Item>
|
181 |
+
<Form.Item label={t('nextStep')} name={[field.name, 'to']}>
|
182 |
<Select
|
183 |
allowClear
|
184 |
options={buildCategorizeToOptions(
|
|
|
199 |
className={styles.addButton}
|
200 |
icon={<PlusOutlined />}
|
201 |
>
|
202 |
+
{t('addCategory')}
|
203 |
</Button>
|
204 |
</Flex>
|
205 |
);
|
web/src/pages/flow/form/components/dynamic-input-variable.tsx
CHANGED
@@ -1,10 +1,10 @@
|
|
|
|
1 |
import { MinusCircleOutlined, PlusOutlined } from '@ant-design/icons';
|
2 |
import { Button, Collapse, Flex, Form, Input, Select } from 'antd';
|
3 |
import { PropsWithChildren, useCallback } from 'react';
|
4 |
import { useTranslation } from 'react-i18next';
|
5 |
import { useBuildComponentIdSelectOptions } from '../../hooks/use-get-begin-query';
|
6 |
|
7 |
-
import { RAGFlowNodeType } from '../../interface';
|
8 |
import styles from './index.less';
|
9 |
|
10 |
interface IProps {
|
@@ -29,7 +29,7 @@ const DynamicVariableForm = ({ node }: IProps) => {
|
|
29 |
|
30 |
const options = [
|
31 |
{ value: VariableType.Reference, label: t('flow.reference') },
|
32 |
-
{ value: VariableType.Input, label: t('flow.
|
33 |
];
|
34 |
|
35 |
const handleTypeChange = useCallback(
|
|
|
1 |
+
import { RAGFlowNodeType } from '@/interfaces/database/flow';
|
2 |
import { MinusCircleOutlined, PlusOutlined } from '@ant-design/icons';
|
3 |
import { Button, Collapse, Flex, Form, Input, Select } from 'antd';
|
4 |
import { PropsWithChildren, useCallback } from 'react';
|
5 |
import { useTranslation } from 'react-i18next';
|
6 |
import { useBuildComponentIdSelectOptions } from '../../hooks/use-get-begin-query';
|
7 |
|
|
|
8 |
import styles from './index.less';
|
9 |
|
10 |
interface IProps {
|
|
|
29 |
|
30 |
const options = [
|
31 |
{ value: VariableType.Reference, label: t('flow.reference') },
|
32 |
+
{ value: VariableType.Input, label: t('flow.text') },
|
33 |
];
|
34 |
|
35 |
const handleTypeChange = useCallback(
|
web/src/pages/flow/form/rewrite-question-form/index.tsx
CHANGED
@@ -1,6 +1,6 @@
|
|
1 |
import LLMSelect from '@/components/llm-select';
|
2 |
import { useTranslate } from '@/hooks/common-hooks';
|
3 |
-
import { Form
|
4 |
import { IOperatorForm } from '../../interface';
|
5 |
|
6 |
const RewriteQuestionForm = ({ onValuesChange, form }: IOperatorForm) => {
|
@@ -22,13 +22,6 @@ const RewriteQuestionForm = ({ onValuesChange, form }: IOperatorForm) => {
|
|
22 |
>
|
23 |
<LLMSelect></LLMSelect>
|
24 |
</Form.Item>
|
25 |
-
<Form.Item
|
26 |
-
label={t('loop', { keyPrefix: 'flow' })}
|
27 |
-
name="loop"
|
28 |
-
initialValue={1}
|
29 |
-
>
|
30 |
-
<InputNumber />
|
31 |
-
</Form.Item>
|
32 |
</Form>
|
33 |
);
|
34 |
};
|
|
|
1 |
import LLMSelect from '@/components/llm-select';
|
2 |
import { useTranslate } from '@/hooks/common-hooks';
|
3 |
+
import { Form } from 'antd';
|
4 |
import { IOperatorForm } from '../../interface';
|
5 |
|
6 |
const RewriteQuestionForm = ({ onValuesChange, form }: IOperatorForm) => {
|
|
|
22 |
>
|
23 |
<LLMSelect></LLMSelect>
|
24 |
</Form.Item>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
25 |
</Form>
|
26 |
);
|
27 |
};
|