import { Dispatch } from 'react'; import { AgentUIProps, Tcb } from '..'; import { AgentTheme } from '../helper/theme'; import { FileItem } from '../types'; declare const ACTIONS: { readonly UPDATE_BOT: "updateBot"; readonly UPDATE_QUESTIONS: "updateQuestions"; readonly UPDATE_CHAT_STATUS: "updateChatStatus"; readonly UPDATE_CHAT_RECORDS: "updateChatRecords"; readonly UPDATE_ENABLE_THINK: "updateEnableThink"; readonly UPDATE_ENABLE_NETWORK: "updateEnableNetwork"; readonly UPDATE_IS_AT_BOTTOM: "updateIsAtBottom"; readonly UPDATE_IS_SMALL_SCREEN: "updateIsSmallScreen"; readonly UPDATE_IS_SIDEBAR_EXPANDED: "updateIsSidebarExpanded"; readonly UPDATE_CONVERSATION_ID: "updateConversationId"; readonly UPDATE_CONVERSATION_LIST: "updateConversationList"; }; export interface Bot { botId: string; name: string; model: string; modelValue: string; agentSetting: string; introduction: string; welcomeMessage: string; avatar: string; background: string; isNeedRecommend: boolean; knowledgeBase: any[]; databaseModel: any[]; initQuestions: string[]; enable: boolean; type: string; tags: string[]; status: string; template: string; source: string; searchEnable: boolean; searchFileEnable: boolean; multiConversationEnable: boolean; envParams: string; mcpServerList: any[]; } export interface ChatRecord { role: 'user' | 'assistant'; content: string; record_id?: string; db_len?: number; disableBtnGroup?: boolean; search_info?: { search_results: { url: string; title: string; }[]; }; knowledge_base?: string[]; reasoning_content?: string; thinkingTime?: number; toolCallList?: ToolCallItem[]; fileList?: FileItem[]; status?: ChatStatus; thinkStatus?: ThinkStatus; thinkDuration?: number; } export interface ToolCallItem { id: string; content: string; status: ToolCallStatus; type: 'function'; function: { name: string; arguments: unknown; }; result?: { content: unknown; isError: boolean; }; } export declare enum ToolCallStatus { Fail = -1, Processing = 1, Success = 2 } export declare enum ChatStatus { Initial = 0, Pending = 1, Responding = 2, Completed = 3, Stop = 4 } export declare enum ThinkStatus { Initial = 0, Thinking = 1, Completed = 2, Stop = 3 } export interface conversation { conversationId: string; createTime: string; envId: string; id: string; title: string; updateTime: string; userId: string; } interface State { bot: Bot | null; chatRecords: ChatRecord[]; questions: string[]; chatStatus: ChatStatus; enableThink: boolean; enableNetwork: boolean; isAtBottom: boolean; isSmallScreen: boolean; isSidebarExpanded: boolean; conversationId?: string; conversationList: conversation[]; } type Action = { type: typeof ACTIONS.UPDATE_BOT; payload: any; } | { type: typeof ACTIONS.UPDATE_QUESTIONS; payload: any; } | { type: typeof ACTIONS.UPDATE_CHAT_STATUS; payload: ChatStatus; } | { type: typeof ACTIONS.UPDATE_CHAT_RECORDS; payload: ChatRecord[]; } | { type: typeof ACTIONS.UPDATE_ENABLE_THINK; payload: boolean; } | { type: typeof ACTIONS.UPDATE_ENABLE_NETWORK; payload: boolean; } | { type: typeof ACTIONS.UPDATE_IS_AT_BOTTOM; payload: boolean; } | { type: typeof ACTIONS.UPDATE_IS_SMALL_SCREEN; payload: boolean; } | { type: typeof ACTIONS.UPDATE_IS_SIDEBAR_EXPANDED; payload: boolean; } | { type: typeof ACTIONS.UPDATE_CONVERSATION_ID; payload: string; } | { type: typeof ACTIONS.UPDATE_CONVERSATION_LIST; payload: conversation[]; }; declare const agentReducer: (state: State, action: Action) => State; export interface AgentContextType { state: State; dispatch: Dispatch; tcb: Tcb; config: AgentUIProps; theme: AgentTheme; } declare const AgentContext: import('react').Context; declare const initialState: State; export { AgentContext, agentReducer, ACTIONS, initialState };