"use strict";
/*
 * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
 */
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
    if (k2 === undefined) k2 = k;
    var desc = Object.getOwnPropertyDescriptor(m, k);
    if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
      desc = { enumerable: true, get: function() { return m[k]; } };
    }
    Object.defineProperty(o, k2, desc);
}) : (function(o, m, k, k2) {
    if (k2 === undefined) k2 = k;
    o[k2] = m[k];
}));
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
    Object.defineProperty(o, "default", { enumerable: true, value: v });
}) : function(o, v) {
    o["default"] = v;
});
var __importStar = (this && this.__importStar) || (function () {
    var ownKeys = function(o) {
        ownKeys = Object.getOwnPropertyNames || function (o) {
            var ar = [];
            for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
            return ar;
        };
        return ownKeys(o);
    };
    return function (mod) {
        if (mod && mod.__esModule) return mod;
        var result = {};
        if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
        __setModuleDefault(result, mod);
        return result;
    };
})();
Object.defineProperty(exports, "__esModule", { value: true });
exports.PartitionParameters$outboundSchema = exports.PartitionParameters$inboundSchema = exports.VLMModelProvider$outboundSchema = exports.VLMModelProvider$inboundSchema = exports.Strategy$outboundSchema = exports.Strategy$inboundSchema = exports.OutputFormat$outboundSchema = exports.OutputFormat$inboundSchema = exports.Files$outboundSchema = exports.Files$inboundSchema = exports.VLMModelProvider = exports.Strategy = exports.OutputFormat = void 0;
exports.filesToJSON = filesToJSON;
exports.filesFromJSON = filesFromJSON;
exports.partitionParametersToJSON = partitionParametersToJSON;
exports.partitionParametersFromJSON = partitionParametersFromJSON;
const z = __importStar(require("zod/v3"));
const primitives_js_1 = require("../../../lib/primitives.js");
const schemas_js_1 = require("../../../lib/schemas.js");
const blobs_js_1 = require("../../types/blobs.js");
const openEnums = __importStar(require("../../types/enums.js"));
/**
 * The format of the response. Supported formats are application/json and text/csv. Default: application/json.
 */
var OutputFormat;
(function (OutputFormat) {
    OutputFormat["ApplicationJson"] = "application/json";
    OutputFormat["TextCsv"] = "text/csv";
})(OutputFormat || (exports.OutputFormat = OutputFormat = {}));
/**
 * The strategy to use for partitioning PDF/image. Options are fast, hi_res, auto. Default: hi_res
 */
var Strategy;
(function (Strategy) {
    Strategy["Fast"] = "fast";
    Strategy["HiRes"] = "hi_res";
    Strategy["Auto"] = "auto";
    Strategy["OcrOnly"] = "ocr_only";
    Strategy["OdOnly"] = "od_only";
    Strategy["Vlm"] = "vlm";
})(Strategy || (exports.Strategy = Strategy = {}));
/**
 * The VLM Model provider to use.
 */
var VLMModelProvider;
(function (VLMModelProvider) {
    VLMModelProvider["Openai"] = "openai";
    VLMModelProvider["Anthropic"] = "anthropic";
    VLMModelProvider["Bedrock"] = "bedrock";
    VLMModelProvider["AnthropicBedrock"] = "anthropic_bedrock";
    VLMModelProvider["Vertexai"] = "vertexai";
    VLMModelProvider["Google"] = "google";
    VLMModelProvider["AzureOpenai"] = "azure_openai";
})(VLMModelProvider || (exports.VLMModelProvider = VLMModelProvider = {}));
/** @internal */
exports.Files$inboundSchema = z
    .object({
    content: z.union([
        z.instanceof((ReadableStream)),
        z.instanceof(Blob),
        z.instanceof(ArrayBuffer),
        z.instanceof(Uint8Array),
    ]),
    fileName: z.string(),
});
/** @internal */
exports.Files$outboundSchema = z.object({
    content: z.union([
        z.instanceof((ReadableStream)),
        z.instanceof(Blob),
        z.instanceof(ArrayBuffer),
        z.instanceof(Uint8Array),
    ]),
    fileName: z.string(),
});
function filesToJSON(files) {
    return JSON.stringify(exports.Files$outboundSchema.parse(files));
}
function filesFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.Files$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'Files' from JSON`);
}
/** @internal */
exports.OutputFormat$inboundSchema = openEnums.inboundSchema(OutputFormat);
/** @internal */
exports.OutputFormat$outboundSchema = openEnums.outboundSchema(OutputFormat);
/** @internal */
exports.Strategy$inboundSchema = openEnums.inboundSchema(Strategy);
/** @internal */
exports.Strategy$outboundSchema = openEnums.outboundSchema(Strategy);
/** @internal */
exports.VLMModelProvider$inboundSchema = openEnums.inboundSchema(VLMModelProvider);
/** @internal */
exports.VLMModelProvider$outboundSchema = openEnums.outboundSchema(VLMModelProvider);
/** @internal */
exports.PartitionParameters$inboundSchema = z.object({
    chunking_strategy: z.nullable(z.string()).optional(),
    combine_under_n_chars: z.nullable(z.number().int()).optional(),
    content_type: z.nullable(z.string()).optional(),
    coordinates: z.boolean().default(false),
    do_not_break_similarity_on_footer_header: z.boolean().default(false),
    encoding: z.nullable(z.string()).optional(),
    extract_image_block_types: z.array(z.string()).optional(),
    files: z.lazy(() => exports.Files$inboundSchema),
    gz_uncompressed_content_type: z.nullable(z.string()).optional(),
    hi_res_model_name: z.nullable(z.string()).optional(),
    include_orig_elements: z.nullable(z.boolean()).optional(),
    include_page_breaks: z.boolean().default(false),
    include_slide_notes: z.boolean().default(true),
    languages: z.array(z.string()).optional(),
    max_characters: z.nullable(z.number().int()).optional(),
    multipage_sections: z.boolean().default(true),
    new_after_n_chars: z.nullable(z.number().int()).optional(),
    ocr_languages: z.array(z.string()).optional(),
    output_format: exports.OutputFormat$inboundSchema.default(OutputFormat.ApplicationJson),
    overlap: z.number().int().default(0),
    overlap_all: z.boolean().default(false),
    pdf_infer_table_structure: z.boolean().default(true),
    pdfminer_char_margin: z.nullable(z.number()).optional(),
    pdfminer_line_margin: z.nullable(z.number()).optional(),
    pdfminer_line_overlap: z.nullable(z.number()).optional(),
    pdfminer_word_margin: z.nullable(z.number()).optional(),
    similarity_threshold: z.nullable(z.number()).optional(),
    skip_infer_table_types: z.array(z.string()).optional(),
    split_pdf_allow_failed: z.boolean().default(false),
    split_pdf_concurrency_level: z.number().int().default(5),
    split_pdf_page: z.boolean().default(true),
    split_pdf_page_range: z.array(z.number().int()).optional(),
    starting_page_number: z.nullable(z.number().int()).optional(),
    strategy: exports.Strategy$inboundSchema.default(Strategy.HiRes),
    table_ocr_agent: z.nullable(z.string()).optional(),
    unique_element_ids: z.boolean().default(false),
    vlm_model: z.string().optional(),
    vlm_model_provider: exports.VLMModelProvider$inboundSchema.optional(),
    xml_keep_tags: z.boolean().default(false),
}).transform((v) => {
    return (0, primitives_js_1.remap)(v, {
        "chunking_strategy": "chunkingStrategy",
        "combine_under_n_chars": "combineUnderNChars",
        "content_type": "contentType",
        "do_not_break_similarity_on_footer_header": "doNotBreakSimilarityOnFooterHeader",
        "extract_image_block_types": "extractImageBlockTypes",
        "gz_uncompressed_content_type": "gzUncompressedContentType",
        "hi_res_model_name": "hiResModelName",
        "include_orig_elements": "includeOrigElements",
        "include_page_breaks": "includePageBreaks",
        "include_slide_notes": "includeSlideNotes",
        "max_characters": "maxCharacters",
        "multipage_sections": "multipageSections",
        "new_after_n_chars": "newAfterNChars",
        "ocr_languages": "ocrLanguages",
        "output_format": "outputFormat",
        "overlap_all": "overlapAll",
        "pdf_infer_table_structure": "pdfInferTableStructure",
        "pdfminer_char_margin": "pdfminerCharMargin",
        "pdfminer_line_margin": "pdfminerLineMargin",
        "pdfminer_line_overlap": "pdfminerLineOverlap",
        "pdfminer_word_margin": "pdfminerWordMargin",
        "similarity_threshold": "similarityThreshold",
        "skip_infer_table_types": "skipInferTableTypes",
        "split_pdf_allow_failed": "splitPdfAllowFailed",
        "split_pdf_concurrency_level": "splitPdfConcurrencyLevel",
        "split_pdf_page": "splitPdfPage",
        "split_pdf_page_range": "splitPdfPageRange",
        "starting_page_number": "startingPageNumber",
        "table_ocr_agent": "tableOcrAgent",
        "unique_element_ids": "uniqueElementIds",
        "vlm_model": "vlmModel",
        "vlm_model_provider": "vlmModelProvider",
        "xml_keep_tags": "xmlKeepTags",
    });
});
/** @internal */
exports.PartitionParameters$outboundSchema = z.object({
    chunkingStrategy: z.nullable(z.string()).optional(),
    combineUnderNChars: z.nullable(z.number().int()).optional(),
    contentType: z.nullable(z.string()).optional(),
    coordinates: z.boolean().default(false),
    doNotBreakSimilarityOnFooterHeader: z.boolean().default(false),
    encoding: z.nullable(z.string()).optional(),
    extractImageBlockTypes: z.array(z.string()).optional(),
    files: z.lazy(() => exports.Files$outboundSchema).or(blobs_js_1.blobLikeSchema),
    gzUncompressedContentType: z.nullable(z.string()).optional(),
    hiResModelName: z.nullable(z.string()).optional(),
    includeOrigElements: z.nullable(z.boolean()).optional(),
    includePageBreaks: z.boolean().default(false),
    includeSlideNotes: z.boolean().default(true),
    languages: z.array(z.string()).optional(),
    maxCharacters: z.nullable(z.number().int()).optional(),
    multipageSections: z.boolean().default(true),
    newAfterNChars: z.nullable(z.number().int()).optional(),
    ocrLanguages: z.array(z.string()).optional(),
    outputFormat: exports.OutputFormat$outboundSchema.default(OutputFormat.ApplicationJson),
    overlap: z.number().int().default(0),
    overlapAll: z.boolean().default(false),
    pdfInferTableStructure: z.boolean().default(true),
    pdfminerCharMargin: z.nullable(z.number()).optional(),
    pdfminerLineMargin: z.nullable(z.number()).optional(),
    pdfminerLineOverlap: z.nullable(z.number()).optional(),
    pdfminerWordMargin: z.nullable(z.number()).optional(),
    similarityThreshold: z.nullable(z.number()).optional(),
    skipInferTableTypes: z.array(z.string()).optional(),
    splitPdfAllowFailed: z.boolean().default(false),
    splitPdfConcurrencyLevel: z.number().int().default(5),
    splitPdfPage: z.boolean().default(true),
    splitPdfPageRange: z.array(z.number().int()).optional(),
    startingPageNumber: z.nullable(z.number().int()).optional(),
    strategy: exports.Strategy$outboundSchema.default(Strategy.HiRes),
    tableOcrAgent: z.nullable(z.string()).optional(),
    uniqueElementIds: z.boolean().default(false),
    vlmModel: z.string().optional(),
    vlmModelProvider: exports.VLMModelProvider$outboundSchema.optional(),
    xmlKeepTags: z.boolean().default(false),
}).transform((v) => {
    return (0, primitives_js_1.remap)(v, {
        chunkingStrategy: "chunking_strategy",
        combineUnderNChars: "combine_under_n_chars",
        contentType: "content_type",
        doNotBreakSimilarityOnFooterHeader: "do_not_break_similarity_on_footer_header",
        extractImageBlockTypes: "extract_image_block_types",
        gzUncompressedContentType: "gz_uncompressed_content_type",
        hiResModelName: "hi_res_model_name",
        includeOrigElements: "include_orig_elements",
        includePageBreaks: "include_page_breaks",
        includeSlideNotes: "include_slide_notes",
        maxCharacters: "max_characters",
        multipageSections: "multipage_sections",
        newAfterNChars: "new_after_n_chars",
        ocrLanguages: "ocr_languages",
        outputFormat: "output_format",
        overlapAll: "overlap_all",
        pdfInferTableStructure: "pdf_infer_table_structure",
        pdfminerCharMargin: "pdfminer_char_margin",
        pdfminerLineMargin: "pdfminer_line_margin",
        pdfminerLineOverlap: "pdfminer_line_overlap",
        pdfminerWordMargin: "pdfminer_word_margin",
        similarityThreshold: "similarity_threshold",
        skipInferTableTypes: "skip_infer_table_types",
        splitPdfAllowFailed: "split_pdf_allow_failed",
        splitPdfConcurrencyLevel: "split_pdf_concurrency_level",
        splitPdfPage: "split_pdf_page",
        splitPdfPageRange: "split_pdf_page_range",
        startingPageNumber: "starting_page_number",
        tableOcrAgent: "table_ocr_agent",
        uniqueElementIds: "unique_element_ids",
        vlmModel: "vlm_model",
        vlmModelProvider: "vlm_model_provider",
        xmlKeepTags: "xml_keep_tags",
    });
});
function partitionParametersToJSON(partitionParameters) {
    return JSON.stringify(exports.PartitionParameters$outboundSchema.parse(partitionParameters));
}
function partitionParametersFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.PartitionParameters$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'PartitionParameters' from JSON`);
}
//# sourceMappingURL=partitionparameters.js.map