@docling/docling-client 2.130.0 → 2.132.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/PYTHON_CLIENT_PARITY.md +14 -7
- package/dist/index.cjs +65 -20
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +55 -7
- package/dist/index.d.ts +55 -7
- package/dist/index.js +65 -20
- package/dist/index.js.map +1 -1
- package/package.json +4 -4
package/dist/index.d.cts
CHANGED
|
@@ -12,13 +12,13 @@ interface DoclingDocument {
|
|
|
12
12
|
name: string;
|
|
13
13
|
[key: string]: unknown;
|
|
14
14
|
}
|
|
15
|
-
type InputFormat = 'docx' | 'doc' | 'pptx' | 'html' | 'image' | 'pdf' | 'asciidoc' | 'md' | 'csv' | 'xlsx' | '
|
|
16
|
-
type OutputFormat = 'md' | 'json' | 'yaml' | 'html' | 'html_split_page' | 'text' | 'doctags' | 'vtt' | 'doclang' | 'dclx' | 'chunks';
|
|
17
|
-
type ProcessingPipeline = 'legacy' | 'standard' | 'vlm' | 'asr';
|
|
15
|
+
type InputFormat = 'docx' | 'doc' | 'rtf' | 'pptx' | 'ppt' | 'html' | 'mhtml' | 'image' | 'pdf' | 'asciidoc' | 'md' | 'csv' | 'xlsx' | 'xls' | 'odt' | 'ods' | 'odp' | 'xml_uspto' | 'xml_jats' | 'xml_xbrl' | 'xml_doclang' | 'dclx' | 'mets_gbs' | 'json_docling' | 'audio' | 'video' | 'vtt' | 'latex' | 'email' | 'epub' | 'boxnote' | 'iwork_pages' | 'iwork_keynote' | 'ebcdic' | 'afp';
|
|
16
|
+
type OutputFormat = 'md' | 'json' | 'yaml' | 'html' | 'html_split_page' | 'text' | 'doctags' | 'vtt' | 'doclang' | 'dclx' | 'chunks' | 'latex';
|
|
17
|
+
type ProcessingPipeline = 'legacy' | 'standard' | 'native' | 'vlm' | 'asr';
|
|
18
18
|
type TableMode = 'fast' | 'accurate';
|
|
19
19
|
type ImageExportMode = 'placeholder' | 'embedded' | 'referenced';
|
|
20
|
-
type PdfBackend = 'pypdfium2' | 'docling_parse' | 'threaded_docling_parse' | 'dlparse_v1' | 'dlparse_v2' | 'dlparse_v4';
|
|
21
|
-
type VlmResponseFormat = 'doctags' | 'doclang' | 'markdown' | 'deepseekocr_markdown' | 'html' | 'otsl' | 'plaintext' | 'chandra_html' | 'dots_json';
|
|
20
|
+
type PdfBackend = 'pypdfium2' | 'docling_parse' | 'threaded_docling_parse' | '_docling_parse' | 'dlparse_v1' | 'dlparse_v2' | 'dlparse_v4';
|
|
21
|
+
type VlmResponseFormat = 'doctags' | 'doclang' | 'markdown' | 'deepseekocr_markdown' | 'unlimited_ocr_markdown' | 'html' | 'otsl' | 'plaintext' | 'chandra_html' | 'dots_json' | 'nemotron_parse_v2' | 'mineru2';
|
|
22
22
|
type VlmInferenceFramework = 'mlx' | 'transformers' | 'vllm';
|
|
23
23
|
type TransformersModelType = 'automodel' | 'automodel-causallm' | 'automodel-imagetexttotext';
|
|
24
24
|
type LegacyVlmModelType = 'smoldocling' | 'smoldocling_vllm' | 'granite_vision' | 'granite_vision_vllm' | 'granite_vision_ollama' | 'got_ocr_2' | 'granite_docling' | 'granite_docling_vllm' | 'nanonets_ocr2' | 'nanonets_ocr2_vllm' | 'nanonets_ocr2_lmstudio' | 'glm_ocr' | 'glm_ocr_vllm' | 'lightonocr' | 'lightonocr_vllm' | 'deepseekocr_ollama';
|
|
@@ -67,6 +67,22 @@ interface VlmModelApi {
|
|
|
67
67
|
response_format: VlmResponseFormat;
|
|
68
68
|
temperature?: number;
|
|
69
69
|
}
|
|
70
|
+
/**
|
|
71
|
+
* Fine-tuning options for PDF heading-hierarchy inference, applied when
|
|
72
|
+
* `do_pdf_heading_hierarchy` is enabled.
|
|
73
|
+
*
|
|
74
|
+
* Mirrors Python's `HeadingHierarchyOptions`.
|
|
75
|
+
*/
|
|
76
|
+
interface HeadingHierarchyOptions {
|
|
77
|
+
/** Use PDF bookmarks/table-of-contents for heading levels. Default: true. */
|
|
78
|
+
use_bookmarks?: boolean;
|
|
79
|
+
/** Use outline numbering (e.g. "1.2.3 Title") for heading levels. Default: true. */
|
|
80
|
+
use_outline_levels?: boolean;
|
|
81
|
+
/** Use font-style differences for heading levels. Default: true. */
|
|
82
|
+
use_style?: boolean;
|
|
83
|
+
/** Maximum inferred heading depth. Default: 6. */
|
|
84
|
+
max_level?: number;
|
|
85
|
+
}
|
|
70
86
|
/**
|
|
71
87
|
* Common Docling Serve conversion controls.
|
|
72
88
|
*
|
|
@@ -90,6 +106,14 @@ interface ConvertDocumentsOptions {
|
|
|
90
106
|
table_mode?: TableMode;
|
|
91
107
|
table_cell_matching?: boolean;
|
|
92
108
|
do_table_structure?: boolean;
|
|
109
|
+
/**
|
|
110
|
+
* If enabled, section-header levels are inferred for PDF and image inputs
|
|
111
|
+
* processed by the standard pipeline. When disabled every heading stays at
|
|
112
|
+
* level 1 (flat hierarchy). Default: false.
|
|
113
|
+
*/
|
|
114
|
+
do_pdf_heading_hierarchy?: boolean;
|
|
115
|
+
/** Fine-tuning of the heading-level inference. Applied when do_pdf_heading_hierarchy is enabled. */
|
|
116
|
+
pdf_heading_hierarchy_options?: HeadingHierarchyOptions;
|
|
93
117
|
image_export_mode?: ImageExportMode;
|
|
94
118
|
images_scale?: number;
|
|
95
119
|
include_images?: boolean;
|
|
@@ -100,6 +124,16 @@ interface ConvertDocumentsOptions {
|
|
|
100
124
|
do_picture_classification?: boolean;
|
|
101
125
|
do_picture_description?: boolean;
|
|
102
126
|
do_chart_extraction?: boolean;
|
|
127
|
+
/**
|
|
128
|
+
* Preset ID for chart extraction (e.g. "default", "granite_vision_v4", "granite_vision").
|
|
129
|
+
* Mutually exclusive with chart_extraction_custom_config.
|
|
130
|
+
*/
|
|
131
|
+
chart_extraction_preset?: string | null;
|
|
132
|
+
/**
|
|
133
|
+
* Custom chart extraction configuration. Accepts a ChartExtractionVlmEngineOptions-equivalent
|
|
134
|
+
* dict. Only available when the admin allows it. Mutually exclusive with chart_extraction_preset.
|
|
135
|
+
*/
|
|
136
|
+
chart_extraction_custom_config?: Record<string, unknown> | null;
|
|
103
137
|
picture_description_area_threshold?: number;
|
|
104
138
|
/** @deprecated Prefer picture_description_preset or picture_description_custom_config. */
|
|
105
139
|
picture_description_local?: PictureDescriptionLocal | null;
|
|
@@ -127,6 +161,20 @@ interface ConvertDocumentsOptions {
|
|
|
127
161
|
md_compact_tables?: boolean;
|
|
128
162
|
abort_on_error?: boolean;
|
|
129
163
|
document_timeout?: number | null;
|
|
164
|
+
/**
|
|
165
|
+
* Inline chunker configuration. Mutually exclusive with chunking_preset.
|
|
166
|
+
* Discriminated by a `chunker` field: "hybrid" | "hierarchical".
|
|
167
|
+
*/
|
|
168
|
+
chunking_options?: (HybridChunkingOptions & {
|
|
169
|
+
chunker: 'hybrid';
|
|
170
|
+
}) | (HierarchicalChunkingOptions & {
|
|
171
|
+
chunker: 'hierarchical';
|
|
172
|
+
}) | null;
|
|
173
|
+
/**
|
|
174
|
+
* Preset ID for chunking (e.g. "granite_embedding_278m", "minilm_l6", "hierarchical").
|
|
175
|
+
* Mutually exclusive with chunking_options.
|
|
176
|
+
*/
|
|
177
|
+
chunking_preset?: string | null;
|
|
130
178
|
}
|
|
131
179
|
interface HttpSource {
|
|
132
180
|
kind: 'http';
|
|
@@ -538,7 +586,7 @@ interface FetchTransportOptions {
|
|
|
538
586
|
}
|
|
539
587
|
declare class FetchTransport implements DoclingTransport {
|
|
540
588
|
#private;
|
|
541
|
-
constructor(optionsOrFetch?: FetchTransportOptions | FetchLike
|
|
589
|
+
constructor(optionsOrFetch?: FetchTransportOptions | FetchLike);
|
|
542
590
|
request<T>(request: DoclingTransportRequest): Promise<T>;
|
|
543
591
|
}
|
|
544
592
|
|
|
@@ -866,4 +914,4 @@ declare function preflightFileSize(source: NormalizedSource, maxFileSize: number
|
|
|
866
914
|
declare function appendFormValue(form: FormData, key: string, value: unknown): void;
|
|
867
915
|
declare function fileSourceFromBinary(source: BinaryFileSource, signal?: AbortSignal): Promise<FileSource>;
|
|
868
916
|
|
|
869
|
-
export { type ArtifactAddressResolver, ArtifactDownloader, type ArtifactDownloaderOptions, type ArtifactRef, type ArtifactType, type AutoSubmitResult, type AzureBlobCoordinates, type AzureBlobSource, type AzureBlobTarget, type BaseChunkingOptions, type BatchConvertSourcesRequest, type BatchResultForTarget, type BatchSource, type BatchSubmitCallOptions, type BatchTarget, type BinaryFileSource, type CallbackSpec, type ChunkCallOptions, type ChunkDocumentResponse, type ChunkSourceOptions, type ChunkSourcesRequest, type ChunkedDocumentResultItem, type ChunkerKind, type ConfidenceScores, type ConversionInput, type ConversionItem, type ConversionResult, type ConversionSource, type ConversionSourceInput, type ConversionStatus, type ConvertAllOptions, type ConvertDocumentResponse, type ConvertDocumentsOptions, type ConvertOptions, type ConvertSourcesRequest, DEFAULT_MAX_CONCURRENCY, DoclingArtifactDownloadError, DoclingBatchConversionError, type DoclingBinaryResponse, DoclingClient, type DoclingClientOptions, type DoclingComponentType, DoclingConversionError, type DoclingDocument, DoclingError, DoclingHttpError, DoclingJob, DoclingProtocolError, type DoclingRequestBodyType, DoclingResponseSchemaMismatchError, type DoclingResponseType, DoclingResultExpiredError, DoclingResultNotReadyError, DoclingServiceError, DoclingServiceUnavailableError, DoclingTaskError, DoclingTaskNotFoundError, DoclingTimeoutError, type DoclingTransport, type DoclingTransportRequest, DoclingUsageLimitExceededError, type DocumentArtifactItem, type DocumentLimits, type ErrorItem, type ExportDocumentResponse, type ExportResult, type FailureCategory, type FetchLike, FetchTransport, type FetchTransportOptions, type FileSource, type GenericSource, type GenericTarget, type GoogleCloudStorageCoordinates, type GoogleCloudStorageServiceAccountInfo, type GoogleCloudStorageSource, type GoogleCloudStorageTarget, type GoogleDriveCoordinates, type GoogleDriveCredentials, type GoogleDriveSource, type GoogleDriveTarget, type HealthCheckResponse, type HierarchicalChunkSourcesRequest, type HierarchicalChunkingOptions, type HttpSource, type HybridChunkSourcesRequest, type HybridChunkingOptions, type ImageExportMode, type InBodyConversionResponse, type InBodyTarget, type InputFormat, type LegacyVlmModelType, MAX_CONCURRENCY_LIMIT, type NormalizedJsonSource, type NormalizedMultipartSource, type NormalizedSource, type OutcomeCounts, type OutputFormat, type PdfBackend, type PictureClassificationLabel, type PictureDescriptionApi, type PictureDescriptionLocal, type PresignedUrlConvertDocumentResponse, type PresignedUrlConvertResponse, type PresignedUrlTarget, type ProcessingPipeline, type ProfilingItem, type ProfilingScope, type PublicFailureInfo, type PutTarget, type QualityGrade, type RawServiceResult, type RemoteTargetResponse, type S3Coordinates, type S3Source, type S3Target, type StatusWatcherKind, type StorageTarget, type SubmitAndRetrieveOptions, type SubmitCallOptions, type SubmitResultForTarget, type SubmitSourceOptions, type SubmitTarget, type TableMode, type TaskFailureResult, type TaskProcessingMeta, type TaskStatus, type TaskStatusResponse, type TaskType, type TransformersModelType, type VlmInferenceFramework, type VlmModelApi, type VlmModelLocal, type VlmResponseFormat, type WaitForTaskOptions, type WatchTaskOptions, type WebSocketFactory, type WebSocketFactoryOptions, type WebSocketLike, type ZipTarget, appendFormValue, applyPageLimits, documentFromBundle, documentFromJson, fileSourceFromBinary, materializePresignedResult, normalizeSourceInput, preflightFileSize, resolveConvertOptions, selectDocumentArtifact, validateConvertOptions, validateMaxFileSize, watchTask, withJsonOutput };
|
|
917
|
+
export { type ArtifactAddressResolver, ArtifactDownloader, type ArtifactDownloaderOptions, type ArtifactRef, type ArtifactType, type AutoSubmitResult, type AzureBlobCoordinates, type AzureBlobSource, type AzureBlobTarget, type BaseChunkingOptions, type BatchConvertSourcesRequest, type BatchResultForTarget, type BatchSource, type BatchSubmitCallOptions, type BatchTarget, type BinaryFileSource, type CallbackSpec, type ChunkCallOptions, type ChunkDocumentResponse, type ChunkSourceOptions, type ChunkSourcesRequest, type ChunkedDocumentResultItem, type ChunkerKind, type ConfidenceScores, type ConversionInput, type ConversionItem, type ConversionResult, type ConversionSource, type ConversionSourceInput, type ConversionStatus, type ConvertAllOptions, type ConvertDocumentResponse, type ConvertDocumentsOptions, type ConvertOptions, type ConvertSourcesRequest, DEFAULT_MAX_CONCURRENCY, DoclingArtifactDownloadError, DoclingBatchConversionError, type DoclingBinaryResponse, DoclingClient, type DoclingClientOptions, type DoclingComponentType, DoclingConversionError, type DoclingDocument, DoclingError, DoclingHttpError, DoclingJob, DoclingProtocolError, type DoclingRequestBodyType, DoclingResponseSchemaMismatchError, type DoclingResponseType, DoclingResultExpiredError, DoclingResultNotReadyError, DoclingServiceError, DoclingServiceUnavailableError, DoclingTaskError, DoclingTaskNotFoundError, DoclingTimeoutError, type DoclingTransport, type DoclingTransportRequest, DoclingUsageLimitExceededError, type DocumentArtifactItem, type DocumentLimits, type ErrorItem, type ExportDocumentResponse, type ExportResult, type FailureCategory, type FetchLike, FetchTransport, type FetchTransportOptions, type FileSource, type GenericSource, type GenericTarget, type GoogleCloudStorageCoordinates, type GoogleCloudStorageServiceAccountInfo, type GoogleCloudStorageSource, type GoogleCloudStorageTarget, type GoogleDriveCoordinates, type GoogleDriveCredentials, type GoogleDriveSource, type GoogleDriveTarget, type HeadingHierarchyOptions, type HealthCheckResponse, type HierarchicalChunkSourcesRequest, type HierarchicalChunkingOptions, type HttpSource, type HybridChunkSourcesRequest, type HybridChunkingOptions, type ImageExportMode, type InBodyConversionResponse, type InBodyTarget, type InputFormat, type LegacyVlmModelType, MAX_CONCURRENCY_LIMIT, type NormalizedJsonSource, type NormalizedMultipartSource, type NormalizedSource, type OutcomeCounts, type OutputFormat, type PdfBackend, type PictureClassificationLabel, type PictureDescriptionApi, type PictureDescriptionLocal, type PresignedUrlConvertDocumentResponse, type PresignedUrlConvertResponse, type PresignedUrlTarget, type ProcessingPipeline, type ProfilingItem, type ProfilingScope, type PublicFailureInfo, type PutTarget, type QualityGrade, type RawServiceResult, type RemoteTargetResponse, type S3Coordinates, type S3Source, type S3Target, type StatusWatcherKind, type StorageTarget, type SubmitAndRetrieveOptions, type SubmitCallOptions, type SubmitResultForTarget, type SubmitSourceOptions, type SubmitTarget, type TableMode, type TaskFailureResult, type TaskProcessingMeta, type TaskStatus, type TaskStatusResponse, type TaskType, type TransformersModelType, type VlmInferenceFramework, type VlmModelApi, type VlmModelLocal, type VlmResponseFormat, type WaitForTaskOptions, type WatchTaskOptions, type WebSocketFactory, type WebSocketFactoryOptions, type WebSocketLike, type ZipTarget, appendFormValue, applyPageLimits, documentFromBundle, documentFromJson, fileSourceFromBinary, materializePresignedResult, normalizeSourceInput, preflightFileSize, resolveConvertOptions, selectDocumentArtifact, validateConvertOptions, validateMaxFileSize, watchTask, withJsonOutput };
|
package/dist/index.d.ts
CHANGED
|
@@ -12,13 +12,13 @@ interface DoclingDocument {
|
|
|
12
12
|
name: string;
|
|
13
13
|
[key: string]: unknown;
|
|
14
14
|
}
|
|
15
|
-
type InputFormat = 'docx' | 'doc' | 'pptx' | 'html' | 'image' | 'pdf' | 'asciidoc' | 'md' | 'csv' | 'xlsx' | '
|
|
16
|
-
type OutputFormat = 'md' | 'json' | 'yaml' | 'html' | 'html_split_page' | 'text' | 'doctags' | 'vtt' | 'doclang' | 'dclx' | 'chunks';
|
|
17
|
-
type ProcessingPipeline = 'legacy' | 'standard' | 'vlm' | 'asr';
|
|
15
|
+
type InputFormat = 'docx' | 'doc' | 'rtf' | 'pptx' | 'ppt' | 'html' | 'mhtml' | 'image' | 'pdf' | 'asciidoc' | 'md' | 'csv' | 'xlsx' | 'xls' | 'odt' | 'ods' | 'odp' | 'xml_uspto' | 'xml_jats' | 'xml_xbrl' | 'xml_doclang' | 'dclx' | 'mets_gbs' | 'json_docling' | 'audio' | 'video' | 'vtt' | 'latex' | 'email' | 'epub' | 'boxnote' | 'iwork_pages' | 'iwork_keynote' | 'ebcdic' | 'afp';
|
|
16
|
+
type OutputFormat = 'md' | 'json' | 'yaml' | 'html' | 'html_split_page' | 'text' | 'doctags' | 'vtt' | 'doclang' | 'dclx' | 'chunks' | 'latex';
|
|
17
|
+
type ProcessingPipeline = 'legacy' | 'standard' | 'native' | 'vlm' | 'asr';
|
|
18
18
|
type TableMode = 'fast' | 'accurate';
|
|
19
19
|
type ImageExportMode = 'placeholder' | 'embedded' | 'referenced';
|
|
20
|
-
type PdfBackend = 'pypdfium2' | 'docling_parse' | 'threaded_docling_parse' | 'dlparse_v1' | 'dlparse_v2' | 'dlparse_v4';
|
|
21
|
-
type VlmResponseFormat = 'doctags' | 'doclang' | 'markdown' | 'deepseekocr_markdown' | 'html' | 'otsl' | 'plaintext' | 'chandra_html' | 'dots_json';
|
|
20
|
+
type PdfBackend = 'pypdfium2' | 'docling_parse' | 'threaded_docling_parse' | '_docling_parse' | 'dlparse_v1' | 'dlparse_v2' | 'dlparse_v4';
|
|
21
|
+
type VlmResponseFormat = 'doctags' | 'doclang' | 'markdown' | 'deepseekocr_markdown' | 'unlimited_ocr_markdown' | 'html' | 'otsl' | 'plaintext' | 'chandra_html' | 'dots_json' | 'nemotron_parse_v2' | 'mineru2';
|
|
22
22
|
type VlmInferenceFramework = 'mlx' | 'transformers' | 'vllm';
|
|
23
23
|
type TransformersModelType = 'automodel' | 'automodel-causallm' | 'automodel-imagetexttotext';
|
|
24
24
|
type LegacyVlmModelType = 'smoldocling' | 'smoldocling_vllm' | 'granite_vision' | 'granite_vision_vllm' | 'granite_vision_ollama' | 'got_ocr_2' | 'granite_docling' | 'granite_docling_vllm' | 'nanonets_ocr2' | 'nanonets_ocr2_vllm' | 'nanonets_ocr2_lmstudio' | 'glm_ocr' | 'glm_ocr_vllm' | 'lightonocr' | 'lightonocr_vllm' | 'deepseekocr_ollama';
|
|
@@ -67,6 +67,22 @@ interface VlmModelApi {
|
|
|
67
67
|
response_format: VlmResponseFormat;
|
|
68
68
|
temperature?: number;
|
|
69
69
|
}
|
|
70
|
+
/**
|
|
71
|
+
* Fine-tuning options for PDF heading-hierarchy inference, applied when
|
|
72
|
+
* `do_pdf_heading_hierarchy` is enabled.
|
|
73
|
+
*
|
|
74
|
+
* Mirrors Python's `HeadingHierarchyOptions`.
|
|
75
|
+
*/
|
|
76
|
+
interface HeadingHierarchyOptions {
|
|
77
|
+
/** Use PDF bookmarks/table-of-contents for heading levels. Default: true. */
|
|
78
|
+
use_bookmarks?: boolean;
|
|
79
|
+
/** Use outline numbering (e.g. "1.2.3 Title") for heading levels. Default: true. */
|
|
80
|
+
use_outline_levels?: boolean;
|
|
81
|
+
/** Use font-style differences for heading levels. Default: true. */
|
|
82
|
+
use_style?: boolean;
|
|
83
|
+
/** Maximum inferred heading depth. Default: 6. */
|
|
84
|
+
max_level?: number;
|
|
85
|
+
}
|
|
70
86
|
/**
|
|
71
87
|
* Common Docling Serve conversion controls.
|
|
72
88
|
*
|
|
@@ -90,6 +106,14 @@ interface ConvertDocumentsOptions {
|
|
|
90
106
|
table_mode?: TableMode;
|
|
91
107
|
table_cell_matching?: boolean;
|
|
92
108
|
do_table_structure?: boolean;
|
|
109
|
+
/**
|
|
110
|
+
* If enabled, section-header levels are inferred for PDF and image inputs
|
|
111
|
+
* processed by the standard pipeline. When disabled every heading stays at
|
|
112
|
+
* level 1 (flat hierarchy). Default: false.
|
|
113
|
+
*/
|
|
114
|
+
do_pdf_heading_hierarchy?: boolean;
|
|
115
|
+
/** Fine-tuning of the heading-level inference. Applied when do_pdf_heading_hierarchy is enabled. */
|
|
116
|
+
pdf_heading_hierarchy_options?: HeadingHierarchyOptions;
|
|
93
117
|
image_export_mode?: ImageExportMode;
|
|
94
118
|
images_scale?: number;
|
|
95
119
|
include_images?: boolean;
|
|
@@ -100,6 +124,16 @@ interface ConvertDocumentsOptions {
|
|
|
100
124
|
do_picture_classification?: boolean;
|
|
101
125
|
do_picture_description?: boolean;
|
|
102
126
|
do_chart_extraction?: boolean;
|
|
127
|
+
/**
|
|
128
|
+
* Preset ID for chart extraction (e.g. "default", "granite_vision_v4", "granite_vision").
|
|
129
|
+
* Mutually exclusive with chart_extraction_custom_config.
|
|
130
|
+
*/
|
|
131
|
+
chart_extraction_preset?: string | null;
|
|
132
|
+
/**
|
|
133
|
+
* Custom chart extraction configuration. Accepts a ChartExtractionVlmEngineOptions-equivalent
|
|
134
|
+
* dict. Only available when the admin allows it. Mutually exclusive with chart_extraction_preset.
|
|
135
|
+
*/
|
|
136
|
+
chart_extraction_custom_config?: Record<string, unknown> | null;
|
|
103
137
|
picture_description_area_threshold?: number;
|
|
104
138
|
/** @deprecated Prefer picture_description_preset or picture_description_custom_config. */
|
|
105
139
|
picture_description_local?: PictureDescriptionLocal | null;
|
|
@@ -127,6 +161,20 @@ interface ConvertDocumentsOptions {
|
|
|
127
161
|
md_compact_tables?: boolean;
|
|
128
162
|
abort_on_error?: boolean;
|
|
129
163
|
document_timeout?: number | null;
|
|
164
|
+
/**
|
|
165
|
+
* Inline chunker configuration. Mutually exclusive with chunking_preset.
|
|
166
|
+
* Discriminated by a `chunker` field: "hybrid" | "hierarchical".
|
|
167
|
+
*/
|
|
168
|
+
chunking_options?: (HybridChunkingOptions & {
|
|
169
|
+
chunker: 'hybrid';
|
|
170
|
+
}) | (HierarchicalChunkingOptions & {
|
|
171
|
+
chunker: 'hierarchical';
|
|
172
|
+
}) | null;
|
|
173
|
+
/**
|
|
174
|
+
* Preset ID for chunking (e.g. "granite_embedding_278m", "minilm_l6", "hierarchical").
|
|
175
|
+
* Mutually exclusive with chunking_options.
|
|
176
|
+
*/
|
|
177
|
+
chunking_preset?: string | null;
|
|
130
178
|
}
|
|
131
179
|
interface HttpSource {
|
|
132
180
|
kind: 'http';
|
|
@@ -538,7 +586,7 @@ interface FetchTransportOptions {
|
|
|
538
586
|
}
|
|
539
587
|
declare class FetchTransport implements DoclingTransport {
|
|
540
588
|
#private;
|
|
541
|
-
constructor(optionsOrFetch?: FetchTransportOptions | FetchLike
|
|
589
|
+
constructor(optionsOrFetch?: FetchTransportOptions | FetchLike);
|
|
542
590
|
request<T>(request: DoclingTransportRequest): Promise<T>;
|
|
543
591
|
}
|
|
544
592
|
|
|
@@ -866,4 +914,4 @@ declare function preflightFileSize(source: NormalizedSource, maxFileSize: number
|
|
|
866
914
|
declare function appendFormValue(form: FormData, key: string, value: unknown): void;
|
|
867
915
|
declare function fileSourceFromBinary(source: BinaryFileSource, signal?: AbortSignal): Promise<FileSource>;
|
|
868
916
|
|
|
869
|
-
export { type ArtifactAddressResolver, ArtifactDownloader, type ArtifactDownloaderOptions, type ArtifactRef, type ArtifactType, type AutoSubmitResult, type AzureBlobCoordinates, type AzureBlobSource, type AzureBlobTarget, type BaseChunkingOptions, type BatchConvertSourcesRequest, type BatchResultForTarget, type BatchSource, type BatchSubmitCallOptions, type BatchTarget, type BinaryFileSource, type CallbackSpec, type ChunkCallOptions, type ChunkDocumentResponse, type ChunkSourceOptions, type ChunkSourcesRequest, type ChunkedDocumentResultItem, type ChunkerKind, type ConfidenceScores, type ConversionInput, type ConversionItem, type ConversionResult, type ConversionSource, type ConversionSourceInput, type ConversionStatus, type ConvertAllOptions, type ConvertDocumentResponse, type ConvertDocumentsOptions, type ConvertOptions, type ConvertSourcesRequest, DEFAULT_MAX_CONCURRENCY, DoclingArtifactDownloadError, DoclingBatchConversionError, type DoclingBinaryResponse, DoclingClient, type DoclingClientOptions, type DoclingComponentType, DoclingConversionError, type DoclingDocument, DoclingError, DoclingHttpError, DoclingJob, DoclingProtocolError, type DoclingRequestBodyType, DoclingResponseSchemaMismatchError, type DoclingResponseType, DoclingResultExpiredError, DoclingResultNotReadyError, DoclingServiceError, DoclingServiceUnavailableError, DoclingTaskError, DoclingTaskNotFoundError, DoclingTimeoutError, type DoclingTransport, type DoclingTransportRequest, DoclingUsageLimitExceededError, type DocumentArtifactItem, type DocumentLimits, type ErrorItem, type ExportDocumentResponse, type ExportResult, type FailureCategory, type FetchLike, FetchTransport, type FetchTransportOptions, type FileSource, type GenericSource, type GenericTarget, type GoogleCloudStorageCoordinates, type GoogleCloudStorageServiceAccountInfo, type GoogleCloudStorageSource, type GoogleCloudStorageTarget, type GoogleDriveCoordinates, type GoogleDriveCredentials, type GoogleDriveSource, type GoogleDriveTarget, type HealthCheckResponse, type HierarchicalChunkSourcesRequest, type HierarchicalChunkingOptions, type HttpSource, type HybridChunkSourcesRequest, type HybridChunkingOptions, type ImageExportMode, type InBodyConversionResponse, type InBodyTarget, type InputFormat, type LegacyVlmModelType, MAX_CONCURRENCY_LIMIT, type NormalizedJsonSource, type NormalizedMultipartSource, type NormalizedSource, type OutcomeCounts, type OutputFormat, type PdfBackend, type PictureClassificationLabel, type PictureDescriptionApi, type PictureDescriptionLocal, type PresignedUrlConvertDocumentResponse, type PresignedUrlConvertResponse, type PresignedUrlTarget, type ProcessingPipeline, type ProfilingItem, type ProfilingScope, type PublicFailureInfo, type PutTarget, type QualityGrade, type RawServiceResult, type RemoteTargetResponse, type S3Coordinates, type S3Source, type S3Target, type StatusWatcherKind, type StorageTarget, type SubmitAndRetrieveOptions, type SubmitCallOptions, type SubmitResultForTarget, type SubmitSourceOptions, type SubmitTarget, type TableMode, type TaskFailureResult, type TaskProcessingMeta, type TaskStatus, type TaskStatusResponse, type TaskType, type TransformersModelType, type VlmInferenceFramework, type VlmModelApi, type VlmModelLocal, type VlmResponseFormat, type WaitForTaskOptions, type WatchTaskOptions, type WebSocketFactory, type WebSocketFactoryOptions, type WebSocketLike, type ZipTarget, appendFormValue, applyPageLimits, documentFromBundle, documentFromJson, fileSourceFromBinary, materializePresignedResult, normalizeSourceInput, preflightFileSize, resolveConvertOptions, selectDocumentArtifact, validateConvertOptions, validateMaxFileSize, watchTask, withJsonOutput };
|
|
917
|
+
export { type ArtifactAddressResolver, ArtifactDownloader, type ArtifactDownloaderOptions, type ArtifactRef, type ArtifactType, type AutoSubmitResult, type AzureBlobCoordinates, type AzureBlobSource, type AzureBlobTarget, type BaseChunkingOptions, type BatchConvertSourcesRequest, type BatchResultForTarget, type BatchSource, type BatchSubmitCallOptions, type BatchTarget, type BinaryFileSource, type CallbackSpec, type ChunkCallOptions, type ChunkDocumentResponse, type ChunkSourceOptions, type ChunkSourcesRequest, type ChunkedDocumentResultItem, type ChunkerKind, type ConfidenceScores, type ConversionInput, type ConversionItem, type ConversionResult, type ConversionSource, type ConversionSourceInput, type ConversionStatus, type ConvertAllOptions, type ConvertDocumentResponse, type ConvertDocumentsOptions, type ConvertOptions, type ConvertSourcesRequest, DEFAULT_MAX_CONCURRENCY, DoclingArtifactDownloadError, DoclingBatchConversionError, type DoclingBinaryResponse, DoclingClient, type DoclingClientOptions, type DoclingComponentType, DoclingConversionError, type DoclingDocument, DoclingError, DoclingHttpError, DoclingJob, DoclingProtocolError, type DoclingRequestBodyType, DoclingResponseSchemaMismatchError, type DoclingResponseType, DoclingResultExpiredError, DoclingResultNotReadyError, DoclingServiceError, DoclingServiceUnavailableError, DoclingTaskError, DoclingTaskNotFoundError, DoclingTimeoutError, type DoclingTransport, type DoclingTransportRequest, DoclingUsageLimitExceededError, type DocumentArtifactItem, type DocumentLimits, type ErrorItem, type ExportDocumentResponse, type ExportResult, type FailureCategory, type FetchLike, FetchTransport, type FetchTransportOptions, type FileSource, type GenericSource, type GenericTarget, type GoogleCloudStorageCoordinates, type GoogleCloudStorageServiceAccountInfo, type GoogleCloudStorageSource, type GoogleCloudStorageTarget, type GoogleDriveCoordinates, type GoogleDriveCredentials, type GoogleDriveSource, type GoogleDriveTarget, type HeadingHierarchyOptions, type HealthCheckResponse, type HierarchicalChunkSourcesRequest, type HierarchicalChunkingOptions, type HttpSource, type HybridChunkSourcesRequest, type HybridChunkingOptions, type ImageExportMode, type InBodyConversionResponse, type InBodyTarget, type InputFormat, type LegacyVlmModelType, MAX_CONCURRENCY_LIMIT, type NormalizedJsonSource, type NormalizedMultipartSource, type NormalizedSource, type OutcomeCounts, type OutputFormat, type PdfBackend, type PictureClassificationLabel, type PictureDescriptionApi, type PictureDescriptionLocal, type PresignedUrlConvertDocumentResponse, type PresignedUrlConvertResponse, type PresignedUrlTarget, type ProcessingPipeline, type ProfilingItem, type ProfilingScope, type PublicFailureInfo, type PutTarget, type QualityGrade, type RawServiceResult, type RemoteTargetResponse, type S3Coordinates, type S3Source, type S3Target, type StatusWatcherKind, type StorageTarget, type SubmitAndRetrieveOptions, type SubmitCallOptions, type SubmitResultForTarget, type SubmitSourceOptions, type SubmitTarget, type TableMode, type TaskFailureResult, type TaskProcessingMeta, type TaskStatus, type TaskStatusResponse, type TaskType, type TransformersModelType, type VlmInferenceFramework, type VlmModelApi, type VlmModelLocal, type VlmResponseFormat, type WaitForTaskOptions, type WatchTaskOptions, type WebSocketFactory, type WebSocketFactoryOptions, type WebSocketLike, type ZipTarget, appendFormValue, applyPageLimits, documentFromBundle, documentFromJson, fileSourceFromBinary, materializePresignedResult, normalizeSourceInput, preflightFileSize, resolveConvertOptions, selectDocumentArtifact, validateConvertOptions, validateMaxFileSize, watchTask, withJsonOutput };
|
package/dist/index.js
CHANGED
|
@@ -131,7 +131,7 @@ var ArtifactDownloader = class {
|
|
|
131
131
|
"No fetch implementation is available for artifact downloads"
|
|
132
132
|
);
|
|
133
133
|
}
|
|
134
|
-
this.#fetch = options.fetch ?? globalThis.fetch;
|
|
134
|
+
this.#fetch = options.fetch ?? globalThis.fetch?.bind(globalThis);
|
|
135
135
|
this.#resolver = options.resolver ?? resolveAllAddresses;
|
|
136
136
|
this.#allowPrivateUrls = options.allowPrivateUrls ?? false;
|
|
137
137
|
this.#timeoutMs = options.timeoutMs ?? 6e4;
|
|
@@ -722,6 +722,7 @@ var EXTENSION_FORMATS = {
|
|
|
722
722
|
dotm: "docx",
|
|
723
723
|
doc: "doc",
|
|
724
724
|
dot: "doc",
|
|
725
|
+
rtf: "rtf",
|
|
725
726
|
pptx: "pptx",
|
|
726
727
|
potx: "pptx",
|
|
727
728
|
ppsx: "pptx",
|
|
@@ -734,6 +735,8 @@ var EXTENSION_FORMATS = {
|
|
|
734
735
|
html: "html",
|
|
735
736
|
htm: "html",
|
|
736
737
|
xhtml: "html",
|
|
738
|
+
mhtml: "mhtml",
|
|
739
|
+
mht: "mhtml",
|
|
737
740
|
md: "md",
|
|
738
741
|
markdown: "md",
|
|
739
742
|
txt: "md",
|
|
@@ -743,6 +746,8 @@ var EXTENSION_FORMATS = {
|
|
|
743
746
|
csv: "csv",
|
|
744
747
|
xlsx: "xlsx",
|
|
745
748
|
xlsm: "xlsx",
|
|
749
|
+
xltx: "xlsx",
|
|
750
|
+
xltm: "xlsx",
|
|
746
751
|
xls: "xls",
|
|
747
752
|
xlt: "xls",
|
|
748
753
|
asciidoc: "asciidoc",
|
|
@@ -763,6 +768,7 @@ var EXTENSION_FORMATS = {
|
|
|
763
768
|
tiff: "image",
|
|
764
769
|
bmp: "image",
|
|
765
770
|
webp: "image",
|
|
771
|
+
gif: "image",
|
|
766
772
|
wav: "audio",
|
|
767
773
|
mp3: "audio",
|
|
768
774
|
m4a: "audio",
|
|
@@ -784,8 +790,14 @@ var EXTENSION_FORMATS = {
|
|
|
784
790
|
tex: "latex",
|
|
785
791
|
latex: "latex",
|
|
786
792
|
eml: "email",
|
|
793
|
+
msg: "email",
|
|
787
794
|
epub: "epub",
|
|
788
|
-
boxnote: "boxnote"
|
|
795
|
+
boxnote: "boxnote",
|
|
796
|
+
pages: "iwork_pages",
|
|
797
|
+
key: "iwork_keynote",
|
|
798
|
+
ebc: "ebcdic",
|
|
799
|
+
ebcdic: "ebcdic",
|
|
800
|
+
afp: "afp"
|
|
789
801
|
};
|
|
790
802
|
async function normalizeSourceInput(input, signal) {
|
|
791
803
|
throwIfAborted(signal);
|
|
@@ -1065,6 +1077,11 @@ function validateOptionExclusivity(options) {
|
|
|
1065
1077
|
}
|
|
1066
1078
|
for (const [name, preset, custom] of [
|
|
1067
1079
|
["code_formula", options.code_formula_preset, options.code_formula_custom_config],
|
|
1080
|
+
[
|
|
1081
|
+
"chart_extraction",
|
|
1082
|
+
options.chart_extraction_preset,
|
|
1083
|
+
options.chart_extraction_custom_config
|
|
1084
|
+
],
|
|
1068
1085
|
["layout", options.layout_preset, options.layout_custom_config],
|
|
1069
1086
|
[
|
|
1070
1087
|
"picture_classification",
|
|
@@ -1083,6 +1100,11 @@ function validateOptionExclusivity(options) {
|
|
|
1083
1100
|
"ocr_preset and ocr_custom_config are mutually exclusive"
|
|
1084
1101
|
);
|
|
1085
1102
|
}
|
|
1103
|
+
if (options.chunking_preset !== void 0 && options.chunking_preset !== null && options.chunking_options !== void 0 && options.chunking_options !== null) {
|
|
1104
|
+
throw new DoclingProtocolError(
|
|
1105
|
+
"chunking_preset and chunking_options are mutually exclusive"
|
|
1106
|
+
);
|
|
1107
|
+
}
|
|
1086
1108
|
}
|
|
1087
1109
|
function applyPageLimits(options, pageRange, maxNumPages) {
|
|
1088
1110
|
let effectiveRange = pageRange ?? options.page_range;
|
|
@@ -1222,12 +1244,15 @@ function guessMimeType(filename) {
|
|
|
1222
1244
|
pdf: "application/pdf",
|
|
1223
1245
|
doc: "application/msword",
|
|
1224
1246
|
docx: "application/vnd.openxmlformats-officedocument.wordprocessingml.document",
|
|
1247
|
+
rtf: "application/rtf",
|
|
1225
1248
|
ppt: "application/vnd.ms-powerpoint",
|
|
1226
1249
|
pptx: "application/vnd.openxmlformats-officedocument.presentationml.presentation",
|
|
1227
1250
|
xls: "application/vnd.ms-excel",
|
|
1228
1251
|
xlsx: "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",
|
|
1229
1252
|
html: "text/html",
|
|
1230
1253
|
htm: "text/html",
|
|
1254
|
+
mhtml: "application/x-mimearchive",
|
|
1255
|
+
mht: "application/x-mimearchive",
|
|
1231
1256
|
md: "text/markdown",
|
|
1232
1257
|
txt: "text/plain",
|
|
1233
1258
|
csv: "text/csv",
|
|
@@ -1237,44 +1262,54 @@ function guessMimeType(filename) {
|
|
|
1237
1262
|
jpeg: "image/jpeg",
|
|
1238
1263
|
tif: "image/tiff",
|
|
1239
1264
|
tiff: "image/tiff",
|
|
1265
|
+
gif: "image/gif",
|
|
1266
|
+
webp: "image/webp",
|
|
1267
|
+
bmp: "image/bmp",
|
|
1240
1268
|
wav: "audio/wav",
|
|
1241
1269
|
mp3: "audio/mpeg",
|
|
1242
1270
|
mp4: "video/mp4",
|
|
1243
1271
|
vtt: "text/vtt",
|
|
1244
1272
|
eml: "message/rfc822",
|
|
1273
|
+
msg: "application/vnd.ms-outlook",
|
|
1245
1274
|
epub: "application/epub+zip"
|
|
1246
1275
|
}[extension] ?? "application/octet-stream";
|
|
1247
1276
|
}
|
|
1248
1277
|
var INPUT_FORMATS = /* @__PURE__ */ new Set([
|
|
1249
1278
|
"docx",
|
|
1250
1279
|
"doc",
|
|
1280
|
+
"rtf",
|
|
1251
1281
|
"pptx",
|
|
1282
|
+
"ppt",
|
|
1252
1283
|
"html",
|
|
1284
|
+
"mhtml",
|
|
1253
1285
|
"image",
|
|
1254
1286
|
"pdf",
|
|
1255
1287
|
"asciidoc",
|
|
1256
1288
|
"md",
|
|
1257
1289
|
"csv",
|
|
1258
1290
|
"xlsx",
|
|
1259
|
-
"xml_uspto",
|
|
1260
|
-
"xml_jats",
|
|
1261
|
-
"json_docling",
|
|
1262
|
-
"dclx",
|
|
1263
|
-
"audio",
|
|
1264
|
-
"vtt",
|
|
1265
|
-
"xml_xbrl",
|
|
1266
|
-
"mets_gbs",
|
|
1267
|
-
"latex",
|
|
1268
|
-
"ppt",
|
|
1269
1291
|
"xls",
|
|
1270
1292
|
"odt",
|
|
1271
1293
|
"ods",
|
|
1272
1294
|
"odp",
|
|
1295
|
+
"xml_uspto",
|
|
1296
|
+
"xml_jats",
|
|
1297
|
+
"xml_xbrl",
|
|
1273
1298
|
"xml_doclang",
|
|
1299
|
+
"dclx",
|
|
1300
|
+
"mets_gbs",
|
|
1301
|
+
"json_docling",
|
|
1302
|
+
"audio",
|
|
1274
1303
|
"video",
|
|
1304
|
+
"vtt",
|
|
1305
|
+
"latex",
|
|
1275
1306
|
"email",
|
|
1276
1307
|
"epub",
|
|
1277
|
-
"boxnote"
|
|
1308
|
+
"boxnote",
|
|
1309
|
+
"iwork_pages",
|
|
1310
|
+
"iwork_keynote",
|
|
1311
|
+
"ebcdic",
|
|
1312
|
+
"afp"
|
|
1278
1313
|
]);
|
|
1279
1314
|
var OUTPUT_FORMATS = /* @__PURE__ */ new Set([
|
|
1280
1315
|
"md",
|
|
@@ -1287,15 +1322,17 @@ var OUTPUT_FORMATS = /* @__PURE__ */ new Set([
|
|
|
1287
1322
|
"vtt",
|
|
1288
1323
|
"doclang",
|
|
1289
1324
|
"dclx",
|
|
1290
|
-
"chunks"
|
|
1325
|
+
"chunks",
|
|
1326
|
+
"latex"
|
|
1291
1327
|
]);
|
|
1292
|
-
var PIPELINES = /* @__PURE__ */ new Set(["legacy", "standard", "vlm", "asr"]);
|
|
1328
|
+
var PIPELINES = /* @__PURE__ */ new Set(["legacy", "standard", "native", "vlm", "asr"]);
|
|
1293
1329
|
var IMAGE_EXPORT_MODES = /* @__PURE__ */ new Set(["placeholder", "embedded", "referenced"]);
|
|
1294
1330
|
var TABLE_MODES = /* @__PURE__ */ new Set(["fast", "accurate"]);
|
|
1295
1331
|
var PDF_BACKENDS = /* @__PURE__ */ new Set([
|
|
1296
1332
|
"pypdfium2",
|
|
1297
1333
|
"docling_parse",
|
|
1298
1334
|
"threaded_docling_parse",
|
|
1335
|
+
"_docling_parse",
|
|
1299
1336
|
"dlparse_v1",
|
|
1300
1337
|
"dlparse_v2",
|
|
1301
1338
|
"dlparse_v4"
|
|
@@ -1323,11 +1360,14 @@ var VLM_RESPONSE_FORMATS = /* @__PURE__ */ new Set([
|
|
|
1323
1360
|
"doclang",
|
|
1324
1361
|
"markdown",
|
|
1325
1362
|
"deepseekocr_markdown",
|
|
1363
|
+
"unlimited_ocr_markdown",
|
|
1326
1364
|
"html",
|
|
1327
1365
|
"otsl",
|
|
1328
1366
|
"plaintext",
|
|
1329
1367
|
"chandra_html",
|
|
1330
|
-
"dots_json"
|
|
1368
|
+
"dots_json",
|
|
1369
|
+
"nemotron_parse_v2",
|
|
1370
|
+
"mineru2"
|
|
1331
1371
|
]);
|
|
1332
1372
|
var VLM_INFERENCE_FRAMEWORKS = /* @__PURE__ */ new Set(["mlx", "transformers", "vllm"]);
|
|
1333
1373
|
var TRANSFORMERS_MODEL_TYPES = /* @__PURE__ */ new Set([
|
|
@@ -1382,6 +1422,7 @@ var BOOLEAN_OPTIONS = [
|
|
|
1382
1422
|
"force_ocr",
|
|
1383
1423
|
"table_cell_matching",
|
|
1384
1424
|
"do_table_structure",
|
|
1425
|
+
"do_pdf_heading_hierarchy",
|
|
1385
1426
|
"include_images",
|
|
1386
1427
|
"include_page_images",
|
|
1387
1428
|
"do_code_enrichment",
|
|
@@ -1404,15 +1445,18 @@ var STRING_OPTIONS = [
|
|
|
1404
1445
|
"vlm_pipeline_preset",
|
|
1405
1446
|
"picture_description_preset",
|
|
1406
1447
|
"code_formula_preset",
|
|
1448
|
+
"chart_extraction_preset",
|
|
1407
1449
|
"table_structure_preset",
|
|
1408
1450
|
"layout_preset",
|
|
1409
|
-
"picture_classification_preset"
|
|
1451
|
+
"picture_classification_preset",
|
|
1452
|
+
"chunking_preset"
|
|
1410
1453
|
];
|
|
1411
1454
|
var RECORD_OPTIONS = [
|
|
1412
1455
|
"ocr_custom_config",
|
|
1413
1456
|
"vlm_pipeline_custom_config",
|
|
1414
1457
|
"picture_description_custom_config",
|
|
1415
1458
|
"code_formula_custom_config",
|
|
1459
|
+
"chart_extraction_custom_config",
|
|
1416
1460
|
"table_structure_custom_config",
|
|
1417
1461
|
"layout_custom_config",
|
|
1418
1462
|
"picture_classification_custom_config",
|
|
@@ -1568,15 +1612,16 @@ var FetchTransport = class {
|
|
|
1568
1612
|
#timeoutMs;
|
|
1569
1613
|
#backoffBaseMs;
|
|
1570
1614
|
#sleep;
|
|
1571
|
-
constructor(optionsOrFetch
|
|
1615
|
+
constructor(optionsOrFetch) {
|
|
1572
1616
|
const options = typeof optionsOrFetch === "function" ? { fetch: optionsOrFetch } : optionsOrFetch;
|
|
1573
|
-
const
|
|
1617
|
+
const userFetch = options?.fetch;
|
|
1618
|
+
const fetchImplementation = userFetch ?? globalThis.fetch;
|
|
1574
1619
|
if (fetchImplementation === void 0) {
|
|
1575
1620
|
throw new DoclingProtocolError(
|
|
1576
1621
|
"No fetch implementation is available; provide a DoclingTransport"
|
|
1577
1622
|
);
|
|
1578
1623
|
}
|
|
1579
|
-
this.#fetch = fetchImplementation;
|
|
1624
|
+
this.#fetch = userFetch ? fetchImplementation : fetchImplementation.bind(globalThis);
|
|
1580
1625
|
this.#retries = validateNonNegativeInteger(options?.retries ?? 3, "retries");
|
|
1581
1626
|
this.#timeoutMs = validatePositiveNumber(options?.timeoutMs ?? 6e4, "timeoutMs");
|
|
1582
1627
|
this.#backoffBaseMs = validatePositiveNumber(
|