feat: add RelevantForm #918 (#1313)

### What problem does this PR solve?

feat: add RelevantForm #918

### Type of change


- [x] New Feature (non-breaking change which adds functionality)
This commit is contained in:
balibabu
2024-06-28 17:22:10 +08:00
committed by GitHub
parent cd3c739982
commit f26d01dfa3
7 changed files with 94 additions and 0 deletions

View File

@ -1,7 +1,9 @@
import {
BranchesOutlined,
DatabaseOutlined,
MergeCellsOutlined,
MessageOutlined,
QuestionOutlined,
RocketOutlined,
SendOutlined,
SlidersOutlined,
@ -14,6 +16,8 @@ export enum Operator {
Answer = 'Answer',
Categorize = 'Categorize',
Message = 'Message',
Relevant = 'Relevant',
RewriteQuestion = 'RewriteQuestion',
}
export const operatorIconMap = {
@ -23,6 +27,8 @@ export const operatorIconMap = {
[Operator.Begin]: SlidersOutlined,
[Operator.Categorize]: DatabaseOutlined,
[Operator.Message]: MessageOutlined,
[Operator.Relevant]: BranchesOutlined,
[Operator.RewriteQuestion]: QuestionOutlined,
};
export const operatorMap = {
@ -34,6 +40,8 @@ export const operatorMap = {
[Operator.Begin]: { description: 'Begin description' },
[Operator.Categorize]: { description: 'Categorize description' },
[Operator.Message]: { description: 'Message description' },
[Operator.Relevant]: { description: 'BranchesOutlined description' },
[Operator.RewriteQuestion]: { description: 'RewriteQuestion description' },
};
export const componentMenuList = [
@ -57,6 +65,14 @@ export const componentMenuList = [
name: Operator.Message,
description: operatorMap[Operator.Message].description,
},
{
name: Operator.Relevant,
description: operatorMap[Operator.Relevant].description,
},
{
name: Operator.RewriteQuestion,
description: operatorMap[Operator.RewriteQuestion].description,
},
];
export const initialRetrievalValues = {
@ -115,6 +131,8 @@ export const RestrictedUpstreamMap = {
[Operator.Retrieval]: [],
[Operator.Generate]: [],
[Operator.Message]: [],
[Operator.Relevant]: [],
[Operator.RewriteQuestion]: [],
};
export const NodeMap = {
@ -124,4 +142,6 @@ export const NodeMap = {
[Operator.Generate]: 'ragNode',
[Operator.Answer]: 'ragNode',
[Operator.Message]: 'ragNode',
[Operator.Relevant]: 'ragNode',
[Operator.RewriteQuestion]: 'ragNode',
};