UNPKG

@arizeai/phoenix-client

Version:

A client for the Phoenix API

23 lines 742 B
import { anthropicMessagePartSchema } from "./messagePartSchemas.js"; import z from "zod"; import zodToJsonSchema from "zod-to-json-schema"; /** * * Anthropic Message Schemas * */ export const anthropicMessageRoleSchema = z.enum(["user", "assistant"]); /** * TODO: rewrite as discriminated union */ export const anthropicMessageSchema = z .object({ role: anthropicMessageRoleSchema, content: z.union([z.string(), z.array(anthropicMessagePartSchema)]), }) .passthrough(); export const anthropicMessagesSchema = z.array(anthropicMessageSchema); export const anthropicMessagesJSONSchema = zodToJsonSchema(anthropicMessagesSchema, { removeAdditionalStrategy: "passthrough", }); //# sourceMappingURL=messageSchemas.js.map