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

Function getRequestRunContext

examples/ts-react-native-chat/src/server/app.ts:382–396  ·  view source on GitHub ↗
(body: unknown)

Source from the content-addressed store, hash-verified

380}
381
382function getRequestRunContext(body: unknown) {
383 if (!body || typeof body !== 'object') return {}
384
385 const threadId =
386 'threadId' in body && typeof body.threadId === 'string'
387 ? body.threadId
388 : undefined
389 const runId =
390 'runId' in body && typeof body.runId === 'string' ? body.runId : undefined
391
392 return {
393 ...(threadId ? { threadId } : {}),
394 ...(runId ? { runId } : {}),
395 }
396}
397
398async function* createErrorStream(
399 error: unknown,

Callers 1

createErrorStreamFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected