()
| 26 | } |
| 27 | |
| 28 | async stopStreaming(): Promise<void> { |
| 29 | try { |
| 30 | this.isAborted = true |
| 31 | await window.api.ai.stopStreaming(this.requestId) |
| 32 | } catch (error) { |
| 33 | console.error('Failed to stop streaming:', error) |
| 34 | } |
| 35 | } |
| 36 | |
| 37 | async sendMessage(messages: ChatMessage[], callbacks: StreamingResponse): Promise<void> { |
| 38 | if (this.isAborted) { |