(sessionId: string)
| 238 | } |
| 239 | |
| 240 | async deleteSession(sessionId: string): Promise<{ message: string; deleted_session_id: string }> { |
| 241 | try { |
| 242 | const response = await fetch(`${API_BASE_URL}/sessions/${sessionId}`, { |
| 243 | method: 'DELETE', |
| 244 | }); |
| 245 | |
| 246 | if (!response.ok) { |
| 247 | const errorData = await response.json().catch(() => ({ error: 'Unknown error' })); |
| 248 | throw new Error(`Delete session error: ${errorData.error || response.statusText}`); |
| 249 | } |
| 250 | |
| 251 | return await response.json(); |
| 252 | } catch (error) { |
| 253 | console.error('Delete session failed:', error); |
| 254 | throw error; |
| 255 | } |
| 256 | } |
| 257 | |
| 258 | async renameSession(sessionId: string, newTitle: string): Promise<{ message: string; session: ChatSession }> { |
| 259 | try { |
no outgoing calls
no test coverage detected