MCPcopy Index your code
hub / github.com/simstudioai/sim / read

Function read

apps/sim/lib/copilot/request/go/stream.ts:244–255  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

242 const rawReader = response.body.getReader()
243 const reader: ReadableStreamDefaultReader<Uint8Array> = {
244 async read() {
245 const result = await rawReader.read()
246 if (!result.done && result.value) {
247 const now = performance.now()
248 const gap = now - counters.lastChunkMs
249 if (gap > counters.longestInboundGapMs) counters.longestInboundGapMs = gap
250 counters.lastChunkMs = now
251 counters.chunks += 1
252 counters.bytes += result.value.byteLength
253 }
254 return result
255 },
256 cancel: (reason) => rawReader.cancel(reason),
257 releaseLock: () => rawReader.releaseLock(),
258 get closed() {

Callers

nothing calls this directly

Calls 1

readMethod · 0.45

Tested by

no test coverage detected