UNPKG

@arizeai/phoenix-client

Version:

A client for the Phoenix API

38 lines 1.21 kB
import { jsonLiteralSchema } from "../../jsonLiteralSchema.js"; import z from "zod"; /* * * Vercel AI SDK Message Part Schemas * */ export const vercelAIChatPartTextSchema = z.object({ type: z.literal("text"), text: z.string(), }); export const vercelAIChatPartImageSchema = z.object({ type: z.literal("image"), image: z.string(), // ai supports more, but we will just support base64 for now mimeType: z.string().optional(), }); export const vercelAIChatPartToolCallSchema = z.object({ type: z.literal("tool-call"), toolCallId: z.string(), toolName: z.string(), input: jsonLiteralSchema, // json serializable parameters }); export const vercelAIChatPartToolResultSchema = z.object({ type: z.literal("tool-result"), toolCallId: z.string(), toolName: z.string(), output: z.object({ type: z.literal("text"), // TODO: extend to support other output types value: z.string(), }), }); export const vercelAIChatPartSchema = z.discriminatedUnion("type", [ vercelAIChatPartTextSchema, vercelAIChatPartImageSchema, vercelAIChatPartToolCallSchema, vercelAIChatPartToolResultSchema, ]); //# sourceMappingURL=messagePartSchemas.js.map