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

Function writeOpenAITextDelta

src/openai-handler.ts:552–571  ·  view source on GitHub ↗
(
    res: Response,
    id: string,
    created: number,
    model: string,
    text: string,
)

Source from the content-addressed store, hash-verified

550}
551
552function writeOpenAITextDelta(
553 res: Response,
554 id: string,
555 created: number,
556 model: string,
557 text: string,
558): void {
559 if (!text) return;
560 writeOpenAISSE(res, {
561 id,
562 object: 'chat.completion.chunk',
563 created,
564 model,
565 choices: [{
566 index: 0,
567 delta: { content: text },
568 finish_reason: null,
569 }],
570 });
571}
572
573function buildOpenAIUsage(
574 anthropicReq: AnthropicRequest,

Callers 4

flushVisibleFunction · 0.85
pushToStreamerFunction · 0.85
handleOpenAIStreamFunction · 0.85

Calls 1

writeOpenAISSEFunction · 0.85

Tested by

no test coverage detected