"""
    Docling Serve

    No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)

    The version of the OpenAPI document: 
    Generated by OpenAPI Generator (https://openapi-generator.tech)

    Do not edit the class manually.
"""  # noqa: E501


import warnings
from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt
from typing import Any, Dict, List, Optional, Tuple, Union
from typing_extensions import Annotated

from pydantic import Field, StrictBool, StrictFloat, StrictInt, StrictStr
from typing import Any, Dict, List, Optional, Union
from typing_extensions import Annotated
from yfkm3_services_parse_client.models.convert_documents_request import ConvertDocumentsRequest
from yfkm3_services_parse_client.models.input_format import InputFormat
from yfkm3_services_parse_client.models.output_format import OutputFormat
from yfkm3_services_parse_client.models.response_process_file_v1_convert_file_post import ResponseProcessFileV1ConvertFilePost
from yfkm3_services_parse_client.models.response_process_url_v1_convert_source_post import ResponseProcessUrlV1ConvertSourcePost
from yfkm3_services_parse_client.models.task_status_response import TaskStatusResponse

from yfkm3_services_parse_client.api_client import ApiClient, RequestSerialized
from yfkm3_services_parse_client.api_response import ApiResponse
from yfkm3_services_parse_client.rest import RESTResponseType


class ConvertApi:
    """NOTE: This class is auto generated by OpenAPI Generator
    Ref: https://openapi-generator.tech

    Do not edit the class manually.
    """

    def __init__(self, api_client=None) -> None:
        if api_client is None:
            api_client = ApiClient.get_default()
        self.api_client = api_client


    @validate_call
    async def post_convert_file(
        self,
        files: List[StrictStr],
        target_type: Optional[Any] = None,
        from_formats: Annotated[Optional[List[InputFormat]], Field(description="Input format(s) to convert from. String or list of strings. Allowed values: docx, pptx, html, image, pdf, asciidoc, md, csv, xlsx, xml_uspto, xml_jats, xml_xbrl, mets_gbs, json_docling, audio, vtt, latex. Optional, defaults to all formats.")] = None,
        to_formats: Annotated[Optional[List[OutputFormat]], Field(description="Output format(s) to convert to. String or list of strings. Allowed values: md, json, yaml, html, html_split_page, text, doctags, vtt. Optional, defaults to Markdown.")] = None,
        image_export_mode: Annotated[Optional[Any], Field(description="Image export mode for the document (in case of JSON, Markdown or HTML). Allowed values: placeholder, embedded, referenced. Optional, defaults to Embedded.")] = None,
        do_ocr: Annotated[Optional[StrictBool], Field(description="If enabled, the bitmap content will be processed using OCR. Boolean. Optional, defaults to true")] = None,
        force_ocr: Annotated[Optional[StrictBool], Field(description="If enabled, replace existing text with OCR-generated text over content. Boolean. Optional, defaults to false.")] = None,
        ocr_engine: Annotated[Optional[Any], Field(description="The OCR engine to use. String. Allowed values: auto, easyocr, kserve_v2_ocr, ocrmac, rapidocr, tesserocr, tesseract. Optional, defaults to easyocr.")] = None,
        ocr_lang: Optional[List[StrictStr]] = None,
        ocr_preset: Annotated[Optional[StrictStr], Field(description="Preset ID for OCR engine.")] = None,
        ocr_custom_config: Optional[Dict[str, Any]] = None,
        pdf_backend: Annotated[Optional[Any], Field(description="The PDF backend to use. String. Allowed values: pypdfium2, docling_parse, dlparse_v1, dlparse_v2, dlparse_v4. Optional, defaults to pypdfium2.")] = None,
        table_mode: Annotated[Optional[Any], Field(description="Mode to use for table structure, String. Allowed values: fast, accurate. Optional, defaults to accurate.")] = None,
        table_cell_matching: Annotated[Optional[StrictBool], Field(description="If true, matches table cells predictions back to PDF cells. Can break table output if PDF cells are merged across table columns. If false, let table structure model define the text cells, ignore PDF cells.")] = None,
        pipeline: Annotated[Optional[Any], Field(description="Choose the pipeline to process PDF or image files.")] = None,
        page_range: Annotated[Optional[Annotated[List[Any], Field(min_length=2, max_length=2)]], Field(description="Only convert a range of pages. The page number starts at 1.")] = None,
        document_timeout: Annotated[Optional[Union[StrictFloat, StrictInt]], Field(description="The timeout for processing each document, in seconds.")] = None,
        abort_on_error: Annotated[Optional[StrictBool], Field(description="Abort on error if enabled. Boolean. Optional, defaults to false.")] = None,
        do_table_structure: Annotated[Optional[StrictBool], Field(description="If enabled, the table structure will be extracted. Boolean. Optional, defaults to true.")] = None,
        include_images: Annotated[Optional[StrictBool], Field(description="If enabled, images will be extracted from the document. Boolean. Optional, defaults to true.")] = None,
        images_scale: Annotated[Optional[Union[StrictFloat, StrictInt]], Field(description="Scale factor for images. Float. Optional, defaults to 2.0.")] = None,
        md_page_break_placeholder: Annotated[Optional[StrictStr], Field(description="Add this placeholder between pages in the markdown output.")] = None,
        do_code_enrichment: Annotated[Optional[StrictBool], Field(description="If enabled, perform OCR code enrichment. Boolean. Optional, defaults to false.")] = None,
        do_formula_enrichment: Annotated[Optional[StrictBool], Field(description="If enabled, perform formula OCR, return LaTeX code. Boolean. Optional, defaults to false.")] = None,
        do_picture_classification: Annotated[Optional[StrictBool], Field(description="If enabled, classify pictures in documents. Boolean. Optional, defaults to false.")] = None,
        do_chart_extraction: Annotated[Optional[StrictBool], Field(description="If enabled, extract numeric data from charts. Boolean. Optional, defaults to false.")] = None,
        do_picture_description: Annotated[Optional[StrictBool], Field(description="If enabled, describe pictures in documents. Boolean. Optional, defaults to false.")] = None,
        picture_description_area_threshold: Annotated[Optional[Union[StrictFloat, StrictInt]], Field(description="Minimum percentage of the area for a picture to be processed with the models.")] = None,
        picture_description_local: Annotated[Optional[StrictStr], Field(description="DEPRECATED: Options for running a local vision-language model in the picture description. The parameters refer to a model hosted on Hugging Face. This parameter is mutually exclusive with picture_description_api. Please migrate to picture_description_preset or picture_description_custom_config.")] = None,
        picture_description_api: Annotated[Optional[StrictStr], Field(description="DEPRECATED: API details for using a vision-language model in the picture description. This parameter is mutually exclusive with picture_description_local. Please migrate to picture_description_preset or picture_description_custom_config.")] = None,
        vlm_pipeline_model: Optional[Any] = None,
        vlm_pipeline_model_local: Annotated[Optional[StrictStr], Field(description="DEPRECATED: Options for running a local vision-language model for the vlm pipeline. The parameters refer to a model hosted on Hugging Face. This parameter is mutually exclusive with vlm_pipeline_model_api and vlm_pipeline_model. Please migrate to vlm_pipeline_preset or vlm_pipeline_custom_config.")] = None,
        vlm_pipeline_model_api: Annotated[Optional[StrictStr], Field(description="DEPRECATED: API details for using a vision-language model for the vlm pipeline. This parameter is mutually exclusive with vlm_pipeline_model_local and vlm_pipeline_model. Please migrate to vlm_pipeline_preset or vlm_pipeline_custom_config.")] = None,
        vlm_pipeline_preset: Optional[StrictStr] = None,
        picture_description_preset: Optional[StrictStr] = None,
        code_formula_preset: Optional[StrictStr] = None,
        vlm_pipeline_custom_config: Annotated[Optional[StrictStr], Field(description="Custom VLM configuration including model spec and engine options. Only available if admin allows it. Must include 'model_spec' and 'engine_options'.")] = None,
        picture_description_custom_config: Annotated[Optional[StrictStr], Field(description="Custom picture description configuration including model spec and engine options.")] = None,
        code_formula_custom_config: Annotated[Optional[StrictStr], Field(description="Custom code/formula extraction configuration including model spec and engine options.")] = None,
        table_structure_preset: Optional[StrictStr] = None,
        table_structure_custom_config: Optional[Dict[str, Any]] = None,
        layout_custom_config: Optional[Dict[str, Any]] = None,
        layout_preset: Optional[StrictStr] = None,
        picture_classification_preset: Optional[StrictStr] = None,
        picture_classification_custom_config: Optional[Dict[str, Any]] = None,
        provider: Annotated[Optional[Any], Field(description="Execution provider to use.")] = None,
        chunk: Annotated[Optional[StrictBool], Field(description="If true, the convert endpoint returns chunked output instead of plain document output.")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ResponseProcessFileV1ConvertFilePost:
        """Process File


        :param files: (required)
        :type files: List[str]
        :param target_type:
        :type target_type: TargetName
        :param from_formats: Input format(s) to convert from. String or list of strings. Allowed values: docx, pptx, html, image, pdf, asciidoc, md, csv, xlsx, xml_uspto, xml_jats, xml_xbrl, mets_gbs, json_docling, audio, vtt, latex. Optional, defaults to all formats.
        :type from_formats: List[InputFormat]
        :param to_formats: Output format(s) to convert to. String or list of strings. Allowed values: md, json, yaml, html, html_split_page, text, doctags, vtt. Optional, defaults to Markdown.
        :type to_formats: List[OutputFormat]
        :param image_export_mode: Image export mode for the document (in case of JSON, Markdown or HTML). Allowed values: placeholder, embedded, referenced. Optional, defaults to Embedded.
        :type image_export_mode: ImageRefMode
        :param do_ocr: If enabled, the bitmap content will be processed using OCR. Boolean. Optional, defaults to true
        :type do_ocr: bool
        :param force_ocr: If enabled, replace existing text with OCR-generated text over content. Boolean. Optional, defaults to false.
        :type force_ocr: bool
        :param ocr_engine: The OCR engine to use. String. Allowed values: auto, easyocr, kserve_v2_ocr, ocrmac, rapidocr, tesserocr, tesseract. Optional, defaults to easyocr.
        :type ocr_engine: OcrEnginesEnum
        :param ocr_lang:
        :type ocr_lang: List[str]
        :param ocr_preset: Preset ID for OCR engine.
        :type ocr_preset: str
        :param ocr_custom_config:
        :type ocr_custom_config: Dict[str, object]
        :param pdf_backend: The PDF backend to use. String. Allowed values: pypdfium2, docling_parse, dlparse_v1, dlparse_v2, dlparse_v4. Optional, defaults to pypdfium2.
        :type pdf_backend: PdfBackend
        :param table_mode: Mode to use for table structure, String. Allowed values: fast, accurate. Optional, defaults to accurate.
        :type table_mode: TableFormerMode
        :param table_cell_matching: If true, matches table cells predictions back to PDF cells. Can break table output if PDF cells are merged across table columns. If false, let table structure model define the text cells, ignore PDF cells.
        :type table_cell_matching: bool
        :param pipeline: Choose the pipeline to process PDF or image files.
        :type pipeline: ProcessingPipeline
        :param page_range: Only convert a range of pages. The page number starts at 1.
        :type page_range: List[object]
        :param document_timeout: The timeout for processing each document, in seconds.
        :type document_timeout: float
        :param abort_on_error: Abort on error if enabled. Boolean. Optional, defaults to false.
        :type abort_on_error: bool
        :param do_table_structure: If enabled, the table structure will be extracted. Boolean. Optional, defaults to true.
        :type do_table_structure: bool
        :param include_images: If enabled, images will be extracted from the document. Boolean. Optional, defaults to true.
        :type include_images: bool
        :param images_scale: Scale factor for images. Float. Optional, defaults to 2.0.
        :type images_scale: float
        :param md_page_break_placeholder: Add this placeholder between pages in the markdown output.
        :type md_page_break_placeholder: str
        :param do_code_enrichment: If enabled, perform OCR code enrichment. Boolean. Optional, defaults to false.
        :type do_code_enrichment: bool
        :param do_formula_enrichment: If enabled, perform formula OCR, return LaTeX code. Boolean. Optional, defaults to false.
        :type do_formula_enrichment: bool
        :param do_picture_classification: If enabled, classify pictures in documents. Boolean. Optional, defaults to false.
        :type do_picture_classification: bool
        :param do_chart_extraction: If enabled, extract numeric data from charts. Boolean. Optional, defaults to false.
        :type do_chart_extraction: bool
        :param do_picture_description: If enabled, describe pictures in documents. Boolean. Optional, defaults to false.
        :type do_picture_description: bool
        :param picture_description_area_threshold: Minimum percentage of the area for a picture to be processed with the models.
        :type picture_description_area_threshold: float
        :param picture_description_local: DEPRECATED: Options for running a local vision-language model in the picture description. The parameters refer to a model hosted on Hugging Face. This parameter is mutually exclusive with picture_description_api. Please migrate to picture_description_preset or picture_description_custom_config.
        :type picture_description_local: str
        :param picture_description_api: DEPRECATED: API details for using a vision-language model in the picture description. This parameter is mutually exclusive with picture_description_local. Please migrate to picture_description_preset or picture_description_custom_config.
        :type picture_description_api: str
        :param vlm_pipeline_model:
        :type vlm_pipeline_model: VlmModelType
        :param vlm_pipeline_model_local: DEPRECATED: Options for running a local vision-language model for the vlm pipeline. The parameters refer to a model hosted on Hugging Face. This parameter is mutually exclusive with vlm_pipeline_model_api and vlm_pipeline_model. Please migrate to vlm_pipeline_preset or vlm_pipeline_custom_config.
        :type vlm_pipeline_model_local: str
        :param vlm_pipeline_model_api: DEPRECATED: API details for using a vision-language model for the vlm pipeline. This parameter is mutually exclusive with vlm_pipeline_model_local and vlm_pipeline_model. Please migrate to vlm_pipeline_preset or vlm_pipeline_custom_config.
        :type vlm_pipeline_model_api: str
        :param vlm_pipeline_preset:
        :type vlm_pipeline_preset: str
        :param picture_description_preset:
        :type picture_description_preset: str
        :param code_formula_preset:
        :type code_formula_preset: str
        :param vlm_pipeline_custom_config: Custom VLM configuration including model spec and engine options. Only available if admin allows it. Must include 'model_spec' and 'engine_options'.
        :type vlm_pipeline_custom_config: str
        :param picture_description_custom_config: Custom picture description configuration including model spec and engine options.
        :type picture_description_custom_config: str
        :param code_formula_custom_config: Custom code/formula extraction configuration including model spec and engine options.
        :type code_formula_custom_config: str
        :param table_structure_preset:
        :type table_structure_preset: str
        :param table_structure_custom_config:
        :type table_structure_custom_config: Dict[str, object]
        :param layout_custom_config:
        :type layout_custom_config: Dict[str, object]
        :param layout_preset:
        :type layout_preset: str
        :param picture_classification_preset:
        :type picture_classification_preset: str
        :param picture_classification_custom_config:
        :type picture_classification_custom_config: Dict[str, object]
        :param provider: Execution provider to use.
        :type provider: ProviderKind
        :param chunk: If true, the convert endpoint returns chunked output instead of plain document output.
        :type chunk: bool
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._post_convert_file_serialize(
            files=files,
            target_type=target_type,
            from_formats=from_formats,
            to_formats=to_formats,
            image_export_mode=image_export_mode,
            do_ocr=do_ocr,
            force_ocr=force_ocr,
            ocr_engine=ocr_engine,
            ocr_lang=ocr_lang,
            ocr_preset=ocr_preset,
            ocr_custom_config=ocr_custom_config,
            pdf_backend=pdf_backend,
            table_mode=table_mode,
            table_cell_matching=table_cell_matching,
            pipeline=pipeline,
            page_range=page_range,
            document_timeout=document_timeout,
            abort_on_error=abort_on_error,
            do_table_structure=do_table_structure,
            include_images=include_images,
            images_scale=images_scale,
            md_page_break_placeholder=md_page_break_placeholder,
            do_code_enrichment=do_code_enrichment,
            do_formula_enrichment=do_formula_enrichment,
            do_picture_classification=do_picture_classification,
            do_chart_extraction=do_chart_extraction,
            do_picture_description=do_picture_description,
            picture_description_area_threshold=picture_description_area_threshold,
            picture_description_local=picture_description_local,
            picture_description_api=picture_description_api,
            vlm_pipeline_model=vlm_pipeline_model,
            vlm_pipeline_model_local=vlm_pipeline_model_local,
            vlm_pipeline_model_api=vlm_pipeline_model_api,
            vlm_pipeline_preset=vlm_pipeline_preset,
            picture_description_preset=picture_description_preset,
            code_formula_preset=code_formula_preset,
            vlm_pipeline_custom_config=vlm_pipeline_custom_config,
            picture_description_custom_config=picture_description_custom_config,
            code_formula_custom_config=code_formula_custom_config,
            table_structure_preset=table_structure_preset,
            table_structure_custom_config=table_structure_custom_config,
            layout_custom_config=layout_custom_config,
            layout_preset=layout_preset,
            picture_classification_preset=picture_classification_preset,
            picture_classification_custom_config=picture_classification_custom_config,
            provider=provider,
            chunk=chunk,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ResponseProcessFileV1ConvertFilePost",
            '422': "HTTPValidationError",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def post_convert_file_with_http_info(
        self,
        files: List[StrictStr],
        target_type: Optional[Any] = None,
        from_formats: Annotated[Optional[List[InputFormat]], Field(description="Input format(s) to convert from. String or list of strings. Allowed values: docx, pptx, html, image, pdf, asciidoc, md, csv, xlsx, xml_uspto, xml_jats, xml_xbrl, mets_gbs, json_docling, audio, vtt, latex. Optional, defaults to all formats.")] = None,
        to_formats: Annotated[Optional[List[OutputFormat]], Field(description="Output format(s) to convert to. String or list of strings. Allowed values: md, json, yaml, html, html_split_page, text, doctags, vtt. Optional, defaults to Markdown.")] = None,
        image_export_mode: Annotated[Optional[Any], Field(description="Image export mode for the document (in case of JSON, Markdown or HTML). Allowed values: placeholder, embedded, referenced. Optional, defaults to Embedded.")] = None,
        do_ocr: Annotated[Optional[StrictBool], Field(description="If enabled, the bitmap content will be processed using OCR. Boolean. Optional, defaults to true")] = None,
        force_ocr: Annotated[Optional[StrictBool], Field(description="If enabled, replace existing text with OCR-generated text over content. Boolean. Optional, defaults to false.")] = None,
        ocr_engine: Annotated[Optional[Any], Field(description="The OCR engine to use. String. Allowed values: auto, easyocr, kserve_v2_ocr, ocrmac, rapidocr, tesserocr, tesseract. Optional, defaults to easyocr.")] = None,
        ocr_lang: Optional[List[StrictStr]] = None,
        ocr_preset: Annotated[Optional[StrictStr], Field(description="Preset ID for OCR engine.")] = None,
        ocr_custom_config: Optional[Dict[str, Any]] = None,
        pdf_backend: Annotated[Optional[Any], Field(description="The PDF backend to use. String. Allowed values: pypdfium2, docling_parse, dlparse_v1, dlparse_v2, dlparse_v4. Optional, defaults to pypdfium2.")] = None,
        table_mode: Annotated[Optional[Any], Field(description="Mode to use for table structure, String. Allowed values: fast, accurate. Optional, defaults to accurate.")] = None,
        table_cell_matching: Annotated[Optional[StrictBool], Field(description="If true, matches table cells predictions back to PDF cells. Can break table output if PDF cells are merged across table columns. If false, let table structure model define the text cells, ignore PDF cells.")] = None,
        pipeline: Annotated[Optional[Any], Field(description="Choose the pipeline to process PDF or image files.")] = None,
        page_range: Annotated[Optional[Annotated[List[Any], Field(min_length=2, max_length=2)]], Field(description="Only convert a range of pages. The page number starts at 1.")] = None,
        document_timeout: Annotated[Optional[Union[StrictFloat, StrictInt]], Field(description="The timeout for processing each document, in seconds.")] = None,
        abort_on_error: Annotated[Optional[StrictBool], Field(description="Abort on error if enabled. Boolean. Optional, defaults to false.")] = None,
        do_table_structure: Annotated[Optional[StrictBool], Field(description="If enabled, the table structure will be extracted. Boolean. Optional, defaults to true.")] = None,
        include_images: Annotated[Optional[StrictBool], Field(description="If enabled, images will be extracted from the document. Boolean. Optional, defaults to true.")] = None,
        images_scale: Annotated[Optional[Union[StrictFloat, StrictInt]], Field(description="Scale factor for images. Float. Optional, defaults to 2.0.")] = None,
        md_page_break_placeholder: Annotated[Optional[StrictStr], Field(description="Add this placeholder between pages in the markdown output.")] = None,
        do_code_enrichment: Annotated[Optional[StrictBool], Field(description="If enabled, perform OCR code enrichment. Boolean. Optional, defaults to false.")] = None,
        do_formula_enrichment: Annotated[Optional[StrictBool], Field(description="If enabled, perform formula OCR, return LaTeX code. Boolean. Optional, defaults to false.")] = None,
        do_picture_classification: Annotated[Optional[StrictBool], Field(description="If enabled, classify pictures in documents. Boolean. Optional, defaults to false.")] = None,
        do_chart_extraction: Annotated[Optional[StrictBool], Field(description="If enabled, extract numeric data from charts. Boolean. Optional, defaults to false.")] = None,
        do_picture_description: Annotated[Optional[StrictBool], Field(description="If enabled, describe pictures in documents. Boolean. Optional, defaults to false.")] = None,
        picture_description_area_threshold: Annotated[Optional[Union[StrictFloat, StrictInt]], Field(description="Minimum percentage of the area for a picture to be processed with the models.")] = None,
        picture_description_local: Annotated[Optional[StrictStr], Field(description="DEPRECATED: Options for running a local vision-language model in the picture description. The parameters refer to a model hosted on Hugging Face. This parameter is mutually exclusive with picture_description_api. Please migrate to picture_description_preset or picture_description_custom_config.")] = None,
        picture_description_api: Annotated[Optional[StrictStr], Field(description="DEPRECATED: API details for using a vision-language model in the picture description. This parameter is mutually exclusive with picture_description_local. Please migrate to picture_description_preset or picture_description_custom_config.")] = None,
        vlm_pipeline_model: Optional[Any] = None,
        vlm_pipeline_model_local: Annotated[Optional[StrictStr], Field(description="DEPRECATED: Options for running a local vision-language model for the vlm pipeline. The parameters refer to a model hosted on Hugging Face. This parameter is mutually exclusive with vlm_pipeline_model_api and vlm_pipeline_model. Please migrate to vlm_pipeline_preset or vlm_pipeline_custom_config.")] = None,
        vlm_pipeline_model_api: Annotated[Optional[StrictStr], Field(description="DEPRECATED: API details for using a vision-language model for the vlm pipeline. This parameter is mutually exclusive with vlm_pipeline_model_local and vlm_pipeline_model. Please migrate to vlm_pipeline_preset or vlm_pipeline_custom_config.")] = None,
        vlm_pipeline_preset: Optional[StrictStr] = None,
        picture_description_preset: Optional[StrictStr] = None,
        code_formula_preset: Optional[StrictStr] = None,
        vlm_pipeline_custom_config: Annotated[Optional[StrictStr], Field(description="Custom VLM configuration including model spec and engine options. Only available if admin allows it. Must include 'model_spec' and 'engine_options'.")] = None,
        picture_description_custom_config: Annotated[Optional[StrictStr], Field(description="Custom picture description configuration including model spec and engine options.")] = None,
        code_formula_custom_config: Annotated[Optional[StrictStr], Field(description="Custom code/formula extraction configuration including model spec and engine options.")] = None,
        table_structure_preset: Optional[StrictStr] = None,
        table_structure_custom_config: Optional[Dict[str, Any]] = None,
        layout_custom_config: Optional[Dict[str, Any]] = None,
        layout_preset: Optional[StrictStr] = None,
        picture_classification_preset: Optional[StrictStr] = None,
        picture_classification_custom_config: Optional[Dict[str, Any]] = None,
        provider: Annotated[Optional[Any], Field(description="Execution provider to use.")] = None,
        chunk: Annotated[Optional[StrictBool], Field(description="If true, the convert endpoint returns chunked output instead of plain document output.")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[ResponseProcessFileV1ConvertFilePost]:
        """Process File


        :param files: (required)
        :type files: List[str]
        :param target_type:
        :type target_type: TargetName
        :param from_formats: Input format(s) to convert from. String or list of strings. Allowed values: docx, pptx, html, image, pdf, asciidoc, md, csv, xlsx, xml_uspto, xml_jats, xml_xbrl, mets_gbs, json_docling, audio, vtt, latex. Optional, defaults to all formats.
        :type from_formats: List[InputFormat]
        :param to_formats: Output format(s) to convert to. String or list of strings. Allowed values: md, json, yaml, html, html_split_page, text, doctags, vtt. Optional, defaults to Markdown.
        :type to_formats: List[OutputFormat]
        :param image_export_mode: Image export mode for the document (in case of JSON, Markdown or HTML). Allowed values: placeholder, embedded, referenced. Optional, defaults to Embedded.
        :type image_export_mode: ImageRefMode
        :param do_ocr: If enabled, the bitmap content will be processed using OCR. Boolean. Optional, defaults to true
        :type do_ocr: bool
        :param force_ocr: If enabled, replace existing text with OCR-generated text over content. Boolean. Optional, defaults to false.
        :type force_ocr: bool
        :param ocr_engine: The OCR engine to use. String. Allowed values: auto, easyocr, kserve_v2_ocr, ocrmac, rapidocr, tesserocr, tesseract. Optional, defaults to easyocr.
        :type ocr_engine: OcrEnginesEnum
        :param ocr_lang:
        :type ocr_lang: List[str]
        :param ocr_preset: Preset ID for OCR engine.
        :type ocr_preset: str
        :param ocr_custom_config:
        :type ocr_custom_config: Dict[str, object]
        :param pdf_backend: The PDF backend to use. String. Allowed values: pypdfium2, docling_parse, dlparse_v1, dlparse_v2, dlparse_v4. Optional, defaults to pypdfium2.
        :type pdf_backend: PdfBackend
        :param table_mode: Mode to use for table structure, String. Allowed values: fast, accurate. Optional, defaults to accurate.
        :type table_mode: TableFormerMode
        :param table_cell_matching: If true, matches table cells predictions back to PDF cells. Can break table output if PDF cells are merged across table columns. If false, let table structure model define the text cells, ignore PDF cells.
        :type table_cell_matching: bool
        :param pipeline: Choose the pipeline to process PDF or image files.
        :type pipeline: ProcessingPipeline
        :param page_range: Only convert a range of pages. The page number starts at 1.
        :type page_range: List[object]
        :param document_timeout: The timeout for processing each document, in seconds.
        :type document_timeout: float
        :param abort_on_error: Abort on error if enabled. Boolean. Optional, defaults to false.
        :type abort_on_error: bool
        :param do_table_structure: If enabled, the table structure will be extracted. Boolean. Optional, defaults to true.
        :type do_table_structure: bool
        :param include_images: If enabled, images will be extracted from the document. Boolean. Optional, defaults to true.
        :type include_images: bool
        :param images_scale: Scale factor for images. Float. Optional, defaults to 2.0.
        :type images_scale: float
        :param md_page_break_placeholder: Add this placeholder between pages in the markdown output.
        :type md_page_break_placeholder: str
        :param do_code_enrichment: If enabled, perform OCR code enrichment. Boolean. Optional, defaults to false.
        :type do_code_enrichment: bool
        :param do_formula_enrichment: If enabled, perform formula OCR, return LaTeX code. Boolean. Optional, defaults to false.
        :type do_formula_enrichment: bool
        :param do_picture_classification: If enabled, classify pictures in documents. Boolean. Optional, defaults to false.
        :type do_picture_classification: bool
        :param do_chart_extraction: If enabled, extract numeric data from charts. Boolean. Optional, defaults to false.
        :type do_chart_extraction: bool
        :param do_picture_description: If enabled, describe pictures in documents. Boolean. Optional, defaults to false.
        :type do_picture_description: bool
        :param picture_description_area_threshold: Minimum percentage of the area for a picture to be processed with the models.
        :type picture_description_area_threshold: float
        :param picture_description_local: DEPRECATED: Options for running a local vision-language model in the picture description. The parameters refer to a model hosted on Hugging Face. This parameter is mutually exclusive with picture_description_api. Please migrate to picture_description_preset or picture_description_custom_config.
        :type picture_description_local: str
        :param picture_description_api: DEPRECATED: API details for using a vision-language model in the picture description. This parameter is mutually exclusive with picture_description_local. Please migrate to picture_description_preset or picture_description_custom_config.
        :type picture_description_api: str
        :param vlm_pipeline_model:
        :type vlm_pipeline_model: VlmModelType
        :param vlm_pipeline_model_local: DEPRECATED: Options for running a local vision-language model for the vlm pipeline. The parameters refer to a model hosted on Hugging Face. This parameter is mutually exclusive with vlm_pipeline_model_api and vlm_pipeline_model. Please migrate to vlm_pipeline_preset or vlm_pipeline_custom_config.
        :type vlm_pipeline_model_local: str
        :param vlm_pipeline_model_api: DEPRECATED: API details for using a vision-language model for the vlm pipeline. This parameter is mutually exclusive with vlm_pipeline_model_local and vlm_pipeline_model. Please migrate to vlm_pipeline_preset or vlm_pipeline_custom_config.
        :type vlm_pipeline_model_api: str
        :param vlm_pipeline_preset:
        :type vlm_pipeline_preset: str
        :param picture_description_preset:
        :type picture_description_preset: str
        :param code_formula_preset:
        :type code_formula_preset: str
        :param vlm_pipeline_custom_config: Custom VLM configuration including model spec and engine options. Only available if admin allows it. Must include 'model_spec' and 'engine_options'.
        :type vlm_pipeline_custom_config: str
        :param picture_description_custom_config: Custom picture description configuration including model spec and engine options.
        :type picture_description_custom_config: str
        :param code_formula_custom_config: Custom code/formula extraction configuration including model spec and engine options.
        :type code_formula_custom_config: str
        :param table_structure_preset:
        :type table_structure_preset: str
        :param table_structure_custom_config:
        :type table_structure_custom_config: Dict[str, object]
        :param layout_custom_config:
        :type layout_custom_config: Dict[str, object]
        :param layout_preset:
        :type layout_preset: str
        :param picture_classification_preset:
        :type picture_classification_preset: str
        :param picture_classification_custom_config:
        :type picture_classification_custom_config: Dict[str, object]
        :param provider: Execution provider to use.
        :type provider: ProviderKind
        :param chunk: If true, the convert endpoint returns chunked output instead of plain document output.
        :type chunk: bool
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._post_convert_file_serialize(
            files=files,
            target_type=target_type,
            from_formats=from_formats,
            to_formats=to_formats,
            image_export_mode=image_export_mode,
            do_ocr=do_ocr,
            force_ocr=force_ocr,
            ocr_engine=ocr_engine,
            ocr_lang=ocr_lang,
            ocr_preset=ocr_preset,
            ocr_custom_config=ocr_custom_config,
            pdf_backend=pdf_backend,
            table_mode=table_mode,
            table_cell_matching=table_cell_matching,
            pipeline=pipeline,
            page_range=page_range,
            document_timeout=document_timeout,
            abort_on_error=abort_on_error,
            do_table_structure=do_table_structure,
            include_images=include_images,
            images_scale=images_scale,
            md_page_break_placeholder=md_page_break_placeholder,
            do_code_enrichment=do_code_enrichment,
            do_formula_enrichment=do_formula_enrichment,
            do_picture_classification=do_picture_classification,
            do_chart_extraction=do_chart_extraction,
            do_picture_description=do_picture_description,
            picture_description_area_threshold=picture_description_area_threshold,
            picture_description_local=picture_description_local,
            picture_description_api=picture_description_api,
            vlm_pipeline_model=vlm_pipeline_model,
            vlm_pipeline_model_local=vlm_pipeline_model_local,
            vlm_pipeline_model_api=vlm_pipeline_model_api,
            vlm_pipeline_preset=vlm_pipeline_preset,
            picture_description_preset=picture_description_preset,
            code_formula_preset=code_formula_preset,
            vlm_pipeline_custom_config=vlm_pipeline_custom_config,
            picture_description_custom_config=picture_description_custom_config,
            code_formula_custom_config=code_formula_custom_config,
            table_structure_preset=table_structure_preset,
            table_structure_custom_config=table_structure_custom_config,
            layout_custom_config=layout_custom_config,
            layout_preset=layout_preset,
            picture_classification_preset=picture_classification_preset,
            picture_classification_custom_config=picture_classification_custom_config,
            provider=provider,
            chunk=chunk,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ResponseProcessFileV1ConvertFilePost",
            '422': "HTTPValidationError",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def post_convert_file_without_preload_content(
        self,
        files: List[StrictStr],
        target_type: Optional[Any] = None,
        from_formats: Annotated[Optional[List[InputFormat]], Field(description="Input format(s) to convert from. String or list of strings. Allowed values: docx, pptx, html, image, pdf, asciidoc, md, csv, xlsx, xml_uspto, xml_jats, xml_xbrl, mets_gbs, json_docling, audio, vtt, latex. Optional, defaults to all formats.")] = None,
        to_formats: Annotated[Optional[List[OutputFormat]], Field(description="Output format(s) to convert to. String or list of strings. Allowed values: md, json, yaml, html, html_split_page, text, doctags, vtt. Optional, defaults to Markdown.")] = None,
        image_export_mode: Annotated[Optional[Any], Field(description="Image export mode for the document (in case of JSON, Markdown or HTML). Allowed values: placeholder, embedded, referenced. Optional, defaults to Embedded.")] = None,
        do_ocr: Annotated[Optional[StrictBool], Field(description="If enabled, the bitmap content will be processed using OCR. Boolean. Optional, defaults to true")] = None,
        force_ocr: Annotated[Optional[StrictBool], Field(description="If enabled, replace existing text with OCR-generated text over content. Boolean. Optional, defaults to false.")] = None,
        ocr_engine: Annotated[Optional[Any], Field(description="The OCR engine to use. String. Allowed values: auto, easyocr, kserve_v2_ocr, ocrmac, rapidocr, tesserocr, tesseract. Optional, defaults to easyocr.")] = None,
        ocr_lang: Optional[List[StrictStr]] = None,
        ocr_preset: Annotated[Optional[StrictStr], Field(description="Preset ID for OCR engine.")] = None,
        ocr_custom_config: Optional[Dict[str, Any]] = None,
        pdf_backend: Annotated[Optional[Any], Field(description="The PDF backend to use. String. Allowed values: pypdfium2, docling_parse, dlparse_v1, dlparse_v2, dlparse_v4. Optional, defaults to pypdfium2.")] = None,
        table_mode: Annotated[Optional[Any], Field(description="Mode to use for table structure, String. Allowed values: fast, accurate. Optional, defaults to accurate.")] = None,
        table_cell_matching: Annotated[Optional[StrictBool], Field(description="If true, matches table cells predictions back to PDF cells. Can break table output if PDF cells are merged across table columns. If false, let table structure model define the text cells, ignore PDF cells.")] = None,
        pipeline: Annotated[Optional[Any], Field(description="Choose the pipeline to process PDF or image files.")] = None,
        page_range: Annotated[Optional[Annotated[List[Any], Field(min_length=2, max_length=2)]], Field(description="Only convert a range of pages. The page number starts at 1.")] = None,
        document_timeout: Annotated[Optional[Union[StrictFloat, StrictInt]], Field(description="The timeout for processing each document, in seconds.")] = None,
        abort_on_error: Annotated[Optional[StrictBool], Field(description="Abort on error if enabled. Boolean. Optional, defaults to false.")] = None,
        do_table_structure: Annotated[Optional[StrictBool], Field(description="If enabled, the table structure will be extracted. Boolean. Optional, defaults to true.")] = None,
        include_images: Annotated[Optional[StrictBool], Field(description="If enabled, images will be extracted from the document. Boolean. Optional, defaults to true.")] = None,
        images_scale: Annotated[Optional[Union[StrictFloat, StrictInt]], Field(description="Scale factor for images. Float. Optional, defaults to 2.0.")] = None,
        md_page_break_placeholder: Annotated[Optional[StrictStr], Field(description="Add this placeholder between pages in the markdown output.")] = None,
        do_code_enrichment: Annotated[Optional[StrictBool], Field(description="If enabled, perform OCR code enrichment. Boolean. Optional, defaults to false.")] = None,
        do_formula_enrichment: Annotated[Optional[StrictBool], Field(description="If enabled, perform formula OCR, return LaTeX code. Boolean. Optional, defaults to false.")] = None,
        do_picture_classification: Annotated[Optional[StrictBool], Field(description="If enabled, classify pictures in documents. Boolean. Optional, defaults to false.")] = None,
        do_chart_extraction: Annotated[Optional[StrictBool], Field(description="If enabled, extract numeric data from charts. Boolean. Optional, defaults to false.")] = None,
        do_picture_description: Annotated[Optional[StrictBool], Field(description="If enabled, describe pictures in documents. Boolean. Optional, defaults to false.")] = None,
        picture_description_area_threshold: Annotated[Optional[Union[StrictFloat, StrictInt]], Field(description="Minimum percentage of the area for a picture to be processed with the models.")] = None,
        picture_description_local: Annotated[Optional[StrictStr], Field(description="DEPRECATED: Options for running a local vision-language model in the picture description. The parameters refer to a model hosted on Hugging Face. This parameter is mutually exclusive with picture_description_api. Please migrate to picture_description_preset or picture_description_custom_config.")] = None,
        picture_description_api: Annotated[Optional[StrictStr], Field(description="DEPRECATED: API details for using a vision-language model in the picture description. This parameter is mutually exclusive with picture_description_local. Please migrate to picture_description_preset or picture_description_custom_config.")] = None,
        vlm_pipeline_model: Optional[Any] = None,
        vlm_pipeline_model_local: Annotated[Optional[StrictStr], Field(description="DEPRECATED: Options for running a local vision-language model for the vlm pipeline. The parameters refer to a model hosted on Hugging Face. This parameter is mutually exclusive with vlm_pipeline_model_api and vlm_pipeline_model. Please migrate to vlm_pipeline_preset or vlm_pipeline_custom_config.")] = None,
        vlm_pipeline_model_api: Annotated[Optional[StrictStr], Field(description="DEPRECATED: API details for using a vision-language model for the vlm pipeline. This parameter is mutually exclusive with vlm_pipeline_model_local and vlm_pipeline_model. Please migrate to vlm_pipeline_preset or vlm_pipeline_custom_config.")] = None,
        vlm_pipeline_preset: Optional[StrictStr] = None,
        picture_description_preset: Optional[StrictStr] = None,
        code_formula_preset: Optional[StrictStr] = None,
        vlm_pipeline_custom_config: Annotated[Optional[StrictStr], Field(description="Custom VLM configuration including model spec and engine options. Only available if admin allows it. Must include 'model_spec' and 'engine_options'.")] = None,
        picture_description_custom_config: Annotated[Optional[StrictStr], Field(description="Custom picture description configuration including model spec and engine options.")] = None,
        code_formula_custom_config: Annotated[Optional[StrictStr], Field(description="Custom code/formula extraction configuration including model spec and engine options.")] = None,
        table_structure_preset: Optional[StrictStr] = None,
        table_structure_custom_config: Optional[Dict[str, Any]] = None,
        layout_custom_config: Optional[Dict[str, Any]] = None,
        layout_preset: Optional[StrictStr] = None,
        picture_classification_preset: Optional[StrictStr] = None,
        picture_classification_custom_config: Optional[Dict[str, Any]] = None,
        provider: Annotated[Optional[Any], Field(description="Execution provider to use.")] = None,
        chunk: Annotated[Optional[StrictBool], Field(description="If true, the convert endpoint returns chunked output instead of plain document output.")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Process File


        :param files: (required)
        :type files: List[str]
        :param target_type:
        :type target_type: TargetName
        :param from_formats: Input format(s) to convert from. String or list of strings. Allowed values: docx, pptx, html, image, pdf, asciidoc, md, csv, xlsx, xml_uspto, xml_jats, xml_xbrl, mets_gbs, json_docling, audio, vtt, latex. Optional, defaults to all formats.
        :type from_formats: List[InputFormat]
        :param to_formats: Output format(s) to convert to. String or list of strings. Allowed values: md, json, yaml, html, html_split_page, text, doctags, vtt. Optional, defaults to Markdown.
        :type to_formats: List[OutputFormat]
        :param image_export_mode: Image export mode for the document (in case of JSON, Markdown or HTML). Allowed values: placeholder, embedded, referenced. Optional, defaults to Embedded.
        :type image_export_mode: ImageRefMode
        :param do_ocr: If enabled, the bitmap content will be processed using OCR. Boolean. Optional, defaults to true
        :type do_ocr: bool
        :param force_ocr: If enabled, replace existing text with OCR-generated text over content. Boolean. Optional, defaults to false.
        :type force_ocr: bool
        :param ocr_engine: The OCR engine to use. String. Allowed values: auto, easyocr, kserve_v2_ocr, ocrmac, rapidocr, tesserocr, tesseract. Optional, defaults to easyocr.
        :type ocr_engine: OcrEnginesEnum
        :param ocr_lang:
        :type ocr_lang: List[str]
        :param ocr_preset: Preset ID for OCR engine.
        :type ocr_preset: str
        :param ocr_custom_config:
        :type ocr_custom_config: Dict[str, object]
        :param pdf_backend: The PDF backend to use. String. Allowed values: pypdfium2, docling_parse, dlparse_v1, dlparse_v2, dlparse_v4. Optional, defaults to pypdfium2.
        :type pdf_backend: PdfBackend
        :param table_mode: Mode to use for table structure, String. Allowed values: fast, accurate. Optional, defaults to accurate.
        :type table_mode: TableFormerMode
        :param table_cell_matching: If true, matches table cells predictions back to PDF cells. Can break table output if PDF cells are merged across table columns. If false, let table structure model define the text cells, ignore PDF cells.
        :type table_cell_matching: bool
        :param pipeline: Choose the pipeline to process PDF or image files.
        :type pipeline: ProcessingPipeline
        :param page_range: Only convert a range of pages. The page number starts at 1.
        :type page_range: List[object]
        :param document_timeout: The timeout for processing each document, in seconds.
        :type document_timeout: float
        :param abort_on_error: Abort on error if enabled. Boolean. Optional, defaults to false.
        :type abort_on_error: bool
        :param do_table_structure: If enabled, the table structure will be extracted. Boolean. Optional, defaults to true.
        :type do_table_structure: bool
        :param include_images: If enabled, images will be extracted from the document. Boolean. Optional, defaults to true.
        :type include_images: bool
        :param images_scale: Scale factor for images. Float. Optional, defaults to 2.0.
        :type images_scale: float
        :param md_page_break_placeholder: Add this placeholder between pages in the markdown output.
        :type md_page_break_placeholder: str
        :param do_code_enrichment: If enabled, perform OCR code enrichment. Boolean. Optional, defaults to false.
        :type do_code_enrichment: bool
        :param do_formula_enrichment: If enabled, perform formula OCR, return LaTeX code. Boolean. Optional, defaults to false.
        :type do_formula_enrichment: bool
        :param do_picture_classification: If enabled, classify pictures in documents. Boolean. Optional, defaults to false.
        :type do_picture_classification: bool
        :param do_chart_extraction: If enabled, extract numeric data from charts. Boolean. Optional, defaults to false.
        :type do_chart_extraction: bool
        :param do_picture_description: If enabled, describe pictures in documents. Boolean. Optional, defaults to false.
        :type do_picture_description: bool
        :param picture_description_area_threshold: Minimum percentage of the area for a picture to be processed with the models.
        :type picture_description_area_threshold: float
        :param picture_description_local: DEPRECATED: Options for running a local vision-language model in the picture description. The parameters refer to a model hosted on Hugging Face. This parameter is mutually exclusive with picture_description_api. Please migrate to picture_description_preset or picture_description_custom_config.
        :type picture_description_local: str
        :param picture_description_api: DEPRECATED: API details for using a vision-language model in the picture description. This parameter is mutually exclusive with picture_description_local. Please migrate to picture_description_preset or picture_description_custom_config.
        :type picture_description_api: str
        :param vlm_pipeline_model:
        :type vlm_pipeline_model: VlmModelType
        :param vlm_pipeline_model_local: DEPRECATED: Options for running a local vision-language model for the vlm pipeline. The parameters refer to a model hosted on Hugging Face. This parameter is mutually exclusive with vlm_pipeline_model_api and vlm_pipeline_model. Please migrate to vlm_pipeline_preset or vlm_pipeline_custom_config.
        :type vlm_pipeline_model_local: str
        :param vlm_pipeline_model_api: DEPRECATED: API details for using a vision-language model for the vlm pipeline. This parameter is mutually exclusive with vlm_pipeline_model_local and vlm_pipeline_model. Please migrate to vlm_pipeline_preset or vlm_pipeline_custom_config.
        :type vlm_pipeline_model_api: str
        :param vlm_pipeline_preset:
        :type vlm_pipeline_preset: str
        :param picture_description_preset:
        :type picture_description_preset: str
        :param code_formula_preset:
        :type code_formula_preset: str
        :param vlm_pipeline_custom_config: Custom VLM configuration including model spec and engine options. Only available if admin allows it. Must include 'model_spec' and 'engine_options'.
        :type vlm_pipeline_custom_config: str
        :param picture_description_custom_config: Custom picture description configuration including model spec and engine options.
        :type picture_description_custom_config: str
        :param code_formula_custom_config: Custom code/formula extraction configuration including model spec and engine options.
        :type code_formula_custom_config: str
        :param table_structure_preset:
        :type table_structure_preset: str
        :param table_structure_custom_config:
        :type table_structure_custom_config: Dict[str, object]
        :param layout_custom_config:
        :type layout_custom_config: Dict[str, object]
        :param layout_preset:
        :type layout_preset: str
        :param picture_classification_preset:
        :type picture_classification_preset: str
        :param picture_classification_custom_config:
        :type picture_classification_custom_config: Dict[str, object]
        :param provider: Execution provider to use.
        :type provider: ProviderKind
        :param chunk: If true, the convert endpoint returns chunked output instead of plain document output.
        :type chunk: bool
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._post_convert_file_serialize(
            files=files,
            target_type=target_type,
            from_formats=from_formats,
            to_formats=to_formats,
            image_export_mode=image_export_mode,
            do_ocr=do_ocr,
            force_ocr=force_ocr,
            ocr_engine=ocr_engine,
            ocr_lang=ocr_lang,
            ocr_preset=ocr_preset,
            ocr_custom_config=ocr_custom_config,
            pdf_backend=pdf_backend,
            table_mode=table_mode,
            table_cell_matching=table_cell_matching,
            pipeline=pipeline,
            page_range=page_range,
            document_timeout=document_timeout,
            abort_on_error=abort_on_error,
            do_table_structure=do_table_structure,
            include_images=include_images,
            images_scale=images_scale,
            md_page_break_placeholder=md_page_break_placeholder,
            do_code_enrichment=do_code_enrichment,
            do_formula_enrichment=do_formula_enrichment,
            do_picture_classification=do_picture_classification,
            do_chart_extraction=do_chart_extraction,
            do_picture_description=do_picture_description,
            picture_description_area_threshold=picture_description_area_threshold,
            picture_description_local=picture_description_local,
            picture_description_api=picture_description_api,
            vlm_pipeline_model=vlm_pipeline_model,
            vlm_pipeline_model_local=vlm_pipeline_model_local,
            vlm_pipeline_model_api=vlm_pipeline_model_api,
            vlm_pipeline_preset=vlm_pipeline_preset,
            picture_description_preset=picture_description_preset,
            code_formula_preset=code_formula_preset,
            vlm_pipeline_custom_config=vlm_pipeline_custom_config,
            picture_description_custom_config=picture_description_custom_config,
            code_formula_custom_config=code_formula_custom_config,
            table_structure_preset=table_structure_preset,
            table_structure_custom_config=table_structure_custom_config,
            layout_custom_config=layout_custom_config,
            layout_preset=layout_preset,
            picture_classification_preset=picture_classification_preset,
            picture_classification_custom_config=picture_classification_custom_config,
            provider=provider,
            chunk=chunk,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ResponseProcessFileV1ConvertFilePost",
            '422': "HTTPValidationError",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _post_convert_file_serialize(
        self,
        files,
        target_type,
        from_formats,
        to_formats,
        image_export_mode,
        do_ocr,
        force_ocr,
        ocr_engine,
        ocr_lang,
        ocr_preset,
        ocr_custom_config,
        pdf_backend,
        table_mode,
        table_cell_matching,
        pipeline,
        page_range,
        document_timeout,
        abort_on_error,
        do_table_structure,
        include_images,
        images_scale,
        md_page_break_placeholder,
        do_code_enrichment,
        do_formula_enrichment,
        do_picture_classification,
        do_chart_extraction,
        do_picture_description,
        picture_description_area_threshold,
        picture_description_local,
        picture_description_api,
        vlm_pipeline_model,
        vlm_pipeline_model_local,
        vlm_pipeline_model_api,
        vlm_pipeline_preset,
        picture_description_preset,
        code_formula_preset,
        vlm_pipeline_custom_config,
        picture_description_custom_config,
        code_formula_custom_config,
        table_structure_preset,
        table_structure_custom_config,
        layout_custom_config,
        layout_preset,
        picture_classification_preset,
        picture_classification_custom_config,
        provider,
        chunk,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
            'files': 'csv',
            'from_formats': 'csv',
            'to_formats': 'csv',
            'ocr_lang': 'csv',
            'page_range': 'csv',
        }

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        # process the header parameters
        # process the form parameters
        if files is not None:
            _form_params.append(('files', files))
        if target_type is not None:
            _form_params.append(('target_type', target_type))
        if from_formats is not None:
            _form_params.append(('from_formats', from_formats))
        if to_formats is not None:
            _form_params.append(('to_formats', to_formats))
        if image_export_mode is not None:
            _form_params.append(('image_export_mode', image_export_mode))
        if do_ocr is not None:
            _form_params.append(('do_ocr', do_ocr))
        if force_ocr is not None:
            _form_params.append(('force_ocr', force_ocr))
        if ocr_engine is not None:
            _form_params.append(('ocr_engine', ocr_engine))
        if ocr_lang is not None:
            _form_params.append(('ocr_lang', ocr_lang))
        if ocr_preset is not None:
            _form_params.append(('ocr_preset', ocr_preset))
        if ocr_custom_config is not None:
            _form_params.append(('ocr_custom_config', ocr_custom_config))
        if pdf_backend is not None:
            _form_params.append(('pdf_backend', pdf_backend))
        if table_mode is not None:
            _form_params.append(('table_mode', table_mode))
        if table_cell_matching is not None:
            _form_params.append(('table_cell_matching', table_cell_matching))
        if pipeline is not None:
            _form_params.append(('pipeline', pipeline))
        if page_range is not None:
            _form_params.append(('page_range', page_range))
        if document_timeout is not None:
            _form_params.append(('document_timeout', document_timeout))
        if abort_on_error is not None:
            _form_params.append(('abort_on_error', abort_on_error))
        if do_table_structure is not None:
            _form_params.append(('do_table_structure', do_table_structure))
        if include_images is not None:
            _form_params.append(('include_images', include_images))
        if images_scale is not None:
            _form_params.append(('images_scale', images_scale))
        if md_page_break_placeholder is not None:
            _form_params.append(('md_page_break_placeholder', md_page_break_placeholder))
        if do_code_enrichment is not None:
            _form_params.append(('do_code_enrichment', do_code_enrichment))
        if do_formula_enrichment is not None:
            _form_params.append(('do_formula_enrichment', do_formula_enrichment))
        if do_picture_classification is not None:
            _form_params.append(('do_picture_classification', do_picture_classification))
        if do_chart_extraction is not None:
            _form_params.append(('do_chart_extraction', do_chart_extraction))
        if do_picture_description is not None:
            _form_params.append(('do_picture_description', do_picture_description))
        if picture_description_area_threshold is not None:
            _form_params.append(('picture_description_area_threshold', picture_description_area_threshold))
        if picture_description_local is not None:
            _form_params.append(('picture_description_local', picture_description_local))
        if picture_description_api is not None:
            _form_params.append(('picture_description_api', picture_description_api))
        if vlm_pipeline_model is not None:
            _form_params.append(('vlm_pipeline_model', vlm_pipeline_model))
        if vlm_pipeline_model_local is not None:
            _form_params.append(('vlm_pipeline_model_local', vlm_pipeline_model_local))
        if vlm_pipeline_model_api is not None:
            _form_params.append(('vlm_pipeline_model_api', vlm_pipeline_model_api))
        if vlm_pipeline_preset is not None:
            _form_params.append(('vlm_pipeline_preset', vlm_pipeline_preset))
        if picture_description_preset is not None:
            _form_params.append(('picture_description_preset', picture_description_preset))
        if code_formula_preset is not None:
            _form_params.append(('code_formula_preset', code_formula_preset))
        if vlm_pipeline_custom_config is not None:
            _form_params.append(('vlm_pipeline_custom_config', vlm_pipeline_custom_config))
        if picture_description_custom_config is not None:
            _form_params.append(('picture_description_custom_config', picture_description_custom_config))
        if code_formula_custom_config is not None:
            _form_params.append(('code_formula_custom_config', code_formula_custom_config))
        if table_structure_preset is not None:
            _form_params.append(('table_structure_preset', table_structure_preset))
        if table_structure_custom_config is not None:
            _form_params.append(('table_structure_custom_config', table_structure_custom_config))
        if layout_custom_config is not None:
            _form_params.append(('layout_custom_config', layout_custom_config))
        if layout_preset is not None:
            _form_params.append(('layout_preset', layout_preset))
        if picture_classification_preset is not None:
            _form_params.append(('picture_classification_preset', picture_classification_preset))
        if picture_classification_custom_config is not None:
            _form_params.append(('picture_classification_custom_config', picture_classification_custom_config))
        if provider is not None:
            _form_params.append(('provider', provider))
        if chunk is not None:
            _form_params.append(('chunk', chunk))
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json', 
                    'application/zip'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'multipart/form-data'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'APIKeyAuth'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path='/v1/convert/file',
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    async def post_convert_file_async(
        self,
        files: List[StrictStr],
        target_type: Optional[Any] = None,
        from_formats: Annotated[Optional[List[InputFormat]], Field(description="Input format(s) to convert from. String or list of strings. Allowed values: docx, pptx, html, image, pdf, asciidoc, md, csv, xlsx, xml_uspto, xml_jats, xml_xbrl, mets_gbs, json_docling, audio, vtt, latex. Optional, defaults to all formats.")] = None,
        to_formats: Annotated[Optional[List[OutputFormat]], Field(description="Output format(s) to convert to. String or list of strings. Allowed values: md, json, yaml, html, html_split_page, text, doctags, vtt. Optional, defaults to Markdown.")] = None,
        image_export_mode: Annotated[Optional[Any], Field(description="Image export mode for the document (in case of JSON, Markdown or HTML). Allowed values: placeholder, embedded, referenced. Optional, defaults to Embedded.")] = None,
        do_ocr: Annotated[Optional[StrictBool], Field(description="If enabled, the bitmap content will be processed using OCR. Boolean. Optional, defaults to true")] = None,
        force_ocr: Annotated[Optional[StrictBool], Field(description="If enabled, replace existing text with OCR-generated text over content. Boolean. Optional, defaults to false.")] = None,
        ocr_engine: Annotated[Optional[Any], Field(description="The OCR engine to use. String. Allowed values: auto, easyocr, kserve_v2_ocr, ocrmac, rapidocr, tesserocr, tesseract. Optional, defaults to easyocr.")] = None,
        ocr_lang: Optional[List[StrictStr]] = None,
        ocr_preset: Annotated[Optional[StrictStr], Field(description="Preset ID for OCR engine.")] = None,
        ocr_custom_config: Optional[Dict[str, Any]] = None,
        pdf_backend: Annotated[Optional[Any], Field(description="The PDF backend to use. String. Allowed values: pypdfium2, docling_parse, dlparse_v1, dlparse_v2, dlparse_v4. Optional, defaults to pypdfium2.")] = None,
        table_mode: Annotated[Optional[Any], Field(description="Mode to use for table structure, String. Allowed values: fast, accurate. Optional, defaults to accurate.")] = None,
        table_cell_matching: Annotated[Optional[StrictBool], Field(description="If true, matches table cells predictions back to PDF cells. Can break table output if PDF cells are merged across table columns. If false, let table structure model define the text cells, ignore PDF cells.")] = None,
        pipeline: Annotated[Optional[Any], Field(description="Choose the pipeline to process PDF or image files.")] = None,
        page_range: Annotated[Optional[Annotated[List[Any], Field(min_length=2, max_length=2)]], Field(description="Only convert a range of pages. The page number starts at 1.")] = None,
        document_timeout: Annotated[Optional[Union[StrictFloat, StrictInt]], Field(description="The timeout for processing each document, in seconds.")] = None,
        abort_on_error: Annotated[Optional[StrictBool], Field(description="Abort on error if enabled. Boolean. Optional, defaults to false.")] = None,
        do_table_structure: Annotated[Optional[StrictBool], Field(description="If enabled, the table structure will be extracted. Boolean. Optional, defaults to true.")] = None,
        include_images: Annotated[Optional[StrictBool], Field(description="If enabled, images will be extracted from the document. Boolean. Optional, defaults to true.")] = None,
        images_scale: Annotated[Optional[Union[StrictFloat, StrictInt]], Field(description="Scale factor for images. Float. Optional, defaults to 2.0.")] = None,
        md_page_break_placeholder: Annotated[Optional[StrictStr], Field(description="Add this placeholder between pages in the markdown output.")] = None,
        do_code_enrichment: Annotated[Optional[StrictBool], Field(description="If enabled, perform OCR code enrichment. Boolean. Optional, defaults to false.")] = None,
        do_formula_enrichment: Annotated[Optional[StrictBool], Field(description="If enabled, perform formula OCR, return LaTeX code. Boolean. Optional, defaults to false.")] = None,
        do_picture_classification: Annotated[Optional[StrictBool], Field(description="If enabled, classify pictures in documents. Boolean. Optional, defaults to false.")] = None,
        do_chart_extraction: Annotated[Optional[StrictBool], Field(description="If enabled, extract numeric data from charts. Boolean. Optional, defaults to false.")] = None,
        do_picture_description: Annotated[Optional[StrictBool], Field(description="If enabled, describe pictures in documents. Boolean. Optional, defaults to false.")] = None,
        picture_description_area_threshold: Annotated[Optional[Union[StrictFloat, StrictInt]], Field(description="Minimum percentage of the area for a picture to be processed with the models.")] = None,
        picture_description_local: Annotated[Optional[StrictStr], Field(description="DEPRECATED: Options for running a local vision-language model in the picture description. The parameters refer to a model hosted on Hugging Face. This parameter is mutually exclusive with picture_description_api. Please migrate to picture_description_preset or picture_description_custom_config.")] = None,
        picture_description_api: Annotated[Optional[StrictStr], Field(description="DEPRECATED: API details for using a vision-language model in the picture description. This parameter is mutually exclusive with picture_description_local. Please migrate to picture_description_preset or picture_description_custom_config.")] = None,
        vlm_pipeline_model: Optional[Any] = None,
        vlm_pipeline_model_local: Annotated[Optional[StrictStr], Field(description="DEPRECATED: Options for running a local vision-language model for the vlm pipeline. The parameters refer to a model hosted on Hugging Face. This parameter is mutually exclusive with vlm_pipeline_model_api and vlm_pipeline_model. Please migrate to vlm_pipeline_preset or vlm_pipeline_custom_config.")] = None,
        vlm_pipeline_model_api: Annotated[Optional[StrictStr], Field(description="DEPRECATED: API details for using a vision-language model for the vlm pipeline. This parameter is mutually exclusive with vlm_pipeline_model_local and vlm_pipeline_model. Please migrate to vlm_pipeline_preset or vlm_pipeline_custom_config.")] = None,
        vlm_pipeline_preset: Optional[StrictStr] = None,
        picture_description_preset: Optional[StrictStr] = None,
        code_formula_preset: Optional[StrictStr] = None,
        vlm_pipeline_custom_config: Annotated[Optional[StrictStr], Field(description="Custom VLM configuration including model spec and engine options. Only available if admin allows it. Must include 'model_spec' and 'engine_options'.")] = None,
        picture_description_custom_config: Annotated[Optional[StrictStr], Field(description="Custom picture description configuration including model spec and engine options.")] = None,
        code_formula_custom_config: Annotated[Optional[StrictStr], Field(description="Custom code/formula extraction configuration including model spec and engine options.")] = None,
        table_structure_preset: Optional[StrictStr] = None,
        table_structure_custom_config: Optional[Dict[str, Any]] = None,
        layout_custom_config: Optional[Dict[str, Any]] = None,
        layout_preset: Optional[StrictStr] = None,
        picture_classification_preset: Optional[StrictStr] = None,
        picture_classification_custom_config: Optional[Dict[str, Any]] = None,
        provider: Annotated[Optional[Any], Field(description="Execution provider to use.")] = None,
        chunk: Annotated[Optional[StrictBool], Field(description="If true, the convert endpoint returns chunked output instead of plain document output.")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> TaskStatusResponse:
        """Process File Async


        :param files: (required)
        :type files: List[str]
        :param target_type:
        :type target_type: TargetName
        :param from_formats: Input format(s) to convert from. String or list of strings. Allowed values: docx, pptx, html, image, pdf, asciidoc, md, csv, xlsx, xml_uspto, xml_jats, xml_xbrl, mets_gbs, json_docling, audio, vtt, latex. Optional, defaults to all formats.
        :type from_formats: List[InputFormat]
        :param to_formats: Output format(s) to convert to. String or list of strings. Allowed values: md, json, yaml, html, html_split_page, text, doctags, vtt. Optional, defaults to Markdown.
        :type to_formats: List[OutputFormat]
        :param image_export_mode: Image export mode for the document (in case of JSON, Markdown or HTML). Allowed values: placeholder, embedded, referenced. Optional, defaults to Embedded.
        :type image_export_mode: ImageRefMode
        :param do_ocr: If enabled, the bitmap content will be processed using OCR. Boolean. Optional, defaults to true
        :type do_ocr: bool
        :param force_ocr: If enabled, replace existing text with OCR-generated text over content. Boolean. Optional, defaults to false.
        :type force_ocr: bool
        :param ocr_engine: The OCR engine to use. String. Allowed values: auto, easyocr, kserve_v2_ocr, ocrmac, rapidocr, tesserocr, tesseract. Optional, defaults to easyocr.
        :type ocr_engine: OcrEnginesEnum
        :param ocr_lang:
        :type ocr_lang: List[str]
        :param ocr_preset: Preset ID for OCR engine.
        :type ocr_preset: str
        :param ocr_custom_config:
        :type ocr_custom_config: Dict[str, object]
        :param pdf_backend: The PDF backend to use. String. Allowed values: pypdfium2, docling_parse, dlparse_v1, dlparse_v2, dlparse_v4. Optional, defaults to pypdfium2.
        :type pdf_backend: PdfBackend
        :param table_mode: Mode to use for table structure, String. Allowed values: fast, accurate. Optional, defaults to accurate.
        :type table_mode: TableFormerMode
        :param table_cell_matching: If true, matches table cells predictions back to PDF cells. Can break table output if PDF cells are merged across table columns. If false, let table structure model define the text cells, ignore PDF cells.
        :type table_cell_matching: bool
        :param pipeline: Choose the pipeline to process PDF or image files.
        :type pipeline: ProcessingPipeline
        :param page_range: Only convert a range of pages. The page number starts at 1.
        :type page_range: List[object]
        :param document_timeout: The timeout for processing each document, in seconds.
        :type document_timeout: float
        :param abort_on_error: Abort on error if enabled. Boolean. Optional, defaults to false.
        :type abort_on_error: bool
        :param do_table_structure: If enabled, the table structure will be extracted. Boolean. Optional, defaults to true.
        :type do_table_structure: bool
        :param include_images: If enabled, images will be extracted from the document. Boolean. Optional, defaults to true.
        :type include_images: bool
        :param images_scale: Scale factor for images. Float. Optional, defaults to 2.0.
        :type images_scale: float
        :param md_page_break_placeholder: Add this placeholder between pages in the markdown output.
        :type md_page_break_placeholder: str
        :param do_code_enrichment: If enabled, perform OCR code enrichment. Boolean. Optional, defaults to false.
        :type do_code_enrichment: bool
        :param do_formula_enrichment: If enabled, perform formula OCR, return LaTeX code. Boolean. Optional, defaults to false.
        :type do_formula_enrichment: bool
        :param do_picture_classification: If enabled, classify pictures in documents. Boolean. Optional, defaults to false.
        :type do_picture_classification: bool
        :param do_chart_extraction: If enabled, extract numeric data from charts. Boolean. Optional, defaults to false.
        :type do_chart_extraction: bool
        :param do_picture_description: If enabled, describe pictures in documents. Boolean. Optional, defaults to false.
        :type do_picture_description: bool
        :param picture_description_area_threshold: Minimum percentage of the area for a picture to be processed with the models.
        :type picture_description_area_threshold: float
        :param picture_description_local: DEPRECATED: Options for running a local vision-language model in the picture description. The parameters refer to a model hosted on Hugging Face. This parameter is mutually exclusive with picture_description_api. Please migrate to picture_description_preset or picture_description_custom_config.
        :type picture_description_local: str
        :param picture_description_api: DEPRECATED: API details for using a vision-language model in the picture description. This parameter is mutually exclusive with picture_description_local. Please migrate to picture_description_preset or picture_description_custom_config.
        :type picture_description_api: str
        :param vlm_pipeline_model:
        :type vlm_pipeline_model: VlmModelType
        :param vlm_pipeline_model_local: DEPRECATED: Options for running a local vision-language model for the vlm pipeline. The parameters refer to a model hosted on Hugging Face. This parameter is mutually exclusive with vlm_pipeline_model_api and vlm_pipeline_model. Please migrate to vlm_pipeline_preset or vlm_pipeline_custom_config.
        :type vlm_pipeline_model_local: str
        :param vlm_pipeline_model_api: DEPRECATED: API details for using a vision-language model for the vlm pipeline. This parameter is mutually exclusive with vlm_pipeline_model_local and vlm_pipeline_model. Please migrate to vlm_pipeline_preset or vlm_pipeline_custom_config.
        :type vlm_pipeline_model_api: str
        :param vlm_pipeline_preset:
        :type vlm_pipeline_preset: str
        :param picture_description_preset:
        :type picture_description_preset: str
        :param code_formula_preset:
        :type code_formula_preset: str
        :param vlm_pipeline_custom_config: Custom VLM configuration including model spec and engine options. Only available if admin allows it. Must include 'model_spec' and 'engine_options'.
        :type vlm_pipeline_custom_config: str
        :param picture_description_custom_config: Custom picture description configuration including model spec and engine options.
        :type picture_description_custom_config: str
        :param code_formula_custom_config: Custom code/formula extraction configuration including model spec and engine options.
        :type code_formula_custom_config: str
        :param table_structure_preset:
        :type table_structure_preset: str
        :param table_structure_custom_config:
        :type table_structure_custom_config: Dict[str, object]
        :param layout_custom_config:
        :type layout_custom_config: Dict[str, object]
        :param layout_preset:
        :type layout_preset: str
        :param picture_classification_preset:
        :type picture_classification_preset: str
        :param picture_classification_custom_config:
        :type picture_classification_custom_config: Dict[str, object]
        :param provider: Execution provider to use.
        :type provider: ProviderKind
        :param chunk: If true, the convert endpoint returns chunked output instead of plain document output.
        :type chunk: bool
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._post_convert_file_async_serialize(
            files=files,
            target_type=target_type,
            from_formats=from_formats,
            to_formats=to_formats,
            image_export_mode=image_export_mode,
            do_ocr=do_ocr,
            force_ocr=force_ocr,
            ocr_engine=ocr_engine,
            ocr_lang=ocr_lang,
            ocr_preset=ocr_preset,
            ocr_custom_config=ocr_custom_config,
            pdf_backend=pdf_backend,
            table_mode=table_mode,
            table_cell_matching=table_cell_matching,
            pipeline=pipeline,
            page_range=page_range,
            document_timeout=document_timeout,
            abort_on_error=abort_on_error,
            do_table_structure=do_table_structure,
            include_images=include_images,
            images_scale=images_scale,
            md_page_break_placeholder=md_page_break_placeholder,
            do_code_enrichment=do_code_enrichment,
            do_formula_enrichment=do_formula_enrichment,
            do_picture_classification=do_picture_classification,
            do_chart_extraction=do_chart_extraction,
            do_picture_description=do_picture_description,
            picture_description_area_threshold=picture_description_area_threshold,
            picture_description_local=picture_description_local,
            picture_description_api=picture_description_api,
            vlm_pipeline_model=vlm_pipeline_model,
            vlm_pipeline_model_local=vlm_pipeline_model_local,
            vlm_pipeline_model_api=vlm_pipeline_model_api,
            vlm_pipeline_preset=vlm_pipeline_preset,
            picture_description_preset=picture_description_preset,
            code_formula_preset=code_formula_preset,
            vlm_pipeline_custom_config=vlm_pipeline_custom_config,
            picture_description_custom_config=picture_description_custom_config,
            code_formula_custom_config=code_formula_custom_config,
            table_structure_preset=table_structure_preset,
            table_structure_custom_config=table_structure_custom_config,
            layout_custom_config=layout_custom_config,
            layout_preset=layout_preset,
            picture_classification_preset=picture_classification_preset,
            picture_classification_custom_config=picture_classification_custom_config,
            provider=provider,
            chunk=chunk,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "TaskStatusResponse",
            '422': "HTTPValidationError",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def post_convert_file_async_with_http_info(
        self,
        files: List[StrictStr],
        target_type: Optional[Any] = None,
        from_formats: Annotated[Optional[List[InputFormat]], Field(description="Input format(s) to convert from. String or list of strings. Allowed values: docx, pptx, html, image, pdf, asciidoc, md, csv, xlsx, xml_uspto, xml_jats, xml_xbrl, mets_gbs, json_docling, audio, vtt, latex. Optional, defaults to all formats.")] = None,
        to_formats: Annotated[Optional[List[OutputFormat]], Field(description="Output format(s) to convert to. String or list of strings. Allowed values: md, json, yaml, html, html_split_page, text, doctags, vtt. Optional, defaults to Markdown.")] = None,
        image_export_mode: Annotated[Optional[Any], Field(description="Image export mode for the document (in case of JSON, Markdown or HTML). Allowed values: placeholder, embedded, referenced. Optional, defaults to Embedded.")] = None,
        do_ocr: Annotated[Optional[StrictBool], Field(description="If enabled, the bitmap content will be processed using OCR. Boolean. Optional, defaults to true")] = None,
        force_ocr: Annotated[Optional[StrictBool], Field(description="If enabled, replace existing text with OCR-generated text over content. Boolean. Optional, defaults to false.")] = None,
        ocr_engine: Annotated[Optional[Any], Field(description="The OCR engine to use. String. Allowed values: auto, easyocr, kserve_v2_ocr, ocrmac, rapidocr, tesserocr, tesseract. Optional, defaults to easyocr.")] = None,
        ocr_lang: Optional[List[StrictStr]] = None,
        ocr_preset: Annotated[Optional[StrictStr], Field(description="Preset ID for OCR engine.")] = None,
        ocr_custom_config: Optional[Dict[str, Any]] = None,
        pdf_backend: Annotated[Optional[Any], Field(description="The PDF backend to use. String. Allowed values: pypdfium2, docling_parse, dlparse_v1, dlparse_v2, dlparse_v4. Optional, defaults to pypdfium2.")] = None,
        table_mode: Annotated[Optional[Any], Field(description="Mode to use for table structure, String. Allowed values: fast, accurate. Optional, defaults to accurate.")] = None,
        table_cell_matching: Annotated[Optional[StrictBool], Field(description="If true, matches table cells predictions back to PDF cells. Can break table output if PDF cells are merged across table columns. If false, let table structure model define the text cells, ignore PDF cells.")] = None,
        pipeline: Annotated[Optional[Any], Field(description="Choose the pipeline to process PDF or image files.")] = None,
        page_range: Annotated[Optional[Annotated[List[Any], Field(min_length=2, max_length=2)]], Field(description="Only convert a range of pages. The page number starts at 1.")] = None,
        document_timeout: Annotated[Optional[Union[StrictFloat, StrictInt]], Field(description="The timeout for processing each document, in seconds.")] = None,
        abort_on_error: Annotated[Optional[StrictBool], Field(description="Abort on error if enabled. Boolean. Optional, defaults to false.")] = None,
        do_table_structure: Annotated[Optional[StrictBool], Field(description="If enabled, the table structure will be extracted. Boolean. Optional, defaults to true.")] = None,
        include_images: Annotated[Optional[StrictBool], Field(description="If enabled, images will be extracted from the document. Boolean. Optional, defaults to true.")] = None,
        images_scale: Annotated[Optional[Union[StrictFloat, StrictInt]], Field(description="Scale factor for images. Float. Optional, defaults to 2.0.")] = None,
        md_page_break_placeholder: Annotated[Optional[StrictStr], Field(description="Add this placeholder between pages in the markdown output.")] = None,
        do_code_enrichment: Annotated[Optional[StrictBool], Field(description="If enabled, perform OCR code enrichment. Boolean. Optional, defaults to false.")] = None,
        do_formula_enrichment: Annotated[Optional[StrictBool], Field(description="If enabled, perform formula OCR, return LaTeX code. Boolean. Optional, defaults to false.")] = None,
        do_picture_classification: Annotated[Optional[StrictBool], Field(description="If enabled, classify pictures in documents. Boolean. Optional, defaults to false.")] = None,
        do_chart_extraction: Annotated[Optional[StrictBool], Field(description="If enabled, extract numeric data from charts. Boolean. Optional, defaults to false.")] = None,
        do_picture_description: Annotated[Optional[StrictBool], Field(description="If enabled, describe pictures in documents. Boolean. Optional, defaults to false.")] = None,
        picture_description_area_threshold: Annotated[Optional[Union[StrictFloat, StrictInt]], Field(description="Minimum percentage of the area for a picture to be processed with the models.")] = None,
        picture_description_local: Annotated[Optional[StrictStr], Field(description="DEPRECATED: Options for running a local vision-language model in the picture description. The parameters refer to a model hosted on Hugging Face. This parameter is mutually exclusive with picture_description_api. Please migrate to picture_description_preset or picture_description_custom_config.")] = None,
        picture_description_api: Annotated[Optional[StrictStr], Field(description="DEPRECATED: API details for using a vision-language model in the picture description. This parameter is mutually exclusive with picture_description_local. Please migrate to picture_description_preset or picture_description_custom_config.")] = None,
        vlm_pipeline_model: Optional[Any] = None,
        vlm_pipeline_model_local: Annotated[Optional[StrictStr], Field(description="DEPRECATED: Options for running a local vision-language model for the vlm pipeline. The parameters refer to a model hosted on Hugging Face. This parameter is mutually exclusive with vlm_pipeline_model_api and vlm_pipeline_model. Please migrate to vlm_pipeline_preset or vlm_pipeline_custom_config.")] = None,
        vlm_pipeline_model_api: Annotated[Optional[StrictStr], Field(description="DEPRECATED: API details for using a vision-language model for the vlm pipeline. This parameter is mutually exclusive with vlm_pipeline_model_local and vlm_pipeline_model. Please migrate to vlm_pipeline_preset or vlm_pipeline_custom_config.")] = None,
        vlm_pipeline_preset: Optional[StrictStr] = None,
        picture_description_preset: Optional[StrictStr] = None,
        code_formula_preset: Optional[StrictStr] = None,
        vlm_pipeline_custom_config: Annotated[Optional[StrictStr], Field(description="Custom VLM configuration including model spec and engine options. Only available if admin allows it. Must include 'model_spec' and 'engine_options'.")] = None,
        picture_description_custom_config: Annotated[Optional[StrictStr], Field(description="Custom picture description configuration including model spec and engine options.")] = None,
        code_formula_custom_config: Annotated[Optional[StrictStr], Field(description="Custom code/formula extraction configuration including model spec and engine options.")] = None,
        table_structure_preset: Optional[StrictStr] = None,
        table_structure_custom_config: Optional[Dict[str, Any]] = None,
        layout_custom_config: Optional[Dict[str, Any]] = None,
        layout_preset: Optional[StrictStr] = None,
        picture_classification_preset: Optional[StrictStr] = None,
        picture_classification_custom_config: Optional[Dict[str, Any]] = None,
        provider: Annotated[Optional[Any], Field(description="Execution provider to use.")] = None,
        chunk: Annotated[Optional[StrictBool], Field(description="If true, the convert endpoint returns chunked output instead of plain document output.")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[TaskStatusResponse]:
        """Process File Async


        :param files: (required)
        :type files: List[str]
        :param target_type:
        :type target_type: TargetName
        :param from_formats: Input format(s) to convert from. String or list of strings. Allowed values: docx, pptx, html, image, pdf, asciidoc, md, csv, xlsx, xml_uspto, xml_jats, xml_xbrl, mets_gbs, json_docling, audio, vtt, latex. Optional, defaults to all formats.
        :type from_formats: List[InputFormat]
        :param to_formats: Output format(s) to convert to. String or list of strings. Allowed values: md, json, yaml, html, html_split_page, text, doctags, vtt. Optional, defaults to Markdown.
        :type to_formats: List[OutputFormat]
        :param image_export_mode: Image export mode for the document (in case of JSON, Markdown or HTML). Allowed values: placeholder, embedded, referenced. Optional, defaults to Embedded.
        :type image_export_mode: ImageRefMode
        :param do_ocr: If enabled, the bitmap content will be processed using OCR. Boolean. Optional, defaults to true
        :type do_ocr: bool
        :param force_ocr: If enabled, replace existing text with OCR-generated text over content. Boolean. Optional, defaults to false.
        :type force_ocr: bool
        :param ocr_engine: The OCR engine to use. String. Allowed values: auto, easyocr, kserve_v2_ocr, ocrmac, rapidocr, tesserocr, tesseract. Optional, defaults to easyocr.
        :type ocr_engine: OcrEnginesEnum
        :param ocr_lang:
        :type ocr_lang: List[str]
        :param ocr_preset: Preset ID for OCR engine.
        :type ocr_preset: str
        :param ocr_custom_config:
        :type ocr_custom_config: Dict[str, object]
        :param pdf_backend: The PDF backend to use. String. Allowed values: pypdfium2, docling_parse, dlparse_v1, dlparse_v2, dlparse_v4. Optional, defaults to pypdfium2.
        :type pdf_backend: PdfBackend
        :param table_mode: Mode to use for table structure, String. Allowed values: fast, accurate. Optional, defaults to accurate.
        :type table_mode: TableFormerMode
        :param table_cell_matching: If true, matches table cells predictions back to PDF cells. Can break table output if PDF cells are merged across table columns. If false, let table structure model define the text cells, ignore PDF cells.
        :type table_cell_matching: bool
        :param pipeline: Choose the pipeline to process PDF or image files.
        :type pipeline: ProcessingPipeline
        :param page_range: Only convert a range of pages. The page number starts at 1.
        :type page_range: List[object]
        :param document_timeout: The timeout for processing each document, in seconds.
        :type document_timeout: float
        :param abort_on_error: Abort on error if enabled. Boolean. Optional, defaults to false.
        :type abort_on_error: bool
        :param do_table_structure: If enabled, the table structure will be extracted. Boolean. Optional, defaults to true.
        :type do_table_structure: bool
        :param include_images: If enabled, images will be extracted from the document. Boolean. Optional, defaults to true.
        :type include_images: bool
        :param images_scale: Scale factor for images. Float. Optional, defaults to 2.0.
        :type images_scale: float
        :param md_page_break_placeholder: Add this placeholder between pages in the markdown output.
        :type md_page_break_placeholder: str
        :param do_code_enrichment: If enabled, perform OCR code enrichment. Boolean. Optional, defaults to false.
        :type do_code_enrichment: bool
        :param do_formula_enrichment: If enabled, perform formula OCR, return LaTeX code. Boolean. Optional, defaults to false.
        :type do_formula_enrichment: bool
        :param do_picture_classification: If enabled, classify pictures in documents. Boolean. Optional, defaults to false.
        :type do_picture_classification: bool
        :param do_chart_extraction: If enabled, extract numeric data from charts. Boolean. Optional, defaults to false.
        :type do_chart_extraction: bool
        :param do_picture_description: If enabled, describe pictures in documents. Boolean. Optional, defaults to false.
        :type do_picture_description: bool
        :param picture_description_area_threshold: Minimum percentage of the area for a picture to be processed with the models.
        :type picture_description_area_threshold: float
        :param picture_description_local: DEPRECATED: Options for running a local vision-language model in the picture description. The parameters refer to a model hosted on Hugging Face. This parameter is mutually exclusive with picture_description_api. Please migrate to picture_description_preset or picture_description_custom_config.
        :type picture_description_local: str
        :param picture_description_api: DEPRECATED: API details for using a vision-language model in the picture description. This parameter is mutually exclusive with picture_description_local. Please migrate to picture_description_preset or picture_description_custom_config.
        :type picture_description_api: str
        :param vlm_pipeline_model:
        :type vlm_pipeline_model: VlmModelType
        :param vlm_pipeline_model_local: DEPRECATED: Options for running a local vision-language model for the vlm pipeline. The parameters refer to a model hosted on Hugging Face. This parameter is mutually exclusive with vlm_pipeline_model_api and vlm_pipeline_model. Please migrate to vlm_pipeline_preset or vlm_pipeline_custom_config.
        :type vlm_pipeline_model_local: str
        :param vlm_pipeline_model_api: DEPRECATED: API details for using a vision-language model for the vlm pipeline. This parameter is mutually exclusive with vlm_pipeline_model_local and vlm_pipeline_model. Please migrate to vlm_pipeline_preset or vlm_pipeline_custom_config.
        :type vlm_pipeline_model_api: str
        :param vlm_pipeline_preset:
        :type vlm_pipeline_preset: str
        :param picture_description_preset:
        :type picture_description_preset: str
        :param code_formula_preset:
        :type code_formula_preset: str
        :param vlm_pipeline_custom_config: Custom VLM configuration including model spec and engine options. Only available if admin allows it. Must include 'model_spec' and 'engine_options'.
        :type vlm_pipeline_custom_config: str
        :param picture_description_custom_config: Custom picture description configuration including model spec and engine options.
        :type picture_description_custom_config: str
        :param code_formula_custom_config: Custom code/formula extraction configuration including model spec and engine options.
        :type code_formula_custom_config: str
        :param table_structure_preset:
        :type table_structure_preset: str
        :param table_structure_custom_config:
        :type table_structure_custom_config: Dict[str, object]
        :param layout_custom_config:
        :type layout_custom_config: Dict[str, object]
        :param layout_preset:
        :type layout_preset: str
        :param picture_classification_preset:
        :type picture_classification_preset: str
        :param picture_classification_custom_config:
        :type picture_classification_custom_config: Dict[str, object]
        :param provider: Execution provider to use.
        :type provider: ProviderKind
        :param chunk: If true, the convert endpoint returns chunked output instead of plain document output.
        :type chunk: bool
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._post_convert_file_async_serialize(
            files=files,
            target_type=target_type,
            from_formats=from_formats,
            to_formats=to_formats,
            image_export_mode=image_export_mode,
            do_ocr=do_ocr,
            force_ocr=force_ocr,
            ocr_engine=ocr_engine,
            ocr_lang=ocr_lang,
            ocr_preset=ocr_preset,
            ocr_custom_config=ocr_custom_config,
            pdf_backend=pdf_backend,
            table_mode=table_mode,
            table_cell_matching=table_cell_matching,
            pipeline=pipeline,
            page_range=page_range,
            document_timeout=document_timeout,
            abort_on_error=abort_on_error,
            do_table_structure=do_table_structure,
            include_images=include_images,
            images_scale=images_scale,
            md_page_break_placeholder=md_page_break_placeholder,
            do_code_enrichment=do_code_enrichment,
            do_formula_enrichment=do_formula_enrichment,
            do_picture_classification=do_picture_classification,
            do_chart_extraction=do_chart_extraction,
            do_picture_description=do_picture_description,
            picture_description_area_threshold=picture_description_area_threshold,
            picture_description_local=picture_description_local,
            picture_description_api=picture_description_api,
            vlm_pipeline_model=vlm_pipeline_model,
            vlm_pipeline_model_local=vlm_pipeline_model_local,
            vlm_pipeline_model_api=vlm_pipeline_model_api,
            vlm_pipeline_preset=vlm_pipeline_preset,
            picture_description_preset=picture_description_preset,
            code_formula_preset=code_formula_preset,
            vlm_pipeline_custom_config=vlm_pipeline_custom_config,
            picture_description_custom_config=picture_description_custom_config,
            code_formula_custom_config=code_formula_custom_config,
            table_structure_preset=table_structure_preset,
            table_structure_custom_config=table_structure_custom_config,
            layout_custom_config=layout_custom_config,
            layout_preset=layout_preset,
            picture_classification_preset=picture_classification_preset,
            picture_classification_custom_config=picture_classification_custom_config,
            provider=provider,
            chunk=chunk,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "TaskStatusResponse",
            '422': "HTTPValidationError",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def post_convert_file_async_without_preload_content(
        self,
        files: List[StrictStr],
        target_type: Optional[Any] = None,
        from_formats: Annotated[Optional[List[InputFormat]], Field(description="Input format(s) to convert from. String or list of strings. Allowed values: docx, pptx, html, image, pdf, asciidoc, md, csv, xlsx, xml_uspto, xml_jats, xml_xbrl, mets_gbs, json_docling, audio, vtt, latex. Optional, defaults to all formats.")] = None,
        to_formats: Annotated[Optional[List[OutputFormat]], Field(description="Output format(s) to convert to. String or list of strings. Allowed values: md, json, yaml, html, html_split_page, text, doctags, vtt. Optional, defaults to Markdown.")] = None,
        image_export_mode: Annotated[Optional[Any], Field(description="Image export mode for the document (in case of JSON, Markdown or HTML). Allowed values: placeholder, embedded, referenced. Optional, defaults to Embedded.")] = None,
        do_ocr: Annotated[Optional[StrictBool], Field(description="If enabled, the bitmap content will be processed using OCR. Boolean. Optional, defaults to true")] = None,
        force_ocr: Annotated[Optional[StrictBool], Field(description="If enabled, replace existing text with OCR-generated text over content. Boolean. Optional, defaults to false.")] = None,
        ocr_engine: Annotated[Optional[Any], Field(description="The OCR engine to use. String. Allowed values: auto, easyocr, kserve_v2_ocr, ocrmac, rapidocr, tesserocr, tesseract. Optional, defaults to easyocr.")] = None,
        ocr_lang: Optional[List[StrictStr]] = None,
        ocr_preset: Annotated[Optional[StrictStr], Field(description="Preset ID for OCR engine.")] = None,
        ocr_custom_config: Optional[Dict[str, Any]] = None,
        pdf_backend: Annotated[Optional[Any], Field(description="The PDF backend to use. String. Allowed values: pypdfium2, docling_parse, dlparse_v1, dlparse_v2, dlparse_v4. Optional, defaults to pypdfium2.")] = None,
        table_mode: Annotated[Optional[Any], Field(description="Mode to use for table structure, String. Allowed values: fast, accurate. Optional, defaults to accurate.")] = None,
        table_cell_matching: Annotated[Optional[StrictBool], Field(description="If true, matches table cells predictions back to PDF cells. Can break table output if PDF cells are merged across table columns. If false, let table structure model define the text cells, ignore PDF cells.")] = None,
        pipeline: Annotated[Optional[Any], Field(description="Choose the pipeline to process PDF or image files.")] = None,
        page_range: Annotated[Optional[Annotated[List[Any], Field(min_length=2, max_length=2)]], Field(description="Only convert a range of pages. The page number starts at 1.")] = None,
        document_timeout: Annotated[Optional[Union[StrictFloat, StrictInt]], Field(description="The timeout for processing each document, in seconds.")] = None,
        abort_on_error: Annotated[Optional[StrictBool], Field(description="Abort on error if enabled. Boolean. Optional, defaults to false.")] = None,
        do_table_structure: Annotated[Optional[StrictBool], Field(description="If enabled, the table structure will be extracted. Boolean. Optional, defaults to true.")] = None,
        include_images: Annotated[Optional[StrictBool], Field(description="If enabled, images will be extracted from the document. Boolean. Optional, defaults to true.")] = None,
        images_scale: Annotated[Optional[Union[StrictFloat, StrictInt]], Field(description="Scale factor for images. Float. Optional, defaults to 2.0.")] = None,
        md_page_break_placeholder: Annotated[Optional[StrictStr], Field(description="Add this placeholder between pages in the markdown output.")] = None,
        do_code_enrichment: Annotated[Optional[StrictBool], Field(description="If enabled, perform OCR code enrichment. Boolean. Optional, defaults to false.")] = None,
        do_formula_enrichment: Annotated[Optional[StrictBool], Field(description="If enabled, perform formula OCR, return LaTeX code. Boolean. Optional, defaults to false.")] = None,
        do_picture_classification: Annotated[Optional[StrictBool], Field(description="If enabled, classify pictures in documents. Boolean. Optional, defaults to false.")] = None,
        do_chart_extraction: Annotated[Optional[StrictBool], Field(description="If enabled, extract numeric data from charts. Boolean. Optional, defaults to false.")] = None,
        do_picture_description: Annotated[Optional[StrictBool], Field(description="If enabled, describe pictures in documents. Boolean. Optional, defaults to false.")] = None,
        picture_description_area_threshold: Annotated[Optional[Union[StrictFloat, StrictInt]], Field(description="Minimum percentage of the area for a picture to be processed with the models.")] = None,
        picture_description_local: Annotated[Optional[StrictStr], Field(description="DEPRECATED: Options for running a local vision-language model in the picture description. The parameters refer to a model hosted on Hugging Face. This parameter is mutually exclusive with picture_description_api. Please migrate to picture_description_preset or picture_description_custom_config.")] = None,
        picture_description_api: Annotated[Optional[StrictStr], Field(description="DEPRECATED: API details for using a vision-language model in the picture description. This parameter is mutually exclusive with picture_description_local. Please migrate to picture_description_preset or picture_description_custom_config.")] = None,
        vlm_pipeline_model: Optional[Any] = None,
        vlm_pipeline_model_local: Annotated[Optional[StrictStr], Field(description="DEPRECATED: Options for running a local vision-language model for the vlm pipeline. The parameters refer to a model hosted on Hugging Face. This parameter is mutually exclusive with vlm_pipeline_model_api and vlm_pipeline_model. Please migrate to vlm_pipeline_preset or vlm_pipeline_custom_config.")] = None,
        vlm_pipeline_model_api: Annotated[Optional[StrictStr], Field(description="DEPRECATED: API details for using a vision-language model for the vlm pipeline. This parameter is mutually exclusive with vlm_pipeline_model_local and vlm_pipeline_model. Please migrate to vlm_pipeline_preset or vlm_pipeline_custom_config.")] = None,
        vlm_pipeline_preset: Optional[StrictStr] = None,
        picture_description_preset: Optional[StrictStr] = None,
        code_formula_preset: Optional[StrictStr] = None,
        vlm_pipeline_custom_config: Annotated[Optional[StrictStr], Field(description="Custom VLM configuration including model spec and engine options. Only available if admin allows it. Must include 'model_spec' and 'engine_options'.")] = None,
        picture_description_custom_config: Annotated[Optional[StrictStr], Field(description="Custom picture description configuration including model spec and engine options.")] = None,
        code_formula_custom_config: Annotated[Optional[StrictStr], Field(description="Custom code/formula extraction configuration including model spec and engine options.")] = None,
        table_structure_preset: Optional[StrictStr] = None,
        table_structure_custom_config: Optional[Dict[str, Any]] = None,
        layout_custom_config: Optional[Dict[str, Any]] = None,
        layout_preset: Optional[StrictStr] = None,
        picture_classification_preset: Optional[StrictStr] = None,
        picture_classification_custom_config: Optional[Dict[str, Any]] = None,
        provider: Annotated[Optional[Any], Field(description="Execution provider to use.")] = None,
        chunk: Annotated[Optional[StrictBool], Field(description="If true, the convert endpoint returns chunked output instead of plain document output.")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Process File Async


        :param files: (required)
        :type files: List[str]
        :param target_type:
        :type target_type: TargetName
        :param from_formats: Input format(s) to convert from. String or list of strings. Allowed values: docx, pptx, html, image, pdf, asciidoc, md, csv, xlsx, xml_uspto, xml_jats, xml_xbrl, mets_gbs, json_docling, audio, vtt, latex. Optional, defaults to all formats.
        :type from_formats: List[InputFormat]
        :param to_formats: Output format(s) to convert to. String or list of strings. Allowed values: md, json, yaml, html, html_split_page, text, doctags, vtt. Optional, defaults to Markdown.
        :type to_formats: List[OutputFormat]
        :param image_export_mode: Image export mode for the document (in case of JSON, Markdown or HTML). Allowed values: placeholder, embedded, referenced. Optional, defaults to Embedded.
        :type image_export_mode: ImageRefMode
        :param do_ocr: If enabled, the bitmap content will be processed using OCR. Boolean. Optional, defaults to true
        :type do_ocr: bool
        :param force_ocr: If enabled, replace existing text with OCR-generated text over content. Boolean. Optional, defaults to false.
        :type force_ocr: bool
        :param ocr_engine: The OCR engine to use. String. Allowed values: auto, easyocr, kserve_v2_ocr, ocrmac, rapidocr, tesserocr, tesseract. Optional, defaults to easyocr.
        :type ocr_engine: OcrEnginesEnum
        :param ocr_lang:
        :type ocr_lang: List[str]
        :param ocr_preset: Preset ID for OCR engine.
        :type ocr_preset: str
        :param ocr_custom_config:
        :type ocr_custom_config: Dict[str, object]
        :param pdf_backend: The PDF backend to use. String. Allowed values: pypdfium2, docling_parse, dlparse_v1, dlparse_v2, dlparse_v4. Optional, defaults to pypdfium2.
        :type pdf_backend: PdfBackend
        :param table_mode: Mode to use for table structure, String. Allowed values: fast, accurate. Optional, defaults to accurate.
        :type table_mode: TableFormerMode
        :param table_cell_matching: If true, matches table cells predictions back to PDF cells. Can break table output if PDF cells are merged across table columns. If false, let table structure model define the text cells, ignore PDF cells.
        :type table_cell_matching: bool
        :param pipeline: Choose the pipeline to process PDF or image files.
        :type pipeline: ProcessingPipeline
        :param page_range: Only convert a range of pages. The page number starts at 1.
        :type page_range: List[object]
        :param document_timeout: The timeout for processing each document, in seconds.
        :type document_timeout: float
        :param abort_on_error: Abort on error if enabled. Boolean. Optional, defaults to false.
        :type abort_on_error: bool
        :param do_table_structure: If enabled, the table structure will be extracted. Boolean. Optional, defaults to true.
        :type do_table_structure: bool
        :param include_images: If enabled, images will be extracted from the document. Boolean. Optional, defaults to true.
        :type include_images: bool
        :param images_scale: Scale factor for images. Float. Optional, defaults to 2.0.
        :type images_scale: float
        :param md_page_break_placeholder: Add this placeholder between pages in the markdown output.
        :type md_page_break_placeholder: str
        :param do_code_enrichment: If enabled, perform OCR code enrichment. Boolean. Optional, defaults to false.
        :type do_code_enrichment: bool
        :param do_formula_enrichment: If enabled, perform formula OCR, return LaTeX code. Boolean. Optional, defaults to false.
        :type do_formula_enrichment: bool
        :param do_picture_classification: If enabled, classify pictures in documents. Boolean. Optional, defaults to false.
        :type do_picture_classification: bool
        :param do_chart_extraction: If enabled, extract numeric data from charts. Boolean. Optional, defaults to false.
        :type do_chart_extraction: bool
        :param do_picture_description: If enabled, describe pictures in documents. Boolean. Optional, defaults to false.
        :type do_picture_description: bool
        :param picture_description_area_threshold: Minimum percentage of the area for a picture to be processed with the models.
        :type picture_description_area_threshold: float
        :param picture_description_local: DEPRECATED: Options for running a local vision-language model in the picture description. The parameters refer to a model hosted on Hugging Face. This parameter is mutually exclusive with picture_description_api. Please migrate to picture_description_preset or picture_description_custom_config.
        :type picture_description_local: str
        :param picture_description_api: DEPRECATED: API details for using a vision-language model in the picture description. This parameter is mutually exclusive with picture_description_local. Please migrate to picture_description_preset or picture_description_custom_config.
        :type picture_description_api: str
        :param vlm_pipeline_model:
        :type vlm_pipeline_model: VlmModelType
        :param vlm_pipeline_model_local: DEPRECATED: Options for running a local vision-language model for the vlm pipeline. The parameters refer to a model hosted on Hugging Face. This parameter is mutually exclusive with vlm_pipeline_model_api and vlm_pipeline_model. Please migrate to vlm_pipeline_preset or vlm_pipeline_custom_config.
        :type vlm_pipeline_model_local: str
        :param vlm_pipeline_model_api: DEPRECATED: API details for using a vision-language model for the vlm pipeline. This parameter is mutually exclusive with vlm_pipeline_model_local and vlm_pipeline_model. Please migrate to vlm_pipeline_preset or vlm_pipeline_custom_config.
        :type vlm_pipeline_model_api: str
        :param vlm_pipeline_preset:
        :type vlm_pipeline_preset: str
        :param picture_description_preset:
        :type picture_description_preset: str
        :param code_formula_preset:
        :type code_formula_preset: str
        :param vlm_pipeline_custom_config: Custom VLM configuration including model spec and engine options. Only available if admin allows it. Must include 'model_spec' and 'engine_options'.
        :type vlm_pipeline_custom_config: str
        :param picture_description_custom_config: Custom picture description configuration including model spec and engine options.
        :type picture_description_custom_config: str
        :param code_formula_custom_config: Custom code/formula extraction configuration including model spec and engine options.
        :type code_formula_custom_config: str
        :param table_structure_preset:
        :type table_structure_preset: str
        :param table_structure_custom_config:
        :type table_structure_custom_config: Dict[str, object]
        :param layout_custom_config:
        :type layout_custom_config: Dict[str, object]
        :param layout_preset:
        :type layout_preset: str
        :param picture_classification_preset:
        :type picture_classification_preset: str
        :param picture_classification_custom_config:
        :type picture_classification_custom_config: Dict[str, object]
        :param provider: Execution provider to use.
        :type provider: ProviderKind
        :param chunk: If true, the convert endpoint returns chunked output instead of plain document output.
        :type chunk: bool
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._post_convert_file_async_serialize(
            files=files,
            target_type=target_type,
            from_formats=from_formats,
            to_formats=to_formats,
            image_export_mode=image_export_mode,
            do_ocr=do_ocr,
            force_ocr=force_ocr,
            ocr_engine=ocr_engine,
            ocr_lang=ocr_lang,
            ocr_preset=ocr_preset,
            ocr_custom_config=ocr_custom_config,
            pdf_backend=pdf_backend,
            table_mode=table_mode,
            table_cell_matching=table_cell_matching,
            pipeline=pipeline,
            page_range=page_range,
            document_timeout=document_timeout,
            abort_on_error=abort_on_error,
            do_table_structure=do_table_structure,
            include_images=include_images,
            images_scale=images_scale,
            md_page_break_placeholder=md_page_break_placeholder,
            do_code_enrichment=do_code_enrichment,
            do_formula_enrichment=do_formula_enrichment,
            do_picture_classification=do_picture_classification,
            do_chart_extraction=do_chart_extraction,
            do_picture_description=do_picture_description,
            picture_description_area_threshold=picture_description_area_threshold,
            picture_description_local=picture_description_local,
            picture_description_api=picture_description_api,
            vlm_pipeline_model=vlm_pipeline_model,
            vlm_pipeline_model_local=vlm_pipeline_model_local,
            vlm_pipeline_model_api=vlm_pipeline_model_api,
            vlm_pipeline_preset=vlm_pipeline_preset,
            picture_description_preset=picture_description_preset,
            code_formula_preset=code_formula_preset,
            vlm_pipeline_custom_config=vlm_pipeline_custom_config,
            picture_description_custom_config=picture_description_custom_config,
            code_formula_custom_config=code_formula_custom_config,
            table_structure_preset=table_structure_preset,
            table_structure_custom_config=table_structure_custom_config,
            layout_custom_config=layout_custom_config,
            layout_preset=layout_preset,
            picture_classification_preset=picture_classification_preset,
            picture_classification_custom_config=picture_classification_custom_config,
            provider=provider,
            chunk=chunk,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "TaskStatusResponse",
            '422': "HTTPValidationError",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _post_convert_file_async_serialize(
        self,
        files,
        target_type,
        from_formats,
        to_formats,
        image_export_mode,
        do_ocr,
        force_ocr,
        ocr_engine,
        ocr_lang,
        ocr_preset,
        ocr_custom_config,
        pdf_backend,
        table_mode,
        table_cell_matching,
        pipeline,
        page_range,
        document_timeout,
        abort_on_error,
        do_table_structure,
        include_images,
        images_scale,
        md_page_break_placeholder,
        do_code_enrichment,
        do_formula_enrichment,
        do_picture_classification,
        do_chart_extraction,
        do_picture_description,
        picture_description_area_threshold,
        picture_description_local,
        picture_description_api,
        vlm_pipeline_model,
        vlm_pipeline_model_local,
        vlm_pipeline_model_api,
        vlm_pipeline_preset,
        picture_description_preset,
        code_formula_preset,
        vlm_pipeline_custom_config,
        picture_description_custom_config,
        code_formula_custom_config,
        table_structure_preset,
        table_structure_custom_config,
        layout_custom_config,
        layout_preset,
        picture_classification_preset,
        picture_classification_custom_config,
        provider,
        chunk,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
            'files': 'csv',
            'from_formats': 'csv',
            'to_formats': 'csv',
            'ocr_lang': 'csv',
            'page_range': 'csv',
        }

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        # process the header parameters
        # process the form parameters
        if files is not None:
            _form_params.append(('files', files))
        if target_type is not None:
            _form_params.append(('target_type', target_type))
        if from_formats is not None:
            _form_params.append(('from_formats', from_formats))
        if to_formats is not None:
            _form_params.append(('to_formats', to_formats))
        if image_export_mode is not None:
            _form_params.append(('image_export_mode', image_export_mode))
        if do_ocr is not None:
            _form_params.append(('do_ocr', do_ocr))
        if force_ocr is not None:
            _form_params.append(('force_ocr', force_ocr))
        if ocr_engine is not None:
            _form_params.append(('ocr_engine', ocr_engine))
        if ocr_lang is not None:
            _form_params.append(('ocr_lang', ocr_lang))
        if ocr_preset is not None:
            _form_params.append(('ocr_preset', ocr_preset))
        if ocr_custom_config is not None:
            _form_params.append(('ocr_custom_config', ocr_custom_config))
        if pdf_backend is not None:
            _form_params.append(('pdf_backend', pdf_backend))
        if table_mode is not None:
            _form_params.append(('table_mode', table_mode))
        if table_cell_matching is not None:
            _form_params.append(('table_cell_matching', table_cell_matching))
        if pipeline is not None:
            _form_params.append(('pipeline', pipeline))
        if page_range is not None:
            _form_params.append(('page_range', page_range))
        if document_timeout is not None:
            _form_params.append(('document_timeout', document_timeout))
        if abort_on_error is not None:
            _form_params.append(('abort_on_error', abort_on_error))
        if do_table_structure is not None:
            _form_params.append(('do_table_structure', do_table_structure))
        if include_images is not None:
            _form_params.append(('include_images', include_images))
        if images_scale is not None:
            _form_params.append(('images_scale', images_scale))
        if md_page_break_placeholder is not None:
            _form_params.append(('md_page_break_placeholder', md_page_break_placeholder))
        if do_code_enrichment is not None:
            _form_params.append(('do_code_enrichment', do_code_enrichment))
        if do_formula_enrichment is not None:
            _form_params.append(('do_formula_enrichment', do_formula_enrichment))
        if do_picture_classification is not None:
            _form_params.append(('do_picture_classification', do_picture_classification))
        if do_chart_extraction is not None:
            _form_params.append(('do_chart_extraction', do_chart_extraction))
        if do_picture_description is not None:
            _form_params.append(('do_picture_description', do_picture_description))
        if picture_description_area_threshold is not None:
            _form_params.append(('picture_description_area_threshold', picture_description_area_threshold))
        if picture_description_local is not None:
            _form_params.append(('picture_description_local', picture_description_local))
        if picture_description_api is not None:
            _form_params.append(('picture_description_api', picture_description_api))
        if vlm_pipeline_model is not None:
            _form_params.append(('vlm_pipeline_model', vlm_pipeline_model))
        if vlm_pipeline_model_local is not None:
            _form_params.append(('vlm_pipeline_model_local', vlm_pipeline_model_local))
        if vlm_pipeline_model_api is not None:
            _form_params.append(('vlm_pipeline_model_api', vlm_pipeline_model_api))
        if vlm_pipeline_preset is not None:
            _form_params.append(('vlm_pipeline_preset', vlm_pipeline_preset))
        if picture_description_preset is not None:
            _form_params.append(('picture_description_preset', picture_description_preset))
        if code_formula_preset is not None:
            _form_params.append(('code_formula_preset', code_formula_preset))
        if vlm_pipeline_custom_config is not None:
            _form_params.append(('vlm_pipeline_custom_config', vlm_pipeline_custom_config))
        if picture_description_custom_config is not None:
            _form_params.append(('picture_description_custom_config', picture_description_custom_config))
        if code_formula_custom_config is not None:
            _form_params.append(('code_formula_custom_config', code_formula_custom_config))
        if table_structure_preset is not None:
            _form_params.append(('table_structure_preset', table_structure_preset))
        if table_structure_custom_config is not None:
            _form_params.append(('table_structure_custom_config', table_structure_custom_config))
        if layout_custom_config is not None:
            _form_params.append(('layout_custom_config', layout_custom_config))
        if layout_preset is not None:
            _form_params.append(('layout_preset', layout_preset))
        if picture_classification_preset is not None:
            _form_params.append(('picture_classification_preset', picture_classification_preset))
        if picture_classification_custom_config is not None:
            _form_params.append(('picture_classification_custom_config', picture_classification_custom_config))
        if provider is not None:
            _form_params.append(('provider', provider))
        if chunk is not None:
            _form_params.append(('chunk', chunk))
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'multipart/form-data'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'APIKeyAuth'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path='/v1/convert/file/async',
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    async def post_convert_source(
        self,
        convert_documents_request: ConvertDocumentsRequest,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ResponseProcessUrlV1ConvertSourcePost:
        """Process Url


        :param convert_documents_request: (required)
        :type convert_documents_request: ConvertDocumentsRequest
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._post_convert_source_serialize(
            convert_documents_request=convert_documents_request,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ResponseProcessUrlV1ConvertSourcePost",
            '422': "HTTPValidationError",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def post_convert_source_with_http_info(
        self,
        convert_documents_request: ConvertDocumentsRequest,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[ResponseProcessUrlV1ConvertSourcePost]:
        """Process Url


        :param convert_documents_request: (required)
        :type convert_documents_request: ConvertDocumentsRequest
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._post_convert_source_serialize(
            convert_documents_request=convert_documents_request,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ResponseProcessUrlV1ConvertSourcePost",
            '422': "HTTPValidationError",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def post_convert_source_without_preload_content(
        self,
        convert_documents_request: ConvertDocumentsRequest,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Process Url


        :param convert_documents_request: (required)
        :type convert_documents_request: ConvertDocumentsRequest
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._post_convert_source_serialize(
            convert_documents_request=convert_documents_request,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ResponseProcessUrlV1ConvertSourcePost",
            '422': "HTTPValidationError",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _post_convert_source_serialize(
        self,
        convert_documents_request,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        # process the header parameters
        # process the form parameters
        # process the body parameter
        if convert_documents_request is not None:
            _body_params = convert_documents_request


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json', 
                    'application/zip'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/json'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'APIKeyAuth'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path='/v1/convert/source',
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    async def post_convert_source_async(
        self,
        convert_documents_request: ConvertDocumentsRequest,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> TaskStatusResponse:
        """Process Url Async


        :param convert_documents_request: (required)
        :type convert_documents_request: ConvertDocumentsRequest
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._post_convert_source_async_serialize(
            convert_documents_request=convert_documents_request,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "TaskStatusResponse",
            '422': "HTTPValidationError",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def post_convert_source_async_with_http_info(
        self,
        convert_documents_request: ConvertDocumentsRequest,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[TaskStatusResponse]:
        """Process Url Async


        :param convert_documents_request: (required)
        :type convert_documents_request: ConvertDocumentsRequest
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._post_convert_source_async_serialize(
            convert_documents_request=convert_documents_request,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "TaskStatusResponse",
            '422': "HTTPValidationError",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def post_convert_source_async_without_preload_content(
        self,
        convert_documents_request: ConvertDocumentsRequest,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Process Url Async


        :param convert_documents_request: (required)
        :type convert_documents_request: ConvertDocumentsRequest
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._post_convert_source_async_serialize(
            convert_documents_request=convert_documents_request,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "TaskStatusResponse",
            '422': "HTTPValidationError",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _post_convert_source_async_serialize(
        self,
        convert_documents_request,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        # process the header parameters
        # process the form parameters
        # process the body parameter
        if convert_documents_request is not None:
            _body_params = convert_documents_request


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/json'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'APIKeyAuth'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path='/v1/convert/source/async',
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )


