import { api } from './http-client' interface ChatMessage { role: 'user' | 'assistant' | 'system' content: string } interface ChatResponse { content: string conversationId?: string usage?: { model?: string; inputTokens?: number; outputTokens?: number } } export async function sendMessage( messages: ChatMessage[], conversationId?: string, signal?: AbortSignal, ): Promise { const body: Record = { messages } if (conversationId) body.conversationId = conversationId return api.post('/admin-api/ai/chat', body, signal ? { signal } : undefined) }