()
| 133 | |
| 134 | // Session Management |
| 135 | async getSessions(): Promise<SessionResponse> { |
| 136 | try { |
| 137 | const response = await fetch(`${API_BASE_URL}/sessions`); |
| 138 | if (!response.ok) { |
| 139 | throw new Error(`Failed to get sessions: ${response.status}`); |
| 140 | } |
| 141 | return await response.json(); |
| 142 | } catch (error) { |
| 143 | console.error('Get sessions failed:', error); |
| 144 | throw error; |
| 145 | } |
| 146 | } |
| 147 | |
| 148 | async createSession(title: string = 'New Chat', model: string = 'llama3.2:latest'): Promise<ChatSession> { |
| 149 | try { |