chunkr-ai 0.1.0a1__py3-none-any.whl → 0.1.0a3__py3-none-any.whl

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.
Files changed (46) hide show
  1. chunkr_ai/_client.py +18 -9
  2. chunkr_ai/_files.py +1 -1
  3. chunkr_ai/_version.py +1 -1
  4. chunkr_ai/pagination.py +61 -1
  5. chunkr_ai/resources/__init__.py +27 -13
  6. chunkr_ai/resources/files.py +712 -0
  7. chunkr_ai/resources/tasks/__init__.py +33 -0
  8. chunkr_ai/resources/tasks/parse.py +612 -0
  9. chunkr_ai/resources/tasks/tasks.py +596 -0
  10. chunkr_ai/types/__init__.py +7 -19
  11. chunkr_ai/types/delete.py +10 -0
  12. chunkr_ai/types/file.py +30 -0
  13. chunkr_ai/types/file_create_params.py +17 -0
  14. chunkr_ai/types/file_list_params.py +28 -0
  15. chunkr_ai/types/file_url.py +15 -0
  16. chunkr_ai/types/file_url_params.py +15 -0
  17. chunkr_ai/types/files_page_response.py +20 -0
  18. chunkr_ai/types/task.py +866 -27
  19. chunkr_ai/types/tasks/__init__.py +6 -0
  20. chunkr_ai/types/tasks/parse_create_params.py +844 -0
  21. chunkr_ai/types/tasks/parse_update_params.py +838 -0
  22. {chunkr_ai-0.1.0a1.dist-info → chunkr_ai-0.1.0a3.dist-info}/METADATA +39 -21
  23. chunkr_ai-0.1.0a3.dist-info/RECORD +52 -0
  24. chunkr_ai/resources/task.py +0 -1166
  25. chunkr_ai/types/auto_generation_config.py +0 -39
  26. chunkr_ai/types/auto_generation_config_param.py +0 -39
  27. chunkr_ai/types/bounding_box.py +0 -19
  28. chunkr_ai/types/chunk_processing.py +0 -40
  29. chunkr_ai/types/chunk_processing_param.py +0 -42
  30. chunkr_ai/types/ignore_generation_config.py +0 -39
  31. chunkr_ai/types/ignore_generation_config_param.py +0 -39
  32. chunkr_ai/types/llm_generation_config.py +0 -39
  33. chunkr_ai/types/llm_generation_config_param.py +0 -39
  34. chunkr_ai/types/llm_processing.py +0 -36
  35. chunkr_ai/types/llm_processing_param.py +0 -36
  36. chunkr_ai/types/picture_generation_config.py +0 -39
  37. chunkr_ai/types/picture_generation_config_param.py +0 -39
  38. chunkr_ai/types/segment_processing.py +0 -280
  39. chunkr_ai/types/segment_processing_param.py +0 -281
  40. chunkr_ai/types/table_generation_config.py +0 -39
  41. chunkr_ai/types/table_generation_config_param.py +0 -39
  42. chunkr_ai/types/task_parse_params.py +0 -90
  43. chunkr_ai/types/task_update_params.py +0 -90
  44. chunkr_ai-0.1.0a1.dist-info/RECORD +0 -58
  45. {chunkr_ai-0.1.0a1.dist-info → chunkr_ai-0.1.0a3.dist-info}/WHEEL +0 -0
  46. {chunkr_ai-0.1.0a1.dist-info → chunkr_ai-0.1.0a3.dist-info}/licenses/LICENSE +0 -0
@@ -0,0 +1,838 @@
1
+ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+
3
+ from __future__ import annotations
4
+
5
+ from typing import List, Union, Optional
6
+ from typing_extensions import Literal, Required, Annotated, TypeAlias, TypedDict
7
+
8
+ from ..._utils import PropertyInfo
9
+
10
+ __all__ = [
11
+ "ParseUpdateParams",
12
+ "ChunkProcessing",
13
+ "ChunkProcessingTokenizer",
14
+ "ChunkProcessingTokenizerEnum",
15
+ "ChunkProcessingTokenizerString",
16
+ "LlmProcessing",
17
+ "LlmProcessingFallbackStrategy",
18
+ "LlmProcessingFallbackStrategyModel",
19
+ "SegmentProcessing",
20
+ "SegmentProcessingCaption",
21
+ "SegmentProcessingFootnote",
22
+ "SegmentProcessingFormula",
23
+ "SegmentProcessingListItem",
24
+ "SegmentProcessingPage",
25
+ "SegmentProcessingPageFooter",
26
+ "SegmentProcessingPageHeader",
27
+ "SegmentProcessingPicture",
28
+ "SegmentProcessingSectionHeader",
29
+ "SegmentProcessingTable",
30
+ "SegmentProcessingText",
31
+ "SegmentProcessingTitle",
32
+ ]
33
+
34
+
35
+ class ParseUpdateParams(TypedDict, total=False):
36
+ chunk_processing: Optional[ChunkProcessing]
37
+ """Controls the setting for the chunking and post-processing of each chunk."""
38
+
39
+ error_handling: Optional[Literal["Fail", "Continue"]]
40
+ """Controls how errors are handled during processing:
41
+
42
+ - `Fail`: Stops processing and fails the task when any error occurs
43
+ - `Continue`: Attempts to continue processing despite non-critical errors (eg.
44
+ LLM refusals etc.)
45
+ """
46
+
47
+ expires_in: Optional[int]
48
+ """
49
+ The number of seconds until task is deleted. Expired tasks can **not** be
50
+ updated, polled or accessed via web interface.
51
+ """
52
+
53
+ high_resolution: Optional[bool]
54
+ """Whether to use high-resolution images for cropping and post-processing.
55
+
56
+ (Latency penalty: ~7 seconds per page)
57
+ """
58
+
59
+ llm_processing: Optional[LlmProcessing]
60
+ """Controls the LLM used for the task."""
61
+
62
+ ocr_strategy: Optional[Literal["All", "Auto"]]
63
+ """Controls the Optical Character Recognition (OCR) strategy.
64
+
65
+ - `All`: Processes all pages with OCR. (Latency penalty: ~0.5 seconds per page)
66
+ - `Auto`: Selectively applies OCR only to pages with missing or low-quality
67
+ text. When text layer is present the bounding boxes from the text layer are
68
+ used.
69
+ """
70
+
71
+ pipeline: Optional[Literal["Azure", "Chunkr"]]
72
+ """
73
+ Choose the provider whose models will be used for segmentation and OCR. The
74
+ output will be unified to the Chunkr `output` format.
75
+ """
76
+
77
+ segment_processing: Optional[SegmentProcessing]
78
+ """Defines how each segment type is handled when generating the final output.
79
+
80
+ Each segment uses one of three strategies. The chosen strategy controls: •
81
+ Whether the segment is kept (`Auto`, `LLM`) or skipped (`Ignore`). • How the
82
+ content is produced (rule-based vs. LLM). • The output format (`Html` or
83
+ `Markdown`).
84
+
85
+ Optional flags such as image **cropping**, **extended context**, and
86
+ **descriptions** further refine behaviour.
87
+
88
+ **Default strategy per segment** • `Title`, `SectionHeader`, `Text`, `ListItem`,
89
+ `Caption`, `Footnote` → **Auto** (Markdown, description off) • `Table` → **LLM**
90
+ (HTML, description on) • `Picture` → **LLM** (Markdown, description off,
91
+ cropping _All_) • `Formula`, `Page` → **LLM** (Markdown, description off) •
92
+ `PageHeader`, `PageFooter` → **Ignore** (removed from output)
93
+
94
+ **Strategy reference** • **Auto** – rule-based content generation. • **LLM** –
95
+ generate content with an LLM. • **Ignore** – exclude the segment entirely.
96
+ """
97
+
98
+ segmentation_strategy: Optional[Literal["LayoutAnalysis", "Page"]]
99
+ """Controls the segmentation strategy:
100
+
101
+ - `LayoutAnalysis`: Analyzes pages for layout elements (e.g., `Table`,
102
+ `Picture`, `Formula`, etc.) using bounding boxes. Provides fine-grained
103
+ segmentation and better chunking. (Latency penalty: ~TBD seconds per page).
104
+ - `Page`: Treats each page as a single segment. Faster processing, but without
105
+ layout element detection and only simple chunking.
106
+ """
107
+
108
+
109
+ class ChunkProcessingTokenizerEnum(TypedDict, total=False):
110
+ enum: Required[
111
+ Annotated[Literal["Word", "Cl100kBase", "XlmRobertaBase", "BertBaseUncased"], PropertyInfo(alias="Enum")]
112
+ ]
113
+ """Use one of the predefined tokenizer types"""
114
+
115
+
116
+ class ChunkProcessingTokenizerString(TypedDict, total=False):
117
+ string: Required[Annotated[str, PropertyInfo(alias="String")]]
118
+ """
119
+ Use any Hugging Face tokenizer by specifying its model ID Examples:
120
+ "Qwen/Qwen-tokenizer", "facebook/bart-large"
121
+ """
122
+
123
+
124
+ ChunkProcessingTokenizer: TypeAlias = Union[ChunkProcessingTokenizerEnum, ChunkProcessingTokenizerString]
125
+
126
+
127
+ class ChunkProcessing(TypedDict, total=False):
128
+ ignore_headers_and_footers: Optional[bool]
129
+ """DEPRECATED: use `segment_processing.ignore` instead"""
130
+
131
+ target_length: int
132
+ """The target number of words in each chunk.
133
+
134
+ If 0, each chunk will contain a single segment.
135
+ """
136
+
137
+ tokenizer: ChunkProcessingTokenizer
138
+ """The tokenizer to use for the chunking process."""
139
+
140
+
141
+ class LlmProcessingFallbackStrategyModel(TypedDict, total=False):
142
+ model: Required[Annotated[str, PropertyInfo(alias="Model")]]
143
+ """Use a specific model as fallback"""
144
+
145
+
146
+ LlmProcessingFallbackStrategy: TypeAlias = Union[Literal["None", "Default"], LlmProcessingFallbackStrategyModel]
147
+
148
+
149
+ class LlmProcessing(TypedDict, total=False):
150
+ fallback_strategy: LlmProcessingFallbackStrategy
151
+ """The fallback strategy to use for the LLMs in the task."""
152
+
153
+ llm_model_id: Optional[str]
154
+ """The ID of the model to use for the task.
155
+
156
+ If not provided, the default model will be used. Please check the documentation
157
+ for the model you want to use.
158
+ """
159
+
160
+ max_completion_tokens: Optional[int]
161
+ """The maximum number of tokens to generate."""
162
+
163
+ temperature: float
164
+ """The temperature to use for the LLM."""
165
+
166
+
167
+ class SegmentProcessingCaption(TypedDict, total=False):
168
+ crop_image: Literal["All", "Auto"]
169
+ """Controls the cropping strategy for an item (e.g. segment, chunk, etc.)
170
+
171
+ - `All` crops all images in the item
172
+ - `Auto` crops images only if required for post-processing
173
+ """
174
+
175
+ description: bool
176
+ """Generate LLM descriptions for this segment"""
177
+
178
+ embed_sources: Optional[List[Literal["Content", "HTML", "Markdown", "LLM"]]]
179
+ """**DEPRECATED**: `embed` field is auto populated"""
180
+
181
+ extended_context: bool
182
+ """Use the full page image as context for LLM generation"""
183
+
184
+ format: Literal["Html", "Markdown"]
185
+
186
+ html: Optional[Literal["LLM", "Auto", "Ignore"]]
187
+ """**DEPRECATED**: Use `format: html` and `strategy` instead."""
188
+
189
+ llm: Optional[str]
190
+ """**DEPRECATED**: use description instead"""
191
+
192
+ markdown: Optional[Literal["LLM", "Auto", "Ignore"]]
193
+ """**DEPRECATED**: Use `format: markdown` and `strategy` instead."""
194
+
195
+ strategy: Literal["LLM", "Auto", "Ignore"]
196
+
197
+
198
+ class SegmentProcessingFootnote(TypedDict, total=False):
199
+ crop_image: Literal["All", "Auto"]
200
+ """Controls the cropping strategy for an item (e.g. segment, chunk, etc.)
201
+
202
+ - `All` crops all images in the item
203
+ - `Auto` crops images only if required for post-processing
204
+ """
205
+
206
+ description: bool
207
+ """Generate LLM descriptions for this segment"""
208
+
209
+ embed_sources: Optional[List[Literal["Content", "HTML", "Markdown", "LLM"]]]
210
+ """**DEPRECATED**: `embed` field is auto populated"""
211
+
212
+ extended_context: bool
213
+ """Use the full page image as context for LLM generation"""
214
+
215
+ format: Literal["Html", "Markdown"]
216
+
217
+ html: Optional[Literal["LLM", "Auto", "Ignore"]]
218
+ """**DEPRECATED**: Use `format: html` and `strategy` instead."""
219
+
220
+ llm: Optional[str]
221
+ """**DEPRECATED**: use description instead"""
222
+
223
+ markdown: Optional[Literal["LLM", "Auto", "Ignore"]]
224
+ """**DEPRECATED**: Use `format: markdown` and `strategy` instead."""
225
+
226
+ strategy: Literal["LLM", "Auto", "Ignore"]
227
+
228
+
229
+ class SegmentProcessingFormula(TypedDict, total=False):
230
+ crop_image: Literal["All", "Auto"]
231
+ """Controls the cropping strategy for an item (e.g. segment, chunk, etc.)
232
+
233
+ - `All` crops all images in the item
234
+ - `Auto` crops images only if required for post-processing
235
+ """
236
+
237
+ description: bool
238
+ """Generate LLM descriptions for this segment"""
239
+
240
+ embed_sources: Optional[List[Literal["Content", "HTML", "Markdown", "LLM"]]]
241
+ """**DEPRECATED**: `embed` field is auto populated"""
242
+
243
+ extended_context: bool
244
+ """Use the full page image as context for LLM generation"""
245
+
246
+ format: Literal["Html", "Markdown"]
247
+
248
+ html: Optional[Literal["LLM", "Auto", "Ignore"]]
249
+ """**DEPRECATED**: Use `format: html` and `strategy` instead."""
250
+
251
+ llm: Optional[str]
252
+ """**DEPRECATED**: use description instead"""
253
+
254
+ markdown: Optional[Literal["LLM", "Auto", "Ignore"]]
255
+ """**DEPRECATED**: Use `format: markdown` and `strategy` instead."""
256
+
257
+ strategy: Literal["LLM", "Auto", "Ignore"]
258
+
259
+
260
+ class SegmentProcessingListItem(TypedDict, total=False):
261
+ crop_image: Literal["All", "Auto"]
262
+ """Controls the cropping strategy for an item (e.g. segment, chunk, etc.)
263
+
264
+ - `All` crops all images in the item
265
+ - `Auto` crops images only if required for post-processing
266
+ """
267
+
268
+ description: bool
269
+ """Generate LLM descriptions for this segment"""
270
+
271
+ embed_sources: Optional[List[Literal["Content", "HTML", "Markdown", "LLM"]]]
272
+ """**DEPRECATED**: `embed` field is auto populated"""
273
+
274
+ extended_context: bool
275
+ """Use the full page image as context for LLM generation"""
276
+
277
+ format: Literal["Html", "Markdown"]
278
+
279
+ html: Optional[Literal["LLM", "Auto", "Ignore"]]
280
+ """**DEPRECATED**: Use `format: html` and `strategy` instead."""
281
+
282
+ llm: Optional[str]
283
+ """**DEPRECATED**: use description instead"""
284
+
285
+ markdown: Optional[Literal["LLM", "Auto", "Ignore"]]
286
+ """**DEPRECATED**: Use `format: markdown` and `strategy` instead."""
287
+
288
+ strategy: Literal["LLM", "Auto", "Ignore"]
289
+
290
+
291
+ class SegmentProcessingPage(TypedDict, total=False):
292
+ crop_image: Literal["All", "Auto"]
293
+ """Controls the cropping strategy for an item (e.g. segment, chunk, etc.)
294
+
295
+ - `All` crops all images in the item
296
+ - `Auto` crops images only if required for post-processing
297
+ """
298
+
299
+ description: bool
300
+ """Generate LLM descriptions for this segment"""
301
+
302
+ embed_sources: Optional[List[Literal["Content", "HTML", "Markdown", "LLM"]]]
303
+ """**DEPRECATED**: `embed` field is auto populated"""
304
+
305
+ extended_context: bool
306
+ """Use the full page image as context for LLM generation"""
307
+
308
+ format: Literal["Html", "Markdown"]
309
+
310
+ html: Optional[Literal["LLM", "Auto", "Ignore"]]
311
+ """**DEPRECATED**: Use `format: html` and `strategy` instead."""
312
+
313
+ llm: Optional[str]
314
+ """**DEPRECATED**: use description instead"""
315
+
316
+ markdown: Optional[Literal["LLM", "Auto", "Ignore"]]
317
+ """**DEPRECATED**: Use `format: markdown` and `strategy` instead."""
318
+
319
+ strategy: Literal["LLM", "Auto", "Ignore"]
320
+
321
+
322
+ class SegmentProcessingPageFooter(TypedDict, total=False):
323
+ crop_image: Literal["All", "Auto"]
324
+ """Controls the cropping strategy for an item (e.g. segment, chunk, etc.)
325
+
326
+ - `All` crops all images in the item
327
+ - `Auto` crops images only if required for post-processing
328
+ """
329
+
330
+ description: bool
331
+ """Generate LLM descriptions for this segment"""
332
+
333
+ embed_sources: Optional[List[Literal["Content", "HTML", "Markdown", "LLM"]]]
334
+ """**DEPRECATED**: `embed` field is auto populated"""
335
+
336
+ extended_context: bool
337
+ """Use the full page image as context for LLM generation"""
338
+
339
+ format: Literal["Html", "Markdown"]
340
+
341
+ html: Optional[Literal["LLM", "Auto", "Ignore"]]
342
+ """**DEPRECATED**: Use `format: html` and `strategy` instead."""
343
+
344
+ llm: Optional[str]
345
+ """**DEPRECATED**: use description instead"""
346
+
347
+ markdown: Optional[Literal["LLM", "Auto", "Ignore"]]
348
+ """**DEPRECATED**: Use `format: markdown` and `strategy` instead."""
349
+
350
+ strategy: Literal["LLM", "Auto", "Ignore"]
351
+
352
+
353
+ class SegmentProcessingPageHeader(TypedDict, total=False):
354
+ crop_image: Literal["All", "Auto"]
355
+ """Controls the cropping strategy for an item (e.g. segment, chunk, etc.)
356
+
357
+ - `All` crops all images in the item
358
+ - `Auto` crops images only if required for post-processing
359
+ """
360
+
361
+ description: bool
362
+ """Generate LLM descriptions for this segment"""
363
+
364
+ embed_sources: Optional[List[Literal["Content", "HTML", "Markdown", "LLM"]]]
365
+ """**DEPRECATED**: `embed` field is auto populated"""
366
+
367
+ extended_context: bool
368
+ """Use the full page image as context for LLM generation"""
369
+
370
+ format: Literal["Html", "Markdown"]
371
+
372
+ html: Optional[Literal["LLM", "Auto", "Ignore"]]
373
+ """**DEPRECATED**: Use `format: html` and `strategy` instead."""
374
+
375
+ llm: Optional[str]
376
+ """**DEPRECATED**: use description instead"""
377
+
378
+ markdown: Optional[Literal["LLM", "Auto", "Ignore"]]
379
+ """**DEPRECATED**: Use `format: markdown` and `strategy` instead."""
380
+
381
+ strategy: Literal["LLM", "Auto", "Ignore"]
382
+
383
+
384
+ class SegmentProcessingPicture(TypedDict, total=False):
385
+ crop_image: Literal["All", "Auto"]
386
+ """Controls the cropping strategy for an item (e.g. segment, chunk, etc.)
387
+
388
+ - `All` crops all images in the item
389
+ - `Auto` crops images only if required for post-processing
390
+ """
391
+
392
+ description: bool
393
+ """Generate LLM descriptions for this segment"""
394
+
395
+ embed_sources: Optional[List[Literal["Content", "HTML", "Markdown", "LLM"]]]
396
+ """**DEPRECATED**: `embed` field is auto populated"""
397
+
398
+ extended_context: bool
399
+ """Use the full page image as context for LLM generation"""
400
+
401
+ format: Literal["Html", "Markdown"]
402
+
403
+ html: Optional[Literal["LLM", "Auto", "Ignore"]]
404
+ """**DEPRECATED**: Use `format: html` and `strategy` instead."""
405
+
406
+ llm: Optional[str]
407
+ """**DEPRECATED**: use description instead"""
408
+
409
+ markdown: Optional[Literal["LLM", "Auto", "Ignore"]]
410
+ """**DEPRECATED**: Use `format: markdown` and `strategy` instead."""
411
+
412
+ strategy: Literal["LLM", "Auto", "Ignore"]
413
+
414
+
415
+ class SegmentProcessingSectionHeader(TypedDict, total=False):
416
+ crop_image: Literal["All", "Auto"]
417
+ """Controls the cropping strategy for an item (e.g. segment, chunk, etc.)
418
+
419
+ - `All` crops all images in the item
420
+ - `Auto` crops images only if required for post-processing
421
+ """
422
+
423
+ description: bool
424
+ """Generate LLM descriptions for this segment"""
425
+
426
+ embed_sources: Optional[List[Literal["Content", "HTML", "Markdown", "LLM"]]]
427
+ """**DEPRECATED**: `embed` field is auto populated"""
428
+
429
+ extended_context: bool
430
+ """Use the full page image as context for LLM generation"""
431
+
432
+ format: Literal["Html", "Markdown"]
433
+
434
+ html: Optional[Literal["LLM", "Auto", "Ignore"]]
435
+ """**DEPRECATED**: Use `format: html` and `strategy` instead."""
436
+
437
+ llm: Optional[str]
438
+ """**DEPRECATED**: use description instead"""
439
+
440
+ markdown: Optional[Literal["LLM", "Auto", "Ignore"]]
441
+ """**DEPRECATED**: Use `format: markdown` and `strategy` instead."""
442
+
443
+ strategy: Literal["LLM", "Auto", "Ignore"]
444
+
445
+
446
+ class SegmentProcessingTable(TypedDict, total=False):
447
+ crop_image: Literal["All", "Auto"]
448
+ """Controls the cropping strategy for an item (e.g. segment, chunk, etc.)
449
+
450
+ - `All` crops all images in the item
451
+ - `Auto` crops images only if required for post-processing
452
+ """
453
+
454
+ description: bool
455
+ """Generate LLM descriptions for this segment"""
456
+
457
+ embed_sources: Optional[List[Literal["Content", "HTML", "Markdown", "LLM"]]]
458
+ """**DEPRECATED**: `embed` field is auto populated"""
459
+
460
+ extended_context: bool
461
+ """Use the full page image as context for LLM generation"""
462
+
463
+ format: Literal["Html", "Markdown"]
464
+
465
+ html: Optional[Literal["LLM", "Auto", "Ignore"]]
466
+ """**DEPRECATED**: Use `format: html` and `strategy` instead."""
467
+
468
+ llm: Optional[str]
469
+ """**DEPRECATED**: use description instead"""
470
+
471
+ markdown: Optional[Literal["LLM", "Auto", "Ignore"]]
472
+ """**DEPRECATED**: Use `format: markdown` and `strategy` instead."""
473
+
474
+ strategy: Literal["LLM", "Auto", "Ignore"]
475
+
476
+
477
+ class SegmentProcessingText(TypedDict, total=False):
478
+ crop_image: Literal["All", "Auto"]
479
+ """Controls the cropping strategy for an item (e.g. segment, chunk, etc.)
480
+
481
+ - `All` crops all images in the item
482
+ - `Auto` crops images only if required for post-processing
483
+ """
484
+
485
+ description: bool
486
+ """Generate LLM descriptions for this segment"""
487
+
488
+ embed_sources: Optional[List[Literal["Content", "HTML", "Markdown", "LLM"]]]
489
+ """**DEPRECATED**: `embed` field is auto populated"""
490
+
491
+ extended_context: bool
492
+ """Use the full page image as context for LLM generation"""
493
+
494
+ format: Literal["Html", "Markdown"]
495
+
496
+ html: Optional[Literal["LLM", "Auto", "Ignore"]]
497
+ """**DEPRECATED**: Use `format: html` and `strategy` instead."""
498
+
499
+ llm: Optional[str]
500
+ """**DEPRECATED**: use description instead"""
501
+
502
+ markdown: Optional[Literal["LLM", "Auto", "Ignore"]]
503
+ """**DEPRECATED**: Use `format: markdown` and `strategy` instead."""
504
+
505
+ strategy: Literal["LLM", "Auto", "Ignore"]
506
+
507
+
508
+ class SegmentProcessingTitle(TypedDict, total=False):
509
+ crop_image: Literal["All", "Auto"]
510
+ """Controls the cropping strategy for an item (e.g. segment, chunk, etc.)
511
+
512
+ - `All` crops all images in the item
513
+ - `Auto` crops images only if required for post-processing
514
+ """
515
+
516
+ description: bool
517
+ """Generate LLM descriptions for this segment"""
518
+
519
+ embed_sources: Optional[List[Literal["Content", "HTML", "Markdown", "LLM"]]]
520
+ """**DEPRECATED**: `embed` field is auto populated"""
521
+
522
+ extended_context: bool
523
+ """Use the full page image as context for LLM generation"""
524
+
525
+ format: Literal["Html", "Markdown"]
526
+
527
+ html: Optional[Literal["LLM", "Auto", "Ignore"]]
528
+ """**DEPRECATED**: Use `format: html` and `strategy` instead."""
529
+
530
+ llm: Optional[str]
531
+ """**DEPRECATED**: use description instead"""
532
+
533
+ markdown: Optional[Literal["LLM", "Auto", "Ignore"]]
534
+ """**DEPRECATED**: Use `format: markdown` and `strategy` instead."""
535
+
536
+ strategy: Literal["LLM", "Auto", "Ignore"]
537
+
538
+
539
+ class SegmentProcessing(TypedDict, total=False):
540
+ caption: Annotated[Optional[SegmentProcessingCaption], PropertyInfo(alias="Caption")]
541
+ """Controls the processing and generation for the segment.
542
+
543
+ - `crop_image` controls whether to crop the file's images to the segment's
544
+ bounding box. The cropped image will be stored in the segment's `image` field.
545
+ Use `All` to always crop, or `Auto` to only crop when needed for
546
+ post-processing.
547
+ - `format` specifies the output format: `Html` or `Markdown`
548
+ - `strategy` determines how the content is generated: `Auto`, `LLM`, or `Ignore`
549
+ - `Auto`: Process content automatically
550
+ - `LLM`: Use large language models for processing
551
+ - `Ignore`: Exclude segments from final output
552
+ - `description` enables LLM-generated descriptions for segments. **Note:** This
553
+ uses chunkr's own VLM models and is not configurable via LLM processing
554
+ configuration.
555
+ - `extended_context` uses the full page image as context for LLM generation.
556
+
557
+ **Deprecated fields (for backwards compatibility):**
558
+
559
+ - `llm` - **DEPRECATED**: Use `description` instead
560
+ - `embed_sources` - **DEPRECATED**: Embed field is auto-populated
561
+ - `html` - **DEPRECATED**: Use `format: Html` and `strategy` instead
562
+ - `markdown` - **DEPRECATED**: Use `format: Markdown` and `strategy` instead
563
+ """
564
+
565
+ footnote: Annotated[Optional[SegmentProcessingFootnote], PropertyInfo(alias="Footnote")]
566
+ """Controls the processing and generation for the segment.
567
+
568
+ - `crop_image` controls whether to crop the file's images to the segment's
569
+ bounding box. The cropped image will be stored in the segment's `image` field.
570
+ Use `All` to always crop, or `Auto` to only crop when needed for
571
+ post-processing.
572
+ - `format` specifies the output format: `Html` or `Markdown`
573
+ - `strategy` determines how the content is generated: `Auto`, `LLM`, or `Ignore`
574
+ - `Auto`: Process content automatically
575
+ - `LLM`: Use large language models for processing
576
+ - `Ignore`: Exclude segments from final output
577
+ - `description` enables LLM-generated descriptions for segments. **Note:** This
578
+ uses chunkr's own VLM models and is not configurable via LLM processing
579
+ configuration.
580
+ - `extended_context` uses the full page image as context for LLM generation.
581
+
582
+ **Deprecated fields (for backwards compatibility):**
583
+
584
+ - `llm` - **DEPRECATED**: Use `description` instead
585
+ - `embed_sources` - **DEPRECATED**: Embed field is auto-populated
586
+ - `html` - **DEPRECATED**: Use `format: Html` and `strategy` instead
587
+ - `markdown` - **DEPRECATED**: Use `format: Markdown` and `strategy` instead
588
+ """
589
+
590
+ formula: Annotated[Optional[SegmentProcessingFormula], PropertyInfo(alias="Formula")]
591
+ """Controls the processing and generation for the segment.
592
+
593
+ - `crop_image` controls whether to crop the file's images to the segment's
594
+ bounding box. The cropped image will be stored in the segment's `image` field.
595
+ Use `All` to always crop, or `Auto` to only crop when needed for
596
+ post-processing.
597
+ - `format` specifies the output format: `Html` or `Markdown`
598
+ - `strategy` determines how the content is generated: `Auto`, `LLM`, or `Ignore`
599
+ - `Auto`: Process content automatically
600
+ - `LLM`: Use large language models for processing
601
+ - `Ignore`: Exclude segments from final output
602
+ - `description` enables LLM-generated descriptions for segments. **Note:** This
603
+ uses chunkr's own VLM models and is not configurable via LLM processing
604
+ configuration.
605
+ - `extended_context` uses the full page image as context for LLM generation.
606
+
607
+ **Deprecated fields (for backwards compatibility):**
608
+
609
+ - `llm` - **DEPRECATED**: Use `description` instead
610
+ - `embed_sources` - **DEPRECATED**: Embed field is auto-populated
611
+ - `html` - **DEPRECATED**: Use `format: Html` and `strategy` instead
612
+ - `markdown` - **DEPRECATED**: Use `format: Markdown` and `strategy` instead
613
+ """
614
+
615
+ list_item: Annotated[Optional[SegmentProcessingListItem], PropertyInfo(alias="ListItem")]
616
+ """Controls the processing and generation for the segment.
617
+
618
+ - `crop_image` controls whether to crop the file's images to the segment's
619
+ bounding box. The cropped image will be stored in the segment's `image` field.
620
+ Use `All` to always crop, or `Auto` to only crop when needed for
621
+ post-processing.
622
+ - `format` specifies the output format: `Html` or `Markdown`
623
+ - `strategy` determines how the content is generated: `Auto`, `LLM`, or `Ignore`
624
+ - `Auto`: Process content automatically
625
+ - `LLM`: Use large language models for processing
626
+ - `Ignore`: Exclude segments from final output
627
+ - `description` enables LLM-generated descriptions for segments. **Note:** This
628
+ uses chunkr's own VLM models and is not configurable via LLM processing
629
+ configuration.
630
+ - `extended_context` uses the full page image as context for LLM generation.
631
+
632
+ **Deprecated fields (for backwards compatibility):**
633
+
634
+ - `llm` - **DEPRECATED**: Use `description` instead
635
+ - `embed_sources` - **DEPRECATED**: Embed field is auto-populated
636
+ - `html` - **DEPRECATED**: Use `format: Html` and `strategy` instead
637
+ - `markdown` - **DEPRECATED**: Use `format: Markdown` and `strategy` instead
638
+ """
639
+
640
+ page: Annotated[Optional[SegmentProcessingPage], PropertyInfo(alias="Page")]
641
+ """Controls the processing and generation for the segment.
642
+
643
+ - `crop_image` controls whether to crop the file's images to the segment's
644
+ bounding box. The cropped image will be stored in the segment's `image` field.
645
+ Use `All` to always crop, or `Auto` to only crop when needed for
646
+ post-processing.
647
+ - `format` specifies the output format: `Html` or `Markdown`
648
+ - `strategy` determines how the content is generated: `Auto`, `LLM`, or `Ignore`
649
+ - `Auto`: Process content automatically
650
+ - `LLM`: Use large language models for processing
651
+ - `Ignore`: Exclude segments from final output
652
+ - `description` enables LLM-generated descriptions for segments. **Note:** This
653
+ uses chunkr's own VLM models and is not configurable via LLM processing
654
+ configuration.
655
+ - `extended_context` uses the full page image as context for LLM generation.
656
+
657
+ **Deprecated fields (for backwards compatibility):**
658
+
659
+ - `llm` - **DEPRECATED**: Use `description` instead
660
+ - `embed_sources` - **DEPRECATED**: Embed field is auto-populated
661
+ - `html` - **DEPRECATED**: Use `format: Html` and `strategy` instead
662
+ - `markdown` - **DEPRECATED**: Use `format: Markdown` and `strategy` instead
663
+ """
664
+
665
+ page_footer: Annotated[Optional[SegmentProcessingPageFooter], PropertyInfo(alias="PageFooter")]
666
+ """Controls the processing and generation for the segment.
667
+
668
+ - `crop_image` controls whether to crop the file's images to the segment's
669
+ bounding box. The cropped image will be stored in the segment's `image` field.
670
+ Use `All` to always crop, or `Auto` to only crop when needed for
671
+ post-processing.
672
+ - `format` specifies the output format: `Html` or `Markdown`
673
+ - `strategy` determines how the content is generated: `Auto`, `LLM`, or `Ignore`
674
+ - `Auto`: Process content automatically
675
+ - `LLM`: Use large language models for processing
676
+ - `Ignore`: Exclude segments from final output
677
+ - `description` enables LLM-generated descriptions for segments. **Note:** This
678
+ uses chunkr's own VLM models and is not configurable via LLM processing
679
+ configuration.
680
+ - `extended_context` uses the full page image as context for LLM generation.
681
+
682
+ **Deprecated fields (for backwards compatibility):**
683
+
684
+ - `llm` - **DEPRECATED**: Use `description` instead
685
+ - `embed_sources` - **DEPRECATED**: Embed field is auto-populated
686
+ - `html` - **DEPRECATED**: Use `format: Html` and `strategy` instead
687
+ - `markdown` - **DEPRECATED**: Use `format: Markdown` and `strategy` instead
688
+ """
689
+
690
+ page_header: Annotated[Optional[SegmentProcessingPageHeader], PropertyInfo(alias="PageHeader")]
691
+ """Controls the processing and generation for the segment.
692
+
693
+ - `crop_image` controls whether to crop the file's images to the segment's
694
+ bounding box. The cropped image will be stored in the segment's `image` field.
695
+ Use `All` to always crop, or `Auto` to only crop when needed for
696
+ post-processing.
697
+ - `format` specifies the output format: `Html` or `Markdown`
698
+ - `strategy` determines how the content is generated: `Auto`, `LLM`, or `Ignore`
699
+ - `Auto`: Process content automatically
700
+ - `LLM`: Use large language models for processing
701
+ - `Ignore`: Exclude segments from final output
702
+ - `description` enables LLM-generated descriptions for segments. **Note:** This
703
+ uses chunkr's own VLM models and is not configurable via LLM processing
704
+ configuration.
705
+ - `extended_context` uses the full page image as context for LLM generation.
706
+
707
+ **Deprecated fields (for backwards compatibility):**
708
+
709
+ - `llm` - **DEPRECATED**: Use `description` instead
710
+ - `embed_sources` - **DEPRECATED**: Embed field is auto-populated
711
+ - `html` - **DEPRECATED**: Use `format: Html` and `strategy` instead
712
+ - `markdown` - **DEPRECATED**: Use `format: Markdown` and `strategy` instead
713
+ """
714
+
715
+ picture: Annotated[Optional[SegmentProcessingPicture], PropertyInfo(alias="Picture")]
716
+ """Controls the processing and generation for the segment.
717
+
718
+ - `crop_image` controls whether to crop the file's images to the segment's
719
+ bounding box. The cropped image will be stored in the segment's `image` field.
720
+ Use `All` to always crop, or `Auto` to only crop when needed for
721
+ post-processing.
722
+ - `format` specifies the output format: `Html` or `Markdown`
723
+ - `strategy` determines how the content is generated: `Auto`, `LLM`, or `Ignore`
724
+ - `Auto`: Process content automatically
725
+ - `LLM`: Use large language models for processing
726
+ - `Ignore`: Exclude segments from final output
727
+ - `description` enables LLM-generated descriptions for segments. **Note:** This
728
+ uses chunkr's own VLM models and is not configurable via LLM processing
729
+ configuration.
730
+ - `extended_context` uses the full page image as context for LLM generation.
731
+
732
+ **Deprecated fields (for backwards compatibility):**
733
+
734
+ - `llm` - **DEPRECATED**: Use `description` instead
735
+ - `embed_sources` - **DEPRECATED**: Embed field is auto-populated
736
+ - `html` - **DEPRECATED**: Use `format: Html` and `strategy` instead
737
+ - `markdown` - **DEPRECATED**: Use `format: Markdown` and `strategy` instead
738
+ """
739
+
740
+ section_header: Annotated[Optional[SegmentProcessingSectionHeader], PropertyInfo(alias="SectionHeader")]
741
+ """Controls the processing and generation for the segment.
742
+
743
+ - `crop_image` controls whether to crop the file's images to the segment's
744
+ bounding box. The cropped image will be stored in the segment's `image` field.
745
+ Use `All` to always crop, or `Auto` to only crop when needed for
746
+ post-processing.
747
+ - `format` specifies the output format: `Html` or `Markdown`
748
+ - `strategy` determines how the content is generated: `Auto`, `LLM`, or `Ignore`
749
+ - `Auto`: Process content automatically
750
+ - `LLM`: Use large language models for processing
751
+ - `Ignore`: Exclude segments from final output
752
+ - `description` enables LLM-generated descriptions for segments. **Note:** This
753
+ uses chunkr's own VLM models and is not configurable via LLM processing
754
+ configuration.
755
+ - `extended_context` uses the full page image as context for LLM generation.
756
+
757
+ **Deprecated fields (for backwards compatibility):**
758
+
759
+ - `llm` - **DEPRECATED**: Use `description` instead
760
+ - `embed_sources` - **DEPRECATED**: Embed field is auto-populated
761
+ - `html` - **DEPRECATED**: Use `format: Html` and `strategy` instead
762
+ - `markdown` - **DEPRECATED**: Use `format: Markdown` and `strategy` instead
763
+ """
764
+
765
+ table: Annotated[Optional[SegmentProcessingTable], PropertyInfo(alias="Table")]
766
+ """Controls the processing and generation for the segment.
767
+
768
+ - `crop_image` controls whether to crop the file's images to the segment's
769
+ bounding box. The cropped image will be stored in the segment's `image` field.
770
+ Use `All` to always crop, or `Auto` to only crop when needed for
771
+ post-processing.
772
+ - `format` specifies the output format: `Html` or `Markdown`
773
+ - `strategy` determines how the content is generated: `Auto`, `LLM`, or `Ignore`
774
+ - `Auto`: Process content automatically
775
+ - `LLM`: Use large language models for processing
776
+ - `Ignore`: Exclude segments from final output
777
+ - `description` enables LLM-generated descriptions for segments. **Note:** This
778
+ uses chunkr's own VLM models and is not configurable via LLM processing
779
+ configuration.
780
+ - `extended_context` uses the full page image as context for LLM generation.
781
+
782
+ **Deprecated fields (for backwards compatibility):**
783
+
784
+ - `llm` - **DEPRECATED**: Use `description` instead
785
+ - `embed_sources` - **DEPRECATED**: Embed field is auto-populated
786
+ - `html` - **DEPRECATED**: Use `format: Html` and `strategy` instead
787
+ - `markdown` - **DEPRECATED**: Use `format: Markdown` and `strategy` instead
788
+ """
789
+
790
+ text: Annotated[Optional[SegmentProcessingText], PropertyInfo(alias="Text")]
791
+ """Controls the processing and generation for the segment.
792
+
793
+ - `crop_image` controls whether to crop the file's images to the segment's
794
+ bounding box. The cropped image will be stored in the segment's `image` field.
795
+ Use `All` to always crop, or `Auto` to only crop when needed for
796
+ post-processing.
797
+ - `format` specifies the output format: `Html` or `Markdown`
798
+ - `strategy` determines how the content is generated: `Auto`, `LLM`, or `Ignore`
799
+ - `Auto`: Process content automatically
800
+ - `LLM`: Use large language models for processing
801
+ - `Ignore`: Exclude segments from final output
802
+ - `description` enables LLM-generated descriptions for segments. **Note:** This
803
+ uses chunkr's own VLM models and is not configurable via LLM processing
804
+ configuration.
805
+ - `extended_context` uses the full page image as context for LLM generation.
806
+
807
+ **Deprecated fields (for backwards compatibility):**
808
+
809
+ - `llm` - **DEPRECATED**: Use `description` instead
810
+ - `embed_sources` - **DEPRECATED**: Embed field is auto-populated
811
+ - `html` - **DEPRECATED**: Use `format: Html` and `strategy` instead
812
+ - `markdown` - **DEPRECATED**: Use `format: Markdown` and `strategy` instead
813
+ """
814
+
815
+ title: Annotated[Optional[SegmentProcessingTitle], PropertyInfo(alias="Title")]
816
+ """Controls the processing and generation for the segment.
817
+
818
+ - `crop_image` controls whether to crop the file's images to the segment's
819
+ bounding box. The cropped image will be stored in the segment's `image` field.
820
+ Use `All` to always crop, or `Auto` to only crop when needed for
821
+ post-processing.
822
+ - `format` specifies the output format: `Html` or `Markdown`
823
+ - `strategy` determines how the content is generated: `Auto`, `LLM`, or `Ignore`
824
+ - `Auto`: Process content automatically
825
+ - `LLM`: Use large language models for processing
826
+ - `Ignore`: Exclude segments from final output
827
+ - `description` enables LLM-generated descriptions for segments. **Note:** This
828
+ uses chunkr's own VLM models and is not configurable via LLM processing
829
+ configuration.
830
+ - `extended_context` uses the full page image as context for LLM generation.
831
+
832
+ **Deprecated fields (for backwards compatibility):**
833
+
834
+ - `llm` - **DEPRECATED**: Use `description` instead
835
+ - `embed_sources` - **DEPRECATED**: Embed field is auto-populated
836
+ - `html` - **DEPRECATED**: Use `format: Html` and `strategy` instead
837
+ - `markdown` - **DEPRECATED**: Use `format: Markdown` and `strategy` instead
838
+ """