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

Function recordFromBody

testing/e2e/src/routes/api.otel-media.ts:109–120  ·  view source on GitHub ↗
(body: unknown)

Source from the content-addressed store, hash-verified

107}
108
109function recordFromBody(body: unknown): Record<string, unknown> {
110 if (!isRecord(body)) {
111 throw new Error('Invalid request body')
112 }
113
114 const data = body.forwardedProps ?? body.data ?? body
115 if (!isRecord(data)) {
116 throw new Error('Invalid request body')
117 }
118
119 return data
120}
121
122/**
123 * Drives `generateImage` with `otelMiddleware` against the same aimock mount

Callers 1

api.otel-media.tsFile · 0.85

Calls 1

isRecordFunction · 0.70

Tested by

no test coverage detected