diff --git a/web/src/locales/en.ts b/web/src/locales/en.ts
index 434970d2a69..7fe91112e0a 100644
--- a/web/src/locales/en.ts
+++ b/web/src/locales/en.ts
@@ -598,7 +598,7 @@ The above is the content you need to summarize.`,
addItem: 'Add Item',
nameRequiredMsg: 'Name is required',
nameRepeatedMsg: 'The name cannot be repeated',
- keywordExtract: 'KeywordExtract',
+ keywordExtract: 'Keyword',
keywordExtractDescription: `This component is used to extract keywords from user's question. Top N specifies the number of keywords you need to extract.`,
baidu: 'Baidu',
baiduDescription: `This component is used to get search result from www.baidu.com. Typically, it performs as a supplement to knowledgebases. Top N specifies the number of search results you need to adopt.`,
diff --git a/web/src/pages/flow/canvas/node/index.tsx b/web/src/pages/flow/canvas/node/index.tsx
index becbed3c80c..d5b0bab5f26 100644
--- a/web/src/pages/flow/canvas/node/index.tsx
+++ b/web/src/pages/flow/canvas/node/index.tsx
@@ -11,6 +11,8 @@ import NodeDropdown from './dropdown';
import styles from './index.less';
import NodePopover from './popover';
+const ZeroGapOperators = [Operator.RewriteQuestion, Operator.KeywordExtract];
+
export function RagNode({
id,
data,
@@ -47,20 +49,29 @@ export function RagNode({
x === data.label) ? 0 : 6}
>
-
-
- {t(lowerFirst(data.label))}
-
-
+
+
+
+
+
+
+ {t(lowerFirst(data.label))}
+
+
+
+ {' '}
+
+
diff --git a/web/src/pages/flow/canvas/node/relevant-node.tsx b/web/src/pages/flow/canvas/node/relevant-node.tsx
index 50cc47d7d7c..a081e4b621f 100644
--- a/web/src/pages/flow/canvas/node/relevant-node.tsx
+++ b/web/src/pages/flow/canvas/node/relevant-node.tsx
@@ -47,18 +47,24 @@ export function RelevantNode({ id, data, selected }: NodeProps) {
>
-
-
-
- {t(lowerFirst(data.label))}
-
-
+
+
+
+
+
+
+ {t(lowerFirst(data.label))}
+
+
+
+
+
{data.name}
diff --git a/web/src/pages/flow/constant.tsx b/web/src/pages/flow/constant.tsx
index 7deb7fdc702..60754e9786c 100644
--- a/web/src/pages/flow/constant.tsx
+++ b/web/src/pages/flow/constant.tsx
@@ -43,12 +43,10 @@ export const operatorIconMap = {
export const operatorMap = {
[Operator.Retrieval]: {
- description: 'This is where the flow begin',
backgroundColor: '#cad6e0',
color: '#385974',
},
[Operator.Generate]: {
- description: 'Generate description',
backgroundColor: '#ebd6d6',
width: 150,
height: 150,
@@ -57,27 +55,21 @@ export const operatorMap = {
color: '#996464',
},
[Operator.Answer]: {
- description:
- 'This component is used as an interface between bot and human. It receives input of user and display the result of the computation of the bot.',
backgroundColor: '#f4816d',
color: 'white',
},
[Operator.Begin]: {
- description: 'Begin description',
backgroundColor: '#4f51d6',
},
[Operator.Categorize]: {
- description: 'Categorize description',
backgroundColor: '#ffebcd',
color: '#cc8a26',
},
[Operator.Message]: {
- description: 'Message description',
backgroundColor: '#c5ddc7',
color: 'green',
},
[Operator.Relevant]: {
- description: 'BranchesOutlined description',
backgroundColor: '#9fd94d',
color: 'white',
width: 70,
@@ -86,7 +78,6 @@ export const operatorMap = {
iconFontSize: 16,
},
[Operator.RewriteQuestion]: {
- description: 'RewriteQuestion description',
backgroundColor: '#f8c7f8',
color: 'white',
width: 70,
@@ -94,48 +85,52 @@ export const operatorMap = {
fontSize: 12,
iconFontSize: 16,
},
+ [Operator.KeywordExtract]: {
+ width: 70,
+ height: 70,
+ backgroundColor: '#0f0e0f',
+ color: '#e1dcdc',
+ fontSize: 12,
+ iconWidth: 16,
+ // iconFontSize: 16,
+ },
+ [Operator.DuckDuckGo]: {
+ backgroundColor: '#e7e389',
+ color: '#aea00c',
+ },
+ [Operator.Baidu]: {},
};
export const componentMenuList = [
{
name: Operator.Retrieval,
- description: operatorMap[Operator.Retrieval].description,
},
{
name: Operator.Generate,
- description: operatorMap[Operator.Generate].description,
},
{
name: Operator.Answer,
- description: operatorMap[Operator.Answer].description,
},
{
name: Operator.Categorize,
- description: operatorMap[Operator.Categorize].description,
},
{
name: Operator.Message,
- description: operatorMap[Operator.Message].description,
},
{
name: Operator.Relevant,
- description: operatorMap[Operator.Relevant].description,
},
{
name: Operator.RewriteQuestion,
- description: operatorMap[Operator.RewriteQuestion].description,
},
{
name: Operator.KeywordExtract,
- description: operatorMap[Operator.Message].description,
},
{
name: Operator.DuckDuckGo,
- description: operatorMap[Operator.Relevant].description,
},
{
name: Operator.Baidu,
- description: operatorMap[Operator.RewriteQuestion].description,
},
];
@@ -254,9 +249,13 @@ export const RestrictedUpstreamMap = {
Operator.Categorize,
Operator.Relevant,
],
- [Operator.KeywordExtract]: [Operator.Begin],
- [Operator.Baidu]: [Operator.Begin],
- [Operator.DuckDuckGo]: [Operator.Begin],
+ [Operator.KeywordExtract]: [
+ Operator.Begin,
+ Operator.Message,
+ Operator.Relevant,
+ ],
+ [Operator.Baidu]: [Operator.Begin, Operator.Retrieval],
+ [Operator.DuckDuckGo]: [Operator.Begin, Operator.Retrieval],
};
export const NodeMap = {
@@ -268,4 +267,7 @@ export const NodeMap = {
[Operator.Message]: 'ragNode',
[Operator.Relevant]: 'relevantNode',
[Operator.RewriteQuestion]: 'ragNode',
+ [Operator.KeywordExtract]: 'ragNode',
+ [Operator.DuckDuckGo]: 'ragNode',
+ [Operator.Baidu]: 'ragNode',
};
diff --git a/web/src/pages/flow/operator-icon/index.tsx b/web/src/pages/flow/operator-icon/index.tsx
index 1a006251ce0..ff066573b2e 100644
--- a/web/src/pages/flow/operator-icon/index.tsx
+++ b/web/src/pages/flow/operator-icon/index.tsx
@@ -6,11 +6,14 @@ import styles from './index.less';
interface IProps {
name: Operator;
fontSize?: number;
+ width?: number;
}
-const OperatorIcon = ({ name, fontSize }: IProps) => {
+const OperatorIcon = ({ name, fontSize, width }: IProps) => {
const Icon = operatorIconMap[name] || React.Fragment;
- return ;
+ return (
+
+ );
};
export default OperatorIcon;