(message: string, code: number, reason: Buffer)
| 372 | } |
| 373 | |
| 374 | function closeMessage(message: string, code: number, reason: Buffer) { |
| 375 | const details = [`code ${code}`] |
| 376 | if (code === 1009) details.push("message too big") |
| 377 | if (reason.length > 0) details.push(reason.toString()) |
| 378 | return `${message} (${details.join(": ")})` |
| 379 | } |
| 380 | |
| 381 | export * as OpenAIWebSocket from "./ws" |