(chatId, query, history, docs, datasets, messageOffset)
| 62 | } |
| 63 | |
| 64 | export async function sendMessage(chatId, query, history, docs, datasets, messageOffset) { |
| 65 | const res = await fetch(`${API_BASE}/chats/${chatId}/message`, { |
| 66 | method: 'POST', |
| 67 | headers: getHeaders(), |
| 68 | body: JSON.stringify({ query, history, docs, datasets, messageOffset }), |
| 69 | }); |
| 70 | if (!res.ok) { |
| 71 | const errText = await res.text(); |
| 72 | throw new Error(errText || 'Chat failed'); |
| 73 | } |
| 74 | return res.json(); |
| 75 | } |
| 76 | |
| 77 | /** |
| 78 | * Send a message with streaming via Server-Sent Events. |
nothing calls this directly
no test coverage detected