UNPKG

@promptbook/core

Version:

Promptbook: Create persistent AI agents that turn your company's scattered knowledge into action

36 lines (35 loc) 1.31 kB
import type { ToolCall } from '../../../types/ToolCall'; import type { ChatMessage } from '../types/ChatMessage'; import type { ParsedCitation } from '../utils/parseCitationsFromContent'; /** * Inputs required to keep Chat tool-call and citation modals in sync. * * @private function of `useChatToolCallState` */ type UseChatToolCallStateProps = { messages: ReadonlyArray<ChatMessage>; }; /** * State and callbacks exposed back to `<Chat/>`. * * @private function of `useChatToolCallState` */ type UseChatToolCallStateResult = { readonly citationModalOpen: boolean; readonly closeCitationModal: () => void; readonly closeToolCallModal: () => void; readonly openCitation: (citation: ParsedCitation) => void; readonly openToolCall: (toolCall: ToolCall) => void; readonly selectedCitation: ParsedCitation | null; readonly selectedMessageAvailableTools: ChatMessage['availableTools']; readonly selectedToolCall: ToolCall | null; readonly selectedToolCallIdentity: string | null; readonly toolCallModalOpen: boolean; }; /** * Keeps Chat modal state focused on one selected tool call or citation. * * @private function of `<Chat/>` */ export declare function useChatToolCallState({ messages }: UseChatToolCallStateProps): UseChatToolCallStateResult; export {};