mirror of
https://github.com/infiniflow/ragflow.git
synced 2025-12-21 13:32:49 +08:00
### What problem does this PR solve? Feat: Add splitter node component #9869 ### Type of change - [x] New Feature (non-breaking change which adds functionality)
This commit is contained in:
@ -54,6 +54,7 @@ import ParserNode from './node/parser-node';
|
||||
import { RelevantNode } from './node/relevant-node';
|
||||
import { RetrievalNode } from './node/retrieval-node';
|
||||
import { RewriteNode } from './node/rewrite-node';
|
||||
import { SplitterNode } from './node/splitter-node';
|
||||
import { SwitchNode } from './node/switch-node';
|
||||
import { TemplateNode } from './node/template-node';
|
||||
import TokenizerNode from './node/tokenizer-node';
|
||||
@ -82,6 +83,7 @@ export const nodeTypes: NodeTypes = {
|
||||
parserNode: ParserNode,
|
||||
chunkerNode: ChunkerNode,
|
||||
tokenizerNode: TokenizerNode,
|
||||
splitterNode: SplitterNode,
|
||||
};
|
||||
|
||||
const edgeTypes = {
|
||||
|
||||
@ -141,6 +141,8 @@ function AccordionOperators({
|
||||
Operator.Parser,
|
||||
Operator.Chunker,
|
||||
Operator.Tokenizer,
|
||||
Operator.Splitter,
|
||||
Operator.HierarchicalMerger,
|
||||
]}
|
||||
isCustomDropdown={isCustomDropdown}
|
||||
mousePosition={mousePosition}
|
||||
|
||||
@ -0,0 +1 @@
|
||||
export { RagNode as HierarchicalMergerNode } from './index';
|
||||
1
web/src/pages/data-flow/canvas/node/splitter-node.tsx
Normal file
1
web/src/pages/data-flow/canvas/node/splitter-node.tsx
Normal file
@ -0,0 +1 @@
|
||||
export { RagNode as SplitterNode } from './index';
|
||||
@ -66,6 +66,8 @@ export enum Operator {
|
||||
Parser = 'Parser',
|
||||
Chunker = 'Chunker',
|
||||
Tokenizer = 'Tokenizer',
|
||||
Splitter = 'Splitter',
|
||||
HierarchicalMerger = 'HierarchicalMerger',
|
||||
}
|
||||
|
||||
export const SwitchLogicOperatorOptions = ['and', 'or'];
|
||||
@ -74,20 +76,6 @@ export const CommonOperatorList = Object.values(Operator).filter(
|
||||
(x) => x !== Operator.Note,
|
||||
);
|
||||
|
||||
export const AgentOperatorList = [
|
||||
Operator.Retrieval,
|
||||
Operator.Categorize,
|
||||
Operator.Message,
|
||||
Operator.RewriteQuestion,
|
||||
Operator.KeywordExtract,
|
||||
Operator.Switch,
|
||||
Operator.Concentrator,
|
||||
Operator.Iteration,
|
||||
Operator.WaitingDialogue,
|
||||
Operator.Note,
|
||||
Operator.Agent,
|
||||
];
|
||||
|
||||
export const SwitchOperatorOptions = [
|
||||
{ value: '=', label: 'equal', icon: 'equal' },
|
||||
{ value: '≠', label: 'notEqual', icon: 'not-equals' },
|
||||
@ -390,6 +378,10 @@ export const initialStringTransformValues = {
|
||||
|
||||
export const initialParserValues = { outputs: {}, parser: [] };
|
||||
|
||||
export const initialSplitterValues = {};
|
||||
|
||||
export const initialHierarchicalMergerValues = {};
|
||||
|
||||
export const CategorizeAnchorPointPositions = [
|
||||
{ top: 1, right: 34 },
|
||||
{ top: 8, right: 18 },
|
||||
@ -473,6 +465,8 @@ export const NodeMap = {
|
||||
[Operator.Parser]: 'parserNode',
|
||||
[Operator.Chunker]: 'chunkerNode',
|
||||
[Operator.Tokenizer]: 'tokenizerNode',
|
||||
[Operator.Splitter]: 'splitterNode',
|
||||
[Operator.HierarchicalMerger]: 'hierarchicalMergerrNode',
|
||||
};
|
||||
|
||||
export enum BeginQueryType {
|
||||
|
||||
@ -18,6 +18,7 @@ import {
|
||||
initialCrawlerValues,
|
||||
initialEmailValues,
|
||||
initialExeSqlValues,
|
||||
initialHierarchicalMergerValues,
|
||||
initialInvokeValues,
|
||||
initialIterationStartValues,
|
||||
initialIterationValues,
|
||||
@ -28,6 +29,7 @@ import {
|
||||
initialRelevantValues,
|
||||
initialRetrievalValues,
|
||||
initialRewriteQuestionValues,
|
||||
initialSplitterValues,
|
||||
initialStringTransformValues,
|
||||
initialSwitchValues,
|
||||
initialTokenizerValues,
|
||||
@ -82,6 +84,8 @@ export const useInitializeOperatorParams = () => {
|
||||
[Operator.Parser]: initialParserValues,
|
||||
[Operator.Chunker]: initialChunkerValues,
|
||||
[Operator.Tokenizer]: initialTokenizerValues,
|
||||
[Operator.Splitter]: initialSplitterValues,
|
||||
[Operator.HierarchicalMerger]: initialHierarchicalMergerValues,
|
||||
};
|
||||
}, [llmId]);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user