(requestId: string, content: string)
| 45 | } |
| 46 | |
| 47 | private emitChunk(requestId: string, content: string): void { |
| 48 | const state = this.requestStates.get(requestId) |
| 49 | if (!state || state.status !== 'running') { |
| 50 | return |
| 51 | } |
| 52 | |
| 53 | state.fullResponse += content |
| 54 | state.event.sender.send(state.eventChannel, { |
| 55 | requestId, |
| 56 | type: 'chunk', |
| 57 | content |
| 58 | } as AIStreamChunk) |
| 59 | } |
| 60 | |
| 61 | private emitReasoning(requestId: string, reasoning: string): void { |
| 62 | const state = this.requestStates.get(requestId) |