(chatId: string, data: string)
| 149 | } |
| 150 | |
| 151 | streamStartEvent(chatId: string, data: string) { |
| 152 | const client = this.clients.get(chatId) |
| 153 | // prevent multiple start events being streamed to the client |
| 154 | if (client && !client.started) { |
| 155 | const clientResponse = { |
| 156 | event: 'start', |
| 157 | data: data |
| 158 | } |
| 159 | if (this.safeWrite(chatId, 'message:\ndata:' + JSON.stringify(clientResponse) + '\n\n')) { |
| 160 | client.started = true |
| 161 | } |
| 162 | } |
| 163 | } |
| 164 | |
| 165 | streamTokenEvent(chatId: string, data: string) { |
| 166 | const clientResponse = { |