MCPcopy
hub / github.com/MiniMax-AI/cli / streamSSE

Method streamSSE

src/sdk/client.ts:37–50  ·  view source on GitHub ↗
(res: Response)

Source from the content-addressed store, hash-verified

35 }
36
37 protected async *streamSSE<T>(res: Response): AsyncGenerator<T> {
38 for await (const event of parseSSE(res)) {
39 if (event.data === '[DONE]') break;
40 if (!event.data) continue;
41 try {
42 yield JSON.parse(event.data) as T;
43 } catch (err) {
44 throw new SDKError(
45 `Failed to parse stream chunk: ${err instanceof Error ? err.message : String(err)}`,
46 ExitCode.GENERAL,
47 );
48 }
49 }
50 }
51}

Callers 2

synthesizeStreamMethod · 0.80
chatStreamMethod · 0.80

Calls 1

parseSSEFunction · 0.90

Tested by

no test coverage detected