@docling/docling-client 2.130.0 → 2.131.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 +10 -4
- package/dist/index.cjs +20 -5
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +50 -2
- package/dist/index.d.ts +50 -2
- package/dist/index.js +20 -5
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.cts
CHANGED
|
@@ -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
|
@@ -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;
|
|
@@ -1065,6 +1065,11 @@ function validateOptionExclusivity(options) {
|
|
|
1065
1065
|
}
|
|
1066
1066
|
for (const [name, preset, custom] of [
|
|
1067
1067
|
["code_formula", options.code_formula_preset, options.code_formula_custom_config],
|
|
1068
|
+
[
|
|
1069
|
+
"chart_extraction",
|
|
1070
|
+
options.chart_extraction_preset,
|
|
1071
|
+
options.chart_extraction_custom_config
|
|
1072
|
+
],
|
|
1068
1073
|
["layout", options.layout_preset, options.layout_custom_config],
|
|
1069
1074
|
[
|
|
1070
1075
|
"picture_classification",
|
|
@@ -1083,6 +1088,11 @@ function validateOptionExclusivity(options) {
|
|
|
1083
1088
|
"ocr_preset and ocr_custom_config are mutually exclusive"
|
|
1084
1089
|
);
|
|
1085
1090
|
}
|
|
1091
|
+
if (options.chunking_preset !== void 0 && options.chunking_preset !== null && options.chunking_options !== void 0 && options.chunking_options !== null) {
|
|
1092
|
+
throw new DoclingProtocolError(
|
|
1093
|
+
"chunking_preset and chunking_options are mutually exclusive"
|
|
1094
|
+
);
|
|
1095
|
+
}
|
|
1086
1096
|
}
|
|
1087
1097
|
function applyPageLimits(options, pageRange, maxNumPages) {
|
|
1088
1098
|
let effectiveRange = pageRange ?? options.page_range;
|
|
@@ -1382,6 +1392,7 @@ var BOOLEAN_OPTIONS = [
|
|
|
1382
1392
|
"force_ocr",
|
|
1383
1393
|
"table_cell_matching",
|
|
1384
1394
|
"do_table_structure",
|
|
1395
|
+
"do_pdf_heading_hierarchy",
|
|
1385
1396
|
"include_images",
|
|
1386
1397
|
"include_page_images",
|
|
1387
1398
|
"do_code_enrichment",
|
|
@@ -1404,15 +1415,18 @@ var STRING_OPTIONS = [
|
|
|
1404
1415
|
"vlm_pipeline_preset",
|
|
1405
1416
|
"picture_description_preset",
|
|
1406
1417
|
"code_formula_preset",
|
|
1418
|
+
"chart_extraction_preset",
|
|
1407
1419
|
"table_structure_preset",
|
|
1408
1420
|
"layout_preset",
|
|
1409
|
-
"picture_classification_preset"
|
|
1421
|
+
"picture_classification_preset",
|
|
1422
|
+
"chunking_preset"
|
|
1410
1423
|
];
|
|
1411
1424
|
var RECORD_OPTIONS = [
|
|
1412
1425
|
"ocr_custom_config",
|
|
1413
1426
|
"vlm_pipeline_custom_config",
|
|
1414
1427
|
"picture_description_custom_config",
|
|
1415
1428
|
"code_formula_custom_config",
|
|
1429
|
+
"chart_extraction_custom_config",
|
|
1416
1430
|
"table_structure_custom_config",
|
|
1417
1431
|
"layout_custom_config",
|
|
1418
1432
|
"picture_classification_custom_config",
|
|
@@ -1568,15 +1582,16 @@ var FetchTransport = class {
|
|
|
1568
1582
|
#timeoutMs;
|
|
1569
1583
|
#backoffBaseMs;
|
|
1570
1584
|
#sleep;
|
|
1571
|
-
constructor(optionsOrFetch
|
|
1585
|
+
constructor(optionsOrFetch) {
|
|
1572
1586
|
const options = typeof optionsOrFetch === "function" ? { fetch: optionsOrFetch } : optionsOrFetch;
|
|
1573
|
-
const
|
|
1587
|
+
const userFetch = options?.fetch;
|
|
1588
|
+
const fetchImplementation = userFetch ?? globalThis.fetch;
|
|
1574
1589
|
if (fetchImplementation === void 0) {
|
|
1575
1590
|
throw new DoclingProtocolError(
|
|
1576
1591
|
"No fetch implementation is available; provide a DoclingTransport"
|
|
1577
1592
|
);
|
|
1578
1593
|
}
|
|
1579
|
-
this.#fetch = fetchImplementation;
|
|
1594
|
+
this.#fetch = userFetch ? fetchImplementation : fetchImplementation.bind(globalThis);
|
|
1580
1595
|
this.#retries = validateNonNegativeInteger(options?.retries ?? 3, "retries");
|
|
1581
1596
|
this.#timeoutMs = validatePositiveNumber(options?.timeoutMs ?? 6e4, "timeoutMs");
|
|
1582
1597
|
this.#backoffBaseMs = validatePositiveNumber(
|