Skip to content

AIChatOptions

Chat connection options

PropertyTypeDescription
onContent?(delta: string, conversationId: string) => voidCallback for content chunks (streaming)
onDone?(usage: undefined | AIUsageStats, conversationId: string) => voidCallback when message is complete
onError?(error: string, code: undefined | string, conversationId: undefined | string) => voidCallback for errors
onEvent?(event: AIChatEvent) => voidCallback for all events
onProgress?(step: string, message: string, conversationId: string) => voidCallback for progress updates
onQueryResult?(query: string, summary: string, rowCount: number, data: Record<string, any>[], conversationId: string) => voidCallback for query results
reconnectAttempts?numberReconnect attempts (0 = no reconnect)
reconnectDelay?numberReconnect delay in ms
token?stringJWT token for authentication
wsUrl?stringWebSocket URL (defaults to ws://host/ai/ws)