mirror of
https://github.com/infiniflow/ragflow.git
synced 2025-12-08 20:42:30 +08:00
### What problem does this PR solve? feat: add DynamicCategorize #918 ### Type of change - [x] New Feature (non-breaking change which adds functionality)
This commit is contained in:
13
web/src/pages/flow/categorize-form/hooks.ts
Normal file
13
web/src/pages/flow/categorize-form/hooks.ts
Normal file
@ -0,0 +1,13 @@
|
||||
import { Operator } from '../constant';
|
||||
import useGraphStore from '../store';
|
||||
|
||||
// exclude some nodes downstream of the classification node
|
||||
const excludedNodes = [Operator.Categorize, Operator.Answer, Operator.Begin];
|
||||
|
||||
export const useBuildCategorizeToOptions = () => {
|
||||
const nodes = useGraphStore((state) => state.nodes);
|
||||
|
||||
return nodes
|
||||
.filter((x) => excludedNodes.every((y) => y !== x.data.label))
|
||||
.map((x) => ({ label: x.id, value: x.id }));
|
||||
};
|
||||
Reference in New Issue
Block a user