(id)
| 56 | } |
| 57 | |
| 58 | export async function getChat(id) { |
| 59 | const res = await fetch(`${API_BASE}/chats/${id}`, { headers: getHeaders() }); |
| 60 | if (!res.ok) throw new Error('Failed to fetch chat'); |
| 61 | return res.json(); |
| 62 | } |
| 63 | |
| 64 | export async function sendMessage(chatId, query, history, docs, datasets, messageOffset) { |
| 65 | const res = await fetch(`${API_BASE}/chats/${chatId}/message`, { |