mirror of
https://github.com/infiniflow/ragflow.git
synced 2026-01-01 17:45:28 +08:00
Feature:Add a loading status to the agent canvas page. (#11733)
### What problem does this PR solve? Feature:Add a loading status to the agent canvas page. ### Type of change - [x] New Feature (non-breaking change which adds functionality)
This commit is contained in:
@ -1,6 +1,8 @@
|
||||
import { INodeEvent } from '@/hooks/use-send-message';
|
||||
import { IMessage } from '@/interfaces/database/chat';
|
||||
import { RAGFlowNodeType } from '@/interfaces/database/flow';
|
||||
import { HandleType, Position } from '@xyflow/react';
|
||||
import { createContext } from 'react';
|
||||
import { Dispatch, SetStateAction, createContext } from 'react';
|
||||
import { useAddNode } from './hooks/use-add-node';
|
||||
import { useCacheChatLog } from './hooks/use-cache-chat-log';
|
||||
import { useShowFormDrawer, useShowLogSheet } from './hooks/use-show-drawer';
|
||||
@ -13,7 +15,11 @@ type AgentInstanceContextType = Pick<
|
||||
ReturnType<typeof useAddNode>,
|
||||
'addCanvasNode'
|
||||
> &
|
||||
Pick<ReturnType<typeof useShowFormDrawer>, 'showFormDrawer'>;
|
||||
Pick<ReturnType<typeof useShowFormDrawer>, 'showFormDrawer'> & {
|
||||
lastNode: INodeEvent | null;
|
||||
currentSendLoading: boolean;
|
||||
startButNotFinishedNodeIds: string[];
|
||||
};
|
||||
|
||||
export const AgentInstanceContext = createContext<AgentInstanceContextType>(
|
||||
{} as AgentInstanceContextType,
|
||||
@ -22,7 +28,10 @@ export const AgentInstanceContext = createContext<AgentInstanceContextType>(
|
||||
type AgentChatContextType = Pick<
|
||||
ReturnType<typeof useShowLogSheet>,
|
||||
'showLogSheet'
|
||||
> & { setLastSendLoadingFunc: (loading: boolean, messageId: string) => void };
|
||||
> & {
|
||||
setLastSendLoadingFunc: (loading: boolean, messageId: string) => void;
|
||||
setDerivedMessages: Dispatch<SetStateAction<IMessage[] | undefined>>;
|
||||
};
|
||||
|
||||
export const AgentChatContext = createContext<AgentChatContextType>(
|
||||
{} as AgentChatContextType,
|
||||
|
||||
Reference in New Issue
Block a user