/*
 * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
 * @generated-id: 0154047eeec4
 */
import * as z from "zod/v4";
import { remap as remap$ } from "../../lib/primitives.js";
import { smartUnion } from "../../types/smartUnion.js";
import { DocumentURLChunk$outboundSchema, } from "./documenturlchunk.js";
import { FileChunk$outboundSchema, } from "./filechunk.js";
import { ImageURLChunk$outboundSchema, } from "./imageurlchunk.js";
import { ResponseFormat$outboundSchema, } from "./responseformat.js";
export const TableFormat = {
    Markdown: "markdown",
    Html: "html",
};
export const ConfidenceScoresGranularity = {
    Word: "word",
    Page: "page",
};
/** @internal */
export const DocumentUnion$outboundSchema = smartUnion([
    FileChunk$outboundSchema,
    DocumentURLChunk$outboundSchema,
    ImageURLChunk$outboundSchema,
]);
export function documentUnionToJSON(documentUnion) {
    return JSON.stringify(DocumentUnion$outboundSchema.parse(documentUnion));
}
/** @internal */
export const Pages$outboundSchema = smartUnion([z.string(), z.array(z.int())]);
export function pagesToJSON(pages) {
    return JSON.stringify(Pages$outboundSchema.parse(pages));
}
/** @internal */
export const TableFormat$outboundSchema = z.enum(TableFormat);
/** @internal */
export const ConfidenceScoresGranularity$outboundSchema = z.enum(ConfidenceScoresGranularity);
/** @internal */
export const OCRRequest$outboundSchema = z.object({
    model: z.nullable(z.string()),
    document: smartUnion([
        FileChunk$outboundSchema,
        DocumentURLChunk$outboundSchema,
        ImageURLChunk$outboundSchema,
    ]),
    pages: z.nullable(smartUnion([z.string(), z.array(z.int())])).optional(),
    includeImageBase64: z.nullable(z.boolean()).optional(),
    imageLimit: z.nullable(z.int()).optional(),
    imageMinSize: z.nullable(z.int()).optional(),
    bboxAnnotationFormat: z.nullable(ResponseFormat$outboundSchema).optional(),
    documentAnnotationFormat: z.nullable(ResponseFormat$outboundSchema)
        .optional(),
    documentAnnotationPrompt: z.nullable(z.string()).optional(),
    tableFormat: z.nullable(TableFormat$outboundSchema).optional(),
    extractHeader: z.boolean().optional(),
    extractFooter: z.boolean().optional(),
    confidenceScoresGranularity: z.nullable(ConfidenceScoresGranularity$outboundSchema).optional(),
}).transform((v) => {
    return remap$(v, {
        includeImageBase64: "include_image_base64",
        imageLimit: "image_limit",
        imageMinSize: "image_min_size",
        bboxAnnotationFormat: "bbox_annotation_format",
        documentAnnotationFormat: "document_annotation_format",
        documentAnnotationPrompt: "document_annotation_prompt",
        tableFormat: "table_format",
        extractHeader: "extract_header",
        extractFooter: "extract_footer",
        confidenceScoresGranularity: "confidence_scores_granularity",
    });
});
export function ocrRequestToJSON(ocrRequest) {
    return JSON.stringify(OCRRequest$outboundSchema.parse(ocrRequest));
}
//# sourceMappingURL=ocrrequest.js.map