import type { ZodType } from "zod"; import type { JsonObject, JsonValue } from "../json.js"; /** A JSON Schema document — plain JSON, read one checked field at a time. */ type JsonSchema = JsonObject; /** * Convert a Zod schema to a JSON Schema object suitable for OpenAI's * function-tool `parameters` field. Strips `$schema` (the OpenAI API ignores * dialect declarations and including it just bloats every tool definition). * * Requires Zod 4 — Zod 3 does not expose `toJSONSchema`. The `files-sdk/openai` * subpath inherits this requirement. */ export declare const toOpenAIJsonSchema: (schema: ZodType) => JsonSchema; /** * Like {@link toOpenAIJsonSchema}, but shaped for OpenAI's strict mode * (`strict: true` on a function tool / Structured Outputs). Strict mode * rejects the plain conversion with a 400 because it requires every property * to be listed in `required` and `additionalProperties: false` on every * object. This variant: * * - lists every property in `required`, wrapping the optional ones as * `anyOf: [, { type: "null" }]` so the model passes `null` instead * of omitting them; * - sets `additionalProperties: false` on every object; * - drops free-form map properties (`z.record(...)`, e.g. `uploadFile`'s * `metadata`), which strict mode cannot represent. * * Pair with {@link stripNullArgs} before validating the model's arguments so * a `null` for an optional field reads as "absent". */ export declare const toOpenAIStrictJsonSchema: (schema: ZodType) => JsonSchema; /** * Map top-level `null` argument values to "absent" so arguments produced * under a strict schema (where optional fields are nullable, never omitted) * validate against the underlying Zod schema's `.optional()` fields. */ export declare const stripNullArgs: (args: JsonValue) => JsonValue; export {}; //# sourceMappingURL=json-schema.d.ts.map