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

Function executeStream

src/openai-handler.ts:795–802  ·  view source on GitHub ↗
(onTextDelta?: (delta: string) => void)

Source from the content-addressed store, hash-verified

793
794 // 统一缓冲模式:先缓冲全部响应,再检测拒绝和处理
795 const executeStream = async (onTextDelta?: (delta: string) => void) => {
796 fullResponse = '';
797 await sendCursorRequest(activeCursorReq, (event: CursorSSEEvent) => {
798 if (event.type !== 'text-delta' || !event.delta) return;
799 fullResponse += event.delta;
800 onTextDelta?.(event.delta);
801 });
802 };
803
804 try {
805 if (!hasTools && (!body.response_format || body.response_format.type === 'text')) {

Callers 2

handleOpenAIStreamFunction · 0.70
handleResponsesStreamFunction · 0.70

Calls 1

sendCursorRequestFunction · 0.85

Tested by

no test coverage detected