MCPcopy Create free account
hub / github.com/TanStack/ai / toHttpResponse

Function toHttpResponse

packages/ai/src/stream-to-response.ts:240–247  ·  view source on GitHub ↗
(
  stream: AsyncIterable<StreamChunk>,
  init?: ResponseInit & { abortController?: AbortController },
)

Source from the content-addressed store, hash-verified

238 * ```
239 */
240export function toHttpResponse(
241 stream: AsyncIterable<StreamChunk>,
242 init?: ResponseInit & { abortController?: AbortController },
243): Response {
244 return new Response(toHttpStream(stream, init?.abortController), {
245 ...init,
246 })
247}

Callers 6

app.tsFile · 0.90
api.tts.stream.tsFile · 0.90

Calls 1

toHttpStreamFunction · 0.85

Tested by

no test coverage detected