MCPcopy Create free account
hub / github.com/CommandCodeAI/BaseAI / validateRequestBody

Function validateRequestBody

packages/baseai/src/dev/routes/v1/pipes/run.ts:54–64  ·  view source on GitHub ↗
(body: unknown)

Source from the content-addressed store, hash-verified

52
53// Helper functions
54const validateRequestBody = (body: unknown): RequestBody => {
55 const result = RequestBodySchema.safeParse(body);
56 if (!result.success) {
57 throw new ApiErrorZod({
58 code: 'BAD_REQUEST',
59 validationResult: result,
60 customMessage: 'Invalid request body'
61 });
62 }
63 return result.data;
64};
65
66const processLlmResponse = (c: any, body: RequestBody, rawLlmResponse: any) => {
67 const isStreaming = body.stream;

Callers 1

handleRunFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected