* Processes stream chunks from the API response * @param chunk - SSE response chunk
(chunk: koduSSEResponse)
| 346 | * @param chunk - SSE response chunk |
| 347 | */ |
| 348 | private async *processStreamChunk(chunk: koduSSEResponse): AsyncGenerator<koduSSEResponse> { |
| 349 | switch (chunk.code) { |
| 350 | case 0: |
| 351 | break |
| 352 | case 1: |
| 353 | await this.handleFinalResponse(chunk) |
| 354 | break |
| 355 | } |
| 356 | |
| 357 | yield chunk |
| 358 | } |
| 359 | |
| 360 | /** |
| 361 | * Handles the final response from the API |
no test coverage detected