MCPcopy
hub / github.com/7836246/cursor2api / writeOpenAISSE

Function writeOpenAISSE

src/openai-handler.ts:1283–1288  ·  view source on GitHub ↗
(res: Response, data: OpenAIChatCompletionChunk)

Source from the content-addressed store, hash-verified

1281}
1282
1283function writeOpenAISSE(res: Response, data: OpenAIChatCompletionChunk): void {
1284 res.write(`data: ${JSON.stringify(data)}\n\n`);
1285 if (typeof (res as unknown as { flush: () => void }).flush === 'function') {
1286 (res as unknown as { flush: () => void }).flush();
1287 }
1288}
1289
1290// ==================== /v1/responses 支持 ====================
1291

Callers 5

handleOpenAIMockStreamFunction · 0.85
writeOpenAITextDeltaFunction · 0.85
handleOpenAIStreamFunction · 0.85

Calls 1

writeMethod · 0.45

Tested by

no test coverage detected