(indexId: string)
| 533 | } |
| 534 | |
| 535 | async deleteIndex(indexId: string): Promise<{ message: string }> { |
| 536 | const resp = await fetch(`${API_BASE_URL}/indexes/${indexId}`, { |
| 537 | method: 'DELETE', |
| 538 | }); |
| 539 | if (!resp.ok) { |
| 540 | const data = await resp.json().catch(() => ({ error: 'Unknown error'})); |
| 541 | throw new Error(data.error || `Failed to delete index: ${resp.status}`); |
| 542 | } |
| 543 | return resp.json(); |
| 544 | } |
| 545 | |
| 546 | // -------------------- Streaming (SSE-over-fetch) -------------------- |
| 547 | async streamSessionMessage( |