import { UseAiChatReturn as UseAiChatReturn$1, UseAiChatOptions } from './use-ai-chat-internal.js'; import '../types/system-message.js'; import '@vn-sdk/runtime-client-gql'; import '@vn-sdk/shared'; import './use-chat.js'; import 'react'; import '../ai-context-2768aadc.js'; import '../types/frontend-action.js'; import './use-tree.js'; import '../types/document-pointer.js'; import '../types/chat-suggestion-configuration.js'; import '../types/ai-agent-action.js'; import '../types/ai-agent-state.js'; import '../index-35503105.js'; /** * `useAiChat` is a lightweight React hook for headless chat interactions. * Perfect for controlling the prebuilt chat components programmatically. * * **Open Source Friendly** - Works without requiring a free public license key. * * * Get started with [useAiChatHeadless_c](https://docs.vn.ai/reference/hooks/useAiChatHeadless_c). * * * ## Use Cases * * - **Programmatic Messaging**: Send messages without displaying chat UI * - **Programmatic control**: Control prebuilt component programmatically * - **Background Operations**: Trigger AI interactions in the background * - **Fire-and-Forget**: Send messages without needing to read responses * * ## Usage * * ```tsx * import { TextMessage, MessageRole } from "@vn-sdk/runtime-client-gql"; * * const { appendMessage } = useAiChat(); * * // Example usage without naming conflicts * const handleSendMessage = async (content: string) => { * await appendMessage( * new TextMessage({ * role: MessageRole.User, * content, * }) * ); * }; * ``` * * ## Return Values * The following properties are returned from the hook: * * * Array of messages in old non-AG-UI format, use for compatibility only * * * * Append message using old format, use `sendMessage` instead * * * * Regenerate the response for a specific message by ID * * * * Stop the current message generation process * * * * Clear all messages and reset chat state completely * * * * Whether the chat is currently generating a response * * * * Manually trigger chat completion for advanced usage * * * * Array of Model Context Protocol server configurations * * * * Update MCP server configurations for enhanced context * */ type UseAiChatReturn = Omit; /** * A lightweight React hook for headless chat interactions. * Perfect for programmatic messaging, background operations, and custom UI implementations. * * **Open Source Friendly** - Works without requiring a `publicApiKey`. */ declare function useAiChat(options?: UseAiChatOptions): UseAiChatReturn; export { UseAiChatReturn, useAiChat };