UNPKG

@arizeai/phoenix-client

Version:

A client for the Phoenix API

42 lines 1.79 kB
"use strict"; var __importDefault = (this && this.__importDefault) || function (mod) { return (mod && mod.__esModule) ? mod : { "default": mod }; }; Object.defineProperty(exports, "__esModule", { value: true }); exports.anthropicMessagePartSchema = exports.anthropicToolResultBlockSchema = exports.anthropicToolUseBlockSchema = exports.anthropicImageBlockSchema = exports.anthropicTextBlockSchema = void 0; const toolCallSchemas_1 = require("./toolCallSchemas"); const zod_1 = __importDefault(require("zod")); /* * * Anthropic Message Part Schemas * */ exports.anthropicTextBlockSchema = zod_1.default.object({ type: zod_1.default.literal("text"), text: zod_1.default.string(), }); exports.anthropicImageBlockSchema = zod_1.default.object({ type: zod_1.default.literal("image"), source: zod_1.default.object({ data: zod_1.default.string(), media_type: zod_1.default.enum(["image/jpeg", "image/png", "image/gif", "image/webp"]), type: zod_1.default.literal("base64"), }), }); exports.anthropicToolUseBlockSchema = toolCallSchemas_1.anthropicToolCallSchema; exports.anthropicToolResultBlockSchema = zod_1.default.object({ type: zod_1.default.literal("tool_result"), tool_use_id: zod_1.default.string(), content: zod_1.default.union([ zod_1.default.string(), zod_1.default.union([exports.anthropicTextBlockSchema, exports.anthropicImageBlockSchema]).array(), ]), is_error: zod_1.default.boolean().optional(), }); exports.anthropicMessagePartSchema = zod_1.default.discriminatedUnion("type", [ exports.anthropicTextBlockSchema, exports.anthropicImageBlockSchema, exports.anthropicToolUseBlockSchema, exports.anthropicToolResultBlockSchema, ]); //# sourceMappingURL=messagePartSchemas.js.map