@arizeai/phoenix-client
Version:
A client for the Phoenix API
48 lines • 1.64 kB
JavaScript
"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.jsonSchemaZodSchema = void 0;
const zod_1 = __importDefault(require("zod"));
const jsonSchemaPropertiesSchema = zod_1.default
.object({
type: zod_1.default
.enum([
"string",
"number",
"boolean",
"object",
"array",
"null",
"integer",
])
.describe("The type of the parameter"),
description: zod_1.default
.string()
.optional()
.describe("A description of the parameter"),
enum: zod_1.default.array(zod_1.default.string()).optional().describe("The allowed values"),
})
.passthrough()
.describe("A map of parameter names to their definitions");
exports.jsonSchemaZodSchema = zod_1.default
.object({
type: zod_1.default.literal("object"),
properties: zod_1.default.record(zod_1.default.union([
jsonSchemaPropertiesSchema,
zod_1.default
.object({ anyOf: zod_1.default.array(jsonSchemaPropertiesSchema) })
.describe("A list of possible parameter names to their definitions"),
])),
required: zod_1.default
.array(zod_1.default.string())
.optional()
.describe("The required parameters"),
additionalProperties: zod_1.default
.boolean()
.optional()
.describe("Whether or not additional properties are allowed in the schema"),
})
.passthrough();
//# sourceMappingURL=jsonSchema.js.map