@gensx/vercel-ai
Version:
Vercel AI SDK for GenSX.
45 lines (38 loc) • 1.32 kB
JavaScript
;
/**
* Check out the docs at https://www.gensx.com/docs
* Find us on Github https://github.com/gensx-inc/gensx
* Find us on Discord https://discord.gg/F5BSU8Kc
*/
var z4 = require('zod/v4');
var zodToJsonSchema = require('zod-to-json-schema');
function _interopNamespaceDefault(e) {
var n = Object.create(null);
if (e) {
Object.keys(e).forEach(function (k) {
if (k !== 'default') {
var d = Object.getOwnPropertyDescriptor(e, k);
Object.defineProperty(n, k, d.get ? d : {
enumerable: true,
get: function () { return e[k]; }
});
}
});
}
n.default = e;
return Object.freeze(n);
}
var z4__namespace = /*#__PURE__*/_interopNamespaceDefault(z4);
/**
* This file is a helper to provide basic functionality and properly support both Zod v3 and Zod v4.
* See https://zod.dev/library-authors for a reference.
*/
function toJsonSchema(schema) {
if ("_zod" in schema) {
return z4__namespace.toJSONSchema(schema);
}
// eslint-disable-next-line @typescript-eslint/no-unsafe-argument, @typescript-eslint/no-explicit-any
return zodToJsonSchema.zodToJsonSchema(schema);
}
exports.toJsonSchema = toJsonSchema;
//# sourceMappingURL=zod.cjs.map