/** * This file is part of the NocoBase (R) project. * Copyright (c) 2020-2024 NocoBase Co., Ltd. * Authors: NocoBase Team. * * This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License. * For more information, please refer to: https://www.nocobase.com/agreement. */ import React, { useContext } from 'react'; import { withDynamicSchemaProps } from '@nocobase/client'; import { createContext } from 'react'; import { AttachmentProps } from './types'; export type AIEmployeeChatContext = { attachments?: Record; actions?: Record< string, { title: string; description?: string; icon?: React.ReactNode; action: (aiMessage: string) => void; } >; variableScopes?: any; }; export const AIEmployeeChatContext = createContext({} as AIEmployeeChatContext); export const AIEmployeeChatProvider: React.FC = withDynamicSchemaProps((props) => { return {props.children}; }); export const useAIEmployeeChatContext = () => { return useContext(AIEmployeeChatContext); };