🪢 Open source agent evals & observability: Trace, evaluate, and improve LLM applications with one open platform.
TypeScript analyticsautogenevaluationlangchainlarge-language-modelsllama-indexllmllm-evaluationllm-observabilityllmopsmonitoringobservabilityopen-sourceopenaiplaygroundprompt-engineeringprompt-managementself-hostedycombinator
chore: allow any value for input/output in ingestion endpoint (#5040)
Steffen Schmitz5bbfffef505a
diff --git a/packages/shared/src/server/ingestion/types.ts b/packages/shared/src/server/ingestion/types.tsindex ff7ec3a42f..f5e8d2bf3d 100644--- a/packages/shared/src/server/ingestion/types.ts+++ b/packages/shared/src/server/ingestion/types.ts@@ -112,13 +112,16 @@ export const UsageOrCostDetails = z.union([OpenAIUsageSchema, RawUsageOrCostDetails]).nullish();+// Using z.any instead of jsonSchema for input/output as we saw huge CPU overhead for large numeric arrays.+// With this setup parsing should be more lightweight and doesn't block other requests.+// As we allow plain values, arrays, and objects the JSON parse via bodyParser should suffice.export const TraceBody = z.object({id: z.string().nullish(),timestamp: stringDateTime,name: z.string().max(1000).nullish(),externalId: z.string().nullish(),- input: jsonSchema.nullish(),- output: jsonSchema.nullish(),+ input: z.any().nullish(),+ output: z.any().nullish(),sessionId: z.string().nullish(),userId: z.string().nullish(),metadata: jsonSchema.nullish(),@@ -133,8 +136,8 @@ export const OptionalObservationBody = z.object({name: z.string().nullish(),startTime: stringDateTime,metadata: jsonSchema.nullish(),- input: jsonSchema.nullish(),- output: jsonSchema.nullish(),+ input: z.any().nullish(),+ output: z.any().nullish(),level: z.nativeEnum(ObservationLevel).nullish(),statusMessage: z.string().nullish(),parentObservationId: z.string().nullish(),