mirror of
https://github.com/infiniflow/ragflow.git
synced 2025-12-08 20:42:30 +08:00
### What problem does this PR solve? Feat: Delete useless files from the data pipeline #9869 ### Type of change - [x] New Feature (non-breaking change which adds functionality)
40 lines
1.1 KiB
TypeScript
40 lines
1.1 KiB
TypeScript
import { RAGFlowNodeType } from '@/interfaces/database/flow';
|
|
import { HandleType, Position } from '@xyflow/react';
|
|
import { createContext } from 'react';
|
|
import { useAddNode } from './hooks/use-add-node';
|
|
import { useShowFormDrawer } from './hooks/use-show-drawer';
|
|
|
|
export const AgentFormContext = createContext<RAGFlowNodeType | undefined>(
|
|
undefined,
|
|
);
|
|
|
|
type AgentInstanceContextType = Pick<
|
|
ReturnType<typeof useAddNode>,
|
|
'addCanvasNode'
|
|
> &
|
|
Pick<ReturnType<typeof useShowFormDrawer>, 'showFormDrawer'>;
|
|
|
|
export const AgentInstanceContext = createContext<AgentInstanceContextType>(
|
|
{} as AgentInstanceContextType,
|
|
);
|
|
|
|
export type HandleContextType = {
|
|
nodeId?: string;
|
|
id?: string;
|
|
type: HandleType;
|
|
position: Position;
|
|
isFromConnectionDrag: boolean;
|
|
};
|
|
|
|
export const HandleContext = createContext<HandleContextType>(
|
|
{} as HandleContextType,
|
|
);
|
|
|
|
export type LogContextType = {
|
|
messageId: string;
|
|
setMessageId: (messageId: string) => void;
|
|
setUploadedFileData: (data: Record<string, any>) => void;
|
|
};
|
|
|
|
export const LogContext = createContext<LogContextType>({} as LogContextType);
|