MCPcopy
hub / github.com/simstudioai/sim / readResponseTextWithLimit

Function readResponseTextWithLimit

apps/sim/lib/core/utils/stream-limits.ts:286–298  ·  view source on GitHub ↗
(
  response: {
    headers?: { get(name: string): string | null }
    body?: ReadableStream<Uint8Array> | null
    arrayBuffer?: () => Promise<ArrayBuffer>
    text?: () => Promise<string>
  },
  options: ReadResponseWithLimitOptions
)

Source from the content-addressed store, hash-verified

284}
285
286export async function readResponseTextWithLimit(
287 response: {
288 headers?: { get(name: string): string | null }
289 body?: ReadableStream<Uint8Array> | null
290 arrayBuffer?: () => Promise<ArrayBuffer>
291 text?: () => Promise<string>
292 },
293 options: ReadResponseWithLimitOptions
294): Promise<string> {
295 return (
296 await readResponseToBufferWithLimit(response, { ...options, preferTextFallback: true })
297 ).toString('utf-8')
298}
299
300export async function readResponseJsonWithLimit<T = unknown>(
301 response: {

Callers 15

request.tsFile · 0.90
runFalQueueFunction · 0.90
downloadFalMediaFunction · 0.90
bufferFromImageUrlFunction · 0.90
generateWithOpenAIFunction · 0.90
generateWithGeminiFunction · 0.90
generateWithFalAIFunction · 0.90
route.tsFile · 0.90
synthesizeWithAzureFunction · 0.90
resolveAccountFunction · 0.90

Calls 2

toStringMethod · 0.45

Tested by

no test coverage detected