You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

context.ts 1002B

123456789101112131415161718192021222324252627282930313233343536
  1. import { RAGFlowNodeType } from '@/interfaces/database/flow';
  2. import { createContext } from 'react';
  3. import { useAddNode } from './hooks/use-add-node';
  4. import { useCacheChatLog } from './hooks/use-cache-chat-log';
  5. import { useShowLogSheet } from './hooks/use-show-drawer';
  6. export const AgentFormContext = createContext<RAGFlowNodeType | undefined>(
  7. undefined,
  8. );
  9. type AgentInstanceContextType = Pick<
  10. ReturnType<typeof useAddNode>,
  11. 'addCanvasNode'
  12. >;
  13. export const AgentInstanceContext = createContext<AgentInstanceContextType>(
  14. {} as AgentInstanceContextType,
  15. );
  16. type AgentChatContextType = Pick<
  17. ReturnType<typeof useShowLogSheet>,
  18. 'showLogSheet'
  19. >;
  20. export const AgentChatContext = createContext<AgentChatContextType>(
  21. {} as AgentChatContextType,
  22. );
  23. type AgentChatLogContextType = Pick<
  24. ReturnType<typeof useCacheChatLog>,
  25. 'addEventList' | 'setCurrentMessageId'
  26. >;
  27. export const AgentChatLogContext = createContext<AgentChatLogContextType>(
  28. {} as AgentChatLogContextType,
  29. );