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

Function writeOpenAIReasoningDelta

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

Source from the content-addressed store, hash-verified

584}
585
586function writeOpenAIReasoningDelta(
587 res: Response,
588 id: string,
589 created: number,
590 model: string,
591 reasoningContent: string,
592): void {
593 if (!reasoningContent) return;
594 writeOpenAISSE(res, {
595 id,
596 object: 'chat.completion.chunk',
597 created,
598 model,
599 choices: [{
600 index: 0,
601 delta: { reasoning_content: reasoningContent } as Record<string, unknown>,
602 finish_reason: null,
603 }],
604 });
605}
606
607async function handleOpenAIIncrementalTextStream(
608 res: Response,

Callers 4

flushVisibleFunction · 0.85
pushToStreamerFunction · 0.85
handleOpenAIStreamFunction · 0.85

Calls 1

writeOpenAISSEFunction · 0.85

Tested by

no test coverage detected