feat: restrict classification operators cannot be connected to Answer and other classification #918 (#1294)

### What problem does this PR solve?

feat: restrict classification operators cannot be connected to Answer
and other classification #918

### Type of change

- [x] New Feature (non-breaking change which adds functionality)
This commit is contained in:
balibabu
2024-06-27 14:57:40 +08:00
committed by GitHub
parent 0ce720a247
commit fbb8cbfc67
9 changed files with 193 additions and 42 deletions

View File

@ -97,3 +97,27 @@ export const CategorizeAnchorPointPositions = [
{ top: 91, right: 20 },
{ top: 98, right: 34 },
];
// key is the source of the edge, value is the target of the edge
// no connection lines are allowed between key and value
export const RestrictedUpstreamMap = {
[Operator.Begin]: [
Operator.Begin,
Operator.Answer,
Operator.Categorize,
Operator.Generate,
Operator.Retrieval,
],
[Operator.Categorize]: [Operator.Begin, Operator.Categorize, Operator.Answer],
[Operator.Answer]: [],
[Operator.Retrieval]: [],
[Operator.Generate]: [],
};
export const NodeMap = {
[Operator.Begin]: 'beginNode',
[Operator.Categorize]: 'categorizeNode',
[Operator.Retrieval]: 'ragNode',
[Operator.Generate]: 'ragNode',
[Operator.Answer]: 'ragNode',
};