Skip to content

🪢 Open source agent evals & observability: Trace, evaluate, and improve LLM applications with one open platform.

fix(ui): parse chatml messages where content is an array (#2100)

Marc Klingen595f9f1e5d2c
diff --git a/web/src/components/trace/IOPreview.tsx b/web/src/components/trace/IOPreview.tsx
index 59ec51ce15..90e2d25a23 100644
--- a/web/src/components/trace/IOPreview.tsx
+++ b/web/src/components/trace/IOPreview.tsx
@@ -128,12 +128,11 @@ const ChatMlMessageSchema = z
.optional(),
name: z.string().optional(),
content: z
- .union([z.record(z.any()), z.record(z.any()).array(), z.string()])
+ .union([z.record(z.any()), z.string(), z.array(z.any())])
.nullish(),
additional_kwargs: z.record(z.any()).optional(),
})
.passthrough()
-
.refine((value) => value.content !== null || value.role !== undefined)
.transform(({ additional_kwargs, ...other }) => ({
...other,