chunkr-ai 0.1.0a7__py3-none-any.whl → 0.1.0a9__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.
- chunkr_ai/__init__.py +3 -1
- chunkr_ai/_base_client.py +12 -12
- chunkr_ai/_client.py +8 -8
- chunkr_ai/_compat.py +48 -48
- chunkr_ai/_models.py +50 -44
- chunkr_ai/_qs.py +7 -7
- chunkr_ai/_types.py +18 -11
- chunkr_ai/_utils/__init__.py +8 -2
- chunkr_ai/_utils/_compat.py +45 -0
- chunkr_ai/_utils/_datetime_parse.py +136 -0
- chunkr_ai/_utils/_transform.py +13 -3
- chunkr_ai/_utils/_typing.py +1 -1
- chunkr_ai/_utils/_utils.py +4 -5
- chunkr_ai/_version.py +1 -1
- chunkr_ai/resources/files.py +29 -29
- chunkr_ai/resources/health.py +3 -3
- chunkr_ai/resources/tasks/extract.py +21 -37
- chunkr_ai/resources/tasks/parse.py +29 -54
- chunkr_ai/resources/tasks/tasks.py +35 -51
- chunkr_ai/resources/webhooks.py +3 -3
- chunkr_ai/types/__init__.py +0 -2
- chunkr_ai/types/extract_output_response.py +45 -2
- chunkr_ai/types/file_info.py +3 -0
- chunkr_ai/types/ocr_result.py +6 -6
- chunkr_ai/types/parse_configuration.py +0 -4
- chunkr_ai/types/parse_configuration_param.py +0 -4
- chunkr_ai/types/segment.py +8 -5
- chunkr_ai/types/segment_processing.py +92 -2
- chunkr_ai/types/segment_processing_param.py +92 -2
- chunkr_ai/types/task_get_params.py +0 -3
- chunkr_ai/types/tasks/extract_create_response.py +0 -147
- chunkr_ai/types/tasks/extract_get_params.py +0 -3
- chunkr_ai/types/tasks/extract_get_response.py +0 -147
- chunkr_ai/types/tasks/parse_create_params.py +0 -4
- chunkr_ai/types/tasks/parse_get_params.py +0 -3
- chunkr_ai/types/version_info.py +1 -1
- {chunkr_ai-0.1.0a7.dist-info → chunkr_ai-0.1.0a9.dist-info}/METADATA +1 -1
- {chunkr_ai-0.1.0a7.dist-info → chunkr_ai-0.1.0a9.dist-info}/RECORD +40 -40
- chunkr_ai/types/llm_processing.py +0 -36
- chunkr_ai/types/llm_processing_param.py +0 -36
- {chunkr_ai-0.1.0a7.dist-info → chunkr_ai-0.1.0a9.dist-info}/WHEEL +0 -0
- {chunkr_ai-0.1.0a7.dist-info → chunkr_ai-0.1.0a9.dist-info}/licenses/LICENSE +0 -0
@@ -6,7 +6,7 @@ from typing import Optional
|
|
6
6
|
|
7
7
|
import httpx
|
8
8
|
|
9
|
-
from ..._types import
|
9
|
+
from ..._types import Body, Omit, Query, Headers, NotGiven, omit, not_given
|
10
10
|
from ..._utils import maybe_transform, async_maybe_transform
|
11
11
|
from ..._compat import cached_property
|
12
12
|
from ..._resource import SyncAPIResource, AsyncAPIResource
|
@@ -50,16 +50,16 @@ class ExtractResource(SyncAPIResource):
|
|
50
50
|
*,
|
51
51
|
file: str,
|
52
52
|
schema: object,
|
53
|
-
expires_in: Optional[int] |
|
54
|
-
file_name: Optional[str] |
|
55
|
-
parse_configuration: Optional[ParseConfigurationParam] |
|
56
|
-
system_prompt: Optional[str] |
|
53
|
+
expires_in: Optional[int] | Omit = omit,
|
54
|
+
file_name: Optional[str] | Omit = omit,
|
55
|
+
parse_configuration: Optional[ParseConfigurationParam] | Omit = omit,
|
56
|
+
system_prompt: Optional[str] | Omit = omit,
|
57
57
|
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
58
58
|
# The extra values given here take precedence over values defined on the client or passed to this method.
|
59
59
|
extra_headers: Headers | None = None,
|
60
60
|
extra_query: Query | None = None,
|
61
61
|
extra_body: Body | None = None,
|
62
|
-
timeout: float | httpx.Timeout | None | NotGiven =
|
62
|
+
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
63
63
|
idempotency_key: str | None = None,
|
64
64
|
) -> ExtractCreateResponse:
|
65
65
|
"""
|
@@ -129,25 +129,20 @@ class ExtractResource(SyncAPIResource):
|
|
129
129
|
self,
|
130
130
|
task_id: Optional[str],
|
131
131
|
*,
|
132
|
-
base64_urls: bool |
|
133
|
-
include_chunks: bool |
|
134
|
-
wait_for_completion: bool | NotGiven = NOT_GIVEN,
|
132
|
+
base64_urls: bool | Omit = omit,
|
133
|
+
include_chunks: bool | Omit = omit,
|
135
134
|
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
136
135
|
# The extra values given here take precedence over values defined on the client or passed to this method.
|
137
136
|
extra_headers: Headers | None = None,
|
138
137
|
extra_query: Query | None = None,
|
139
138
|
extra_body: Body | None = None,
|
140
|
-
timeout: float | httpx.Timeout | None | NotGiven =
|
139
|
+
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
141
140
|
) -> ExtractGetResponse:
|
142
141
|
"""
|
143
|
-
Retrieves the current state of an extract task
|
144
|
-
completion.
|
142
|
+
Retrieves the current state of an extract task.
|
145
143
|
|
146
144
|
Returns task details such as processing status, configuration, output (when
|
147
|
-
available), file metadata, and timestamps.
|
148
|
-
provided, the server will hold the request briefly. If the task does not reach a
|
149
|
-
terminal state during that window, the response will indicate a retry with
|
150
|
-
appropriate headers.
|
145
|
+
available), file metadata, and timestamps.
|
151
146
|
|
152
147
|
Typical uses:
|
153
148
|
|
@@ -161,8 +156,6 @@ class ExtractResource(SyncAPIResource):
|
|
161
156
|
|
162
157
|
include_chunks: Whether to include chunks in the output response
|
163
158
|
|
164
|
-
wait_for_completion: Whether to wait for the task to complete
|
165
|
-
|
166
159
|
extra_headers: Send extra headers
|
167
160
|
|
168
161
|
extra_query: Add additional query parameters to the request
|
@@ -184,7 +177,6 @@ class ExtractResource(SyncAPIResource):
|
|
184
177
|
{
|
185
178
|
"base64_urls": base64_urls,
|
186
179
|
"include_chunks": include_chunks,
|
187
|
-
"wait_for_completion": wait_for_completion,
|
188
180
|
},
|
189
181
|
extract_get_params.ExtractGetParams,
|
190
182
|
),
|
@@ -218,16 +210,16 @@ class AsyncExtractResource(AsyncAPIResource):
|
|
218
210
|
*,
|
219
211
|
file: str,
|
220
212
|
schema: object,
|
221
|
-
expires_in: Optional[int] |
|
222
|
-
file_name: Optional[str] |
|
223
|
-
parse_configuration: Optional[ParseConfigurationParam] |
|
224
|
-
system_prompt: Optional[str] |
|
213
|
+
expires_in: Optional[int] | Omit = omit,
|
214
|
+
file_name: Optional[str] | Omit = omit,
|
215
|
+
parse_configuration: Optional[ParseConfigurationParam] | Omit = omit,
|
216
|
+
system_prompt: Optional[str] | Omit = omit,
|
225
217
|
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
226
218
|
# The extra values given here take precedence over values defined on the client or passed to this method.
|
227
219
|
extra_headers: Headers | None = None,
|
228
220
|
extra_query: Query | None = None,
|
229
221
|
extra_body: Body | None = None,
|
230
|
-
timeout: float | httpx.Timeout | None | NotGiven =
|
222
|
+
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
231
223
|
idempotency_key: str | None = None,
|
232
224
|
) -> ExtractCreateResponse:
|
233
225
|
"""
|
@@ -297,25 +289,20 @@ class AsyncExtractResource(AsyncAPIResource):
|
|
297
289
|
self,
|
298
290
|
task_id: Optional[str],
|
299
291
|
*,
|
300
|
-
base64_urls: bool |
|
301
|
-
include_chunks: bool |
|
302
|
-
wait_for_completion: bool | NotGiven = NOT_GIVEN,
|
292
|
+
base64_urls: bool | Omit = omit,
|
293
|
+
include_chunks: bool | Omit = omit,
|
303
294
|
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
304
295
|
# The extra values given here take precedence over values defined on the client or passed to this method.
|
305
296
|
extra_headers: Headers | None = None,
|
306
297
|
extra_query: Query | None = None,
|
307
298
|
extra_body: Body | None = None,
|
308
|
-
timeout: float | httpx.Timeout | None | NotGiven =
|
299
|
+
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
309
300
|
) -> ExtractGetResponse:
|
310
301
|
"""
|
311
|
-
Retrieves the current state of an extract task
|
312
|
-
completion.
|
302
|
+
Retrieves the current state of an extract task.
|
313
303
|
|
314
304
|
Returns task details such as processing status, configuration, output (when
|
315
|
-
available), file metadata, and timestamps.
|
316
|
-
provided, the server will hold the request briefly. If the task does not reach a
|
317
|
-
terminal state during that window, the response will indicate a retry with
|
318
|
-
appropriate headers.
|
305
|
+
available), file metadata, and timestamps.
|
319
306
|
|
320
307
|
Typical uses:
|
321
308
|
|
@@ -329,8 +316,6 @@ class AsyncExtractResource(AsyncAPIResource):
|
|
329
316
|
|
330
317
|
include_chunks: Whether to include chunks in the output response
|
331
318
|
|
332
|
-
wait_for_completion: Whether to wait for the task to complete
|
333
|
-
|
334
319
|
extra_headers: Send extra headers
|
335
320
|
|
336
321
|
extra_query: Add additional query parameters to the request
|
@@ -352,7 +337,6 @@ class AsyncExtractResource(AsyncAPIResource):
|
|
352
337
|
{
|
353
338
|
"base64_urls": base64_urls,
|
354
339
|
"include_chunks": include_chunks,
|
355
|
-
"wait_for_completion": wait_for_completion,
|
356
340
|
},
|
357
341
|
extract_get_params.ExtractGetParams,
|
358
342
|
),
|
@@ -7,7 +7,7 @@ from typing_extensions import Literal
|
|
7
7
|
|
8
8
|
import httpx
|
9
9
|
|
10
|
-
from ..._types import
|
10
|
+
from ..._types import Body, Omit, Query, Headers, NotGiven, omit, not_given
|
11
11
|
from ..._utils import maybe_transform, async_maybe_transform
|
12
12
|
from ..._compat import cached_property
|
13
13
|
from ..._resource import SyncAPIResource, AsyncAPIResource
|
@@ -19,7 +19,6 @@ from ..._response import (
|
|
19
19
|
)
|
20
20
|
from ...types.tasks import parse_get_params, parse_create_params
|
21
21
|
from ..._base_client import make_request_options
|
22
|
-
from ...types.llm_processing_param import LlmProcessingParam
|
23
22
|
from ...types.chunk_processing_param import ChunkProcessingParam
|
24
23
|
from ...types.segment_processing_param import SegmentProcessingParam
|
25
24
|
from ...types.tasks.parse_get_response import ParseGetResponse
|
@@ -52,21 +51,20 @@ class ParseResource(SyncAPIResource):
|
|
52
51
|
self,
|
53
52
|
*,
|
54
53
|
file: str,
|
55
|
-
chunk_processing: ChunkProcessingParam |
|
56
|
-
error_handling: Literal["Fail", "Continue"] |
|
57
|
-
expires_in: Optional[int] |
|
58
|
-
file_name: Optional[str] |
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
segmentation_strategy: Literal["LayoutAnalysis", "Page"] | NotGiven = NOT_GIVEN,
|
54
|
+
chunk_processing: ChunkProcessingParam | Omit = omit,
|
55
|
+
error_handling: Literal["Fail", "Continue"] | Omit = omit,
|
56
|
+
expires_in: Optional[int] | Omit = omit,
|
57
|
+
file_name: Optional[str] | Omit = omit,
|
58
|
+
ocr_strategy: Literal["All", "Auto"] | Omit = omit,
|
59
|
+
pipeline: Literal["Azure", "Chunkr"] | Omit = omit,
|
60
|
+
segment_processing: Optional[SegmentProcessingParam] | Omit = omit,
|
61
|
+
segmentation_strategy: Literal["LayoutAnalysis", "Page"] | Omit = omit,
|
64
62
|
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
65
63
|
# The extra values given here take precedence over values defined on the client or passed to this method.
|
66
64
|
extra_headers: Headers | None = None,
|
67
65
|
extra_query: Query | None = None,
|
68
66
|
extra_body: Body | None = None,
|
69
|
-
timeout: float | httpx.Timeout | None | NotGiven =
|
67
|
+
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
70
68
|
idempotency_key: str | None = None,
|
71
69
|
) -> ParseCreateResponse:
|
72
70
|
"""
|
@@ -99,8 +97,6 @@ class ParseResource(SyncAPIResource):
|
|
99
97
|
|
100
98
|
file_name: The name of the file to be parsed. If not set a name will be generated.
|
101
99
|
|
102
|
-
llm_processing: Controls the LLM used for the task.
|
103
|
-
|
104
100
|
ocr_strategy: Controls the Optical Character Recognition (OCR) strategy.
|
105
101
|
|
106
102
|
- `All`: Processes all pages with OCR. (Latency penalty: ~0.5 seconds per page)
|
@@ -150,7 +146,6 @@ class ParseResource(SyncAPIResource):
|
|
150
146
|
"error_handling": error_handling,
|
151
147
|
"expires_in": expires_in,
|
152
148
|
"file_name": file_name,
|
153
|
-
"llm_processing": llm_processing,
|
154
149
|
"ocr_strategy": ocr_strategy,
|
155
150
|
"pipeline": pipeline,
|
156
151
|
"segment_processing": segment_processing,
|
@@ -172,25 +167,20 @@ class ParseResource(SyncAPIResource):
|
|
172
167
|
self,
|
173
168
|
task_id: Optional[str],
|
174
169
|
*,
|
175
|
-
base64_urls: bool |
|
176
|
-
include_chunks: bool |
|
177
|
-
wait_for_completion: bool | NotGiven = NOT_GIVEN,
|
170
|
+
base64_urls: bool | Omit = omit,
|
171
|
+
include_chunks: bool | Omit = omit,
|
178
172
|
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
179
173
|
# The extra values given here take precedence over values defined on the client or passed to this method.
|
180
174
|
extra_headers: Headers | None = None,
|
181
175
|
extra_query: Query | None = None,
|
182
176
|
extra_body: Body | None = None,
|
183
|
-
timeout: float | httpx.Timeout | None | NotGiven =
|
177
|
+
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
184
178
|
) -> ParseGetResponse:
|
185
179
|
"""
|
186
|
-
Retrieves the current state of a parse task
|
187
|
-
completion.
|
180
|
+
Retrieves the current state of a parse task.
|
188
181
|
|
189
182
|
Returns task details such as processing status, configuration, output (when
|
190
|
-
available), file metadata, and timestamps.
|
191
|
-
provided, the server will hold the request briefly. If the task does not reach a
|
192
|
-
terminal state during that window, the response will indicate a retry with
|
193
|
-
appropriate headers.
|
183
|
+
available), file metadata, and timestamps.
|
194
184
|
|
195
185
|
Typical uses:
|
196
186
|
|
@@ -204,8 +194,6 @@ class ParseResource(SyncAPIResource):
|
|
204
194
|
|
205
195
|
include_chunks: Whether to include chunks in the output response
|
206
196
|
|
207
|
-
wait_for_completion: Whether to wait for the task to complete
|
208
|
-
|
209
197
|
extra_headers: Send extra headers
|
210
198
|
|
211
199
|
extra_query: Add additional query parameters to the request
|
@@ -227,7 +215,6 @@ class ParseResource(SyncAPIResource):
|
|
227
215
|
{
|
228
216
|
"base64_urls": base64_urls,
|
229
217
|
"include_chunks": include_chunks,
|
230
|
-
"wait_for_completion": wait_for_completion,
|
231
218
|
},
|
232
219
|
parse_get_params.ParseGetParams,
|
233
220
|
),
|
@@ -260,21 +247,20 @@ class AsyncParseResource(AsyncAPIResource):
|
|
260
247
|
self,
|
261
248
|
*,
|
262
249
|
file: str,
|
263
|
-
chunk_processing: ChunkProcessingParam |
|
264
|
-
error_handling: Literal["Fail", "Continue"] |
|
265
|
-
expires_in: Optional[int] |
|
266
|
-
file_name: Optional[str] |
|
267
|
-
|
268
|
-
|
269
|
-
|
270
|
-
|
271
|
-
segmentation_strategy: Literal["LayoutAnalysis", "Page"] | NotGiven = NOT_GIVEN,
|
250
|
+
chunk_processing: ChunkProcessingParam | Omit = omit,
|
251
|
+
error_handling: Literal["Fail", "Continue"] | Omit = omit,
|
252
|
+
expires_in: Optional[int] | Omit = omit,
|
253
|
+
file_name: Optional[str] | Omit = omit,
|
254
|
+
ocr_strategy: Literal["All", "Auto"] | Omit = omit,
|
255
|
+
pipeline: Literal["Azure", "Chunkr"] | Omit = omit,
|
256
|
+
segment_processing: Optional[SegmentProcessingParam] | Omit = omit,
|
257
|
+
segmentation_strategy: Literal["LayoutAnalysis", "Page"] | Omit = omit,
|
272
258
|
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
273
259
|
# The extra values given here take precedence over values defined on the client or passed to this method.
|
274
260
|
extra_headers: Headers | None = None,
|
275
261
|
extra_query: Query | None = None,
|
276
262
|
extra_body: Body | None = None,
|
277
|
-
timeout: float | httpx.Timeout | None | NotGiven =
|
263
|
+
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
278
264
|
idempotency_key: str | None = None,
|
279
265
|
) -> ParseCreateResponse:
|
280
266
|
"""
|
@@ -307,8 +293,6 @@ class AsyncParseResource(AsyncAPIResource):
|
|
307
293
|
|
308
294
|
file_name: The name of the file to be parsed. If not set a name will be generated.
|
309
295
|
|
310
|
-
llm_processing: Controls the LLM used for the task.
|
311
|
-
|
312
296
|
ocr_strategy: Controls the Optical Character Recognition (OCR) strategy.
|
313
297
|
|
314
298
|
- `All`: Processes all pages with OCR. (Latency penalty: ~0.5 seconds per page)
|
@@ -358,7 +342,6 @@ class AsyncParseResource(AsyncAPIResource):
|
|
358
342
|
"error_handling": error_handling,
|
359
343
|
"expires_in": expires_in,
|
360
344
|
"file_name": file_name,
|
361
|
-
"llm_processing": llm_processing,
|
362
345
|
"ocr_strategy": ocr_strategy,
|
363
346
|
"pipeline": pipeline,
|
364
347
|
"segment_processing": segment_processing,
|
@@ -380,25 +363,20 @@ class AsyncParseResource(AsyncAPIResource):
|
|
380
363
|
self,
|
381
364
|
task_id: Optional[str],
|
382
365
|
*,
|
383
|
-
base64_urls: bool |
|
384
|
-
include_chunks: bool |
|
385
|
-
wait_for_completion: bool | NotGiven = NOT_GIVEN,
|
366
|
+
base64_urls: bool | Omit = omit,
|
367
|
+
include_chunks: bool | Omit = omit,
|
386
368
|
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
387
369
|
# The extra values given here take precedence over values defined on the client or passed to this method.
|
388
370
|
extra_headers: Headers | None = None,
|
389
371
|
extra_query: Query | None = None,
|
390
372
|
extra_body: Body | None = None,
|
391
|
-
timeout: float | httpx.Timeout | None | NotGiven =
|
373
|
+
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
392
374
|
) -> ParseGetResponse:
|
393
375
|
"""
|
394
|
-
Retrieves the current state of a parse task
|
395
|
-
completion.
|
376
|
+
Retrieves the current state of a parse task.
|
396
377
|
|
397
378
|
Returns task details such as processing status, configuration, output (when
|
398
|
-
available), file metadata, and timestamps.
|
399
|
-
provided, the server will hold the request briefly. If the task does not reach a
|
400
|
-
terminal state during that window, the response will indicate a retry with
|
401
|
-
appropriate headers.
|
379
|
+
available), file metadata, and timestamps.
|
402
380
|
|
403
381
|
Typical uses:
|
404
382
|
|
@@ -412,8 +390,6 @@ class AsyncParseResource(AsyncAPIResource):
|
|
412
390
|
|
413
391
|
include_chunks: Whether to include chunks in the output response
|
414
392
|
|
415
|
-
wait_for_completion: Whether to wait for the task to complete
|
416
|
-
|
417
393
|
extra_headers: Send extra headers
|
418
394
|
|
419
395
|
extra_query: Add additional query parameters to the request
|
@@ -435,7 +411,6 @@ class AsyncParseResource(AsyncAPIResource):
|
|
435
411
|
{
|
436
412
|
"base64_urls": base64_urls,
|
437
413
|
"include_chunks": include_chunks,
|
438
|
-
"wait_for_completion": wait_for_completion,
|
439
414
|
},
|
440
415
|
parse_get_params.ParseGetParams,
|
441
416
|
),
|
@@ -25,7 +25,7 @@ from .extract import (
|
|
25
25
|
ExtractResourceWithStreamingResponse,
|
26
26
|
AsyncExtractResourceWithStreamingResponse,
|
27
27
|
)
|
28
|
-
from ..._types import
|
28
|
+
from ..._types import Body, Omit, Query, Headers, NoneType, NotGiven, omit, not_given
|
29
29
|
from ..._utils import maybe_transform, async_maybe_transform
|
30
30
|
from ..._compat import cached_property
|
31
31
|
from ..._resource import SyncAPIResource, AsyncAPIResource
|
@@ -73,21 +73,21 @@ class TasksResource(SyncAPIResource):
|
|
73
73
|
def list(
|
74
74
|
self,
|
75
75
|
*,
|
76
|
-
base64_urls: bool |
|
77
|
-
cursor: Union[str, datetime] |
|
78
|
-
end: Union[str, datetime] |
|
79
|
-
include_chunks: bool |
|
80
|
-
limit: int |
|
81
|
-
sort: Literal["asc", "desc"] |
|
82
|
-
start: Union[str, datetime] |
|
83
|
-
statuses: List[Literal["Starting", "Processing", "Succeeded", "Failed", "Cancelled"]] |
|
84
|
-
task_types: List[Literal["Parse", "Extract"]] |
|
76
|
+
base64_urls: bool | Omit = omit,
|
77
|
+
cursor: Union[str, datetime] | Omit = omit,
|
78
|
+
end: Union[str, datetime] | Omit = omit,
|
79
|
+
include_chunks: bool | Omit = omit,
|
80
|
+
limit: int | Omit = omit,
|
81
|
+
sort: Literal["asc", "desc"] | Omit = omit,
|
82
|
+
start: Union[str, datetime] | Omit = omit,
|
83
|
+
statuses: List[Literal["Starting", "Processing", "Succeeded", "Failed", "Cancelled"]] | Omit = omit,
|
84
|
+
task_types: List[Literal["Parse", "Extract"]] | Omit = omit,
|
85
85
|
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
86
86
|
# The extra values given here take precedence over values defined on the client or passed to this method.
|
87
87
|
extra_headers: Headers | None = None,
|
88
88
|
extra_query: Query | None = None,
|
89
89
|
extra_body: Body | None = None,
|
90
|
-
timeout: float | httpx.Timeout | None | NotGiven =
|
90
|
+
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
91
91
|
) -> SyncTasksPage[TaskResponse]:
|
92
92
|
"""
|
93
93
|
Lists tasks for the authenticated user with cursor-based pagination and optional
|
@@ -157,7 +157,7 @@ class TasksResource(SyncAPIResource):
|
|
157
157
|
extra_headers: Headers | None = None,
|
158
158
|
extra_query: Query | None = None,
|
159
159
|
extra_body: Body | None = None,
|
160
|
-
timeout: float | httpx.Timeout | None | NotGiven =
|
160
|
+
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
161
161
|
idempotency_key: str | None = None,
|
162
162
|
) -> None:
|
163
163
|
"""
|
@@ -202,7 +202,7 @@ class TasksResource(SyncAPIResource):
|
|
202
202
|
extra_headers: Headers | None = None,
|
203
203
|
extra_query: Query | None = None,
|
204
204
|
extra_body: Body | None = None,
|
205
|
-
timeout: float | httpx.Timeout | None | NotGiven =
|
205
|
+
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
206
206
|
) -> None:
|
207
207
|
"""
|
208
208
|
Cancel a task that hasn't started processing yet:
|
@@ -238,25 +238,20 @@ class TasksResource(SyncAPIResource):
|
|
238
238
|
self,
|
239
239
|
task_id: Optional[str],
|
240
240
|
*,
|
241
|
-
base64_urls: bool |
|
242
|
-
include_chunks: bool |
|
243
|
-
wait_for_completion: bool | NotGiven = NOT_GIVEN,
|
241
|
+
base64_urls: bool | Omit = omit,
|
242
|
+
include_chunks: bool | Omit = omit,
|
244
243
|
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
245
244
|
# The extra values given here take precedence over values defined on the client or passed to this method.
|
246
245
|
extra_headers: Headers | None = None,
|
247
246
|
extra_query: Query | None = None,
|
248
247
|
extra_body: Body | None = None,
|
249
|
-
timeout: float | httpx.Timeout | None | NotGiven =
|
248
|
+
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
250
249
|
) -> TaskResponse:
|
251
250
|
"""
|
252
|
-
Retrieves the current state of a task
|
253
|
-
completion.
|
251
|
+
Retrieves the current state of a task.
|
254
252
|
|
255
253
|
Returns task details such as processing status, configuration, output (when
|
256
|
-
available), file metadata, and timestamps.
|
257
|
-
provided, the server will hold the request briefly. If the task does not reach a
|
258
|
-
terminal state during that window, the response will indicate a retry with
|
259
|
-
appropriate headers.
|
254
|
+
available), file metadata, and timestamps.
|
260
255
|
|
261
256
|
Typical uses:
|
262
257
|
|
@@ -270,8 +265,6 @@ class TasksResource(SyncAPIResource):
|
|
270
265
|
|
271
266
|
include_chunks: Whether to include chunks in the output response
|
272
267
|
|
273
|
-
wait_for_completion: Whether to wait for the task to complete
|
274
|
-
|
275
268
|
extra_headers: Send extra headers
|
276
269
|
|
277
270
|
extra_query: Add additional query parameters to the request
|
@@ -293,7 +286,6 @@ class TasksResource(SyncAPIResource):
|
|
293
286
|
{
|
294
287
|
"base64_urls": base64_urls,
|
295
288
|
"include_chunks": include_chunks,
|
296
|
-
"wait_for_completion": wait_for_completion,
|
297
289
|
},
|
298
290
|
task_get_params.TaskGetParams,
|
299
291
|
),
|
@@ -333,21 +325,21 @@ class AsyncTasksResource(AsyncAPIResource):
|
|
333
325
|
def list(
|
334
326
|
self,
|
335
327
|
*,
|
336
|
-
base64_urls: bool |
|
337
|
-
cursor: Union[str, datetime] |
|
338
|
-
end: Union[str, datetime] |
|
339
|
-
include_chunks: bool |
|
340
|
-
limit: int |
|
341
|
-
sort: Literal["asc", "desc"] |
|
342
|
-
start: Union[str, datetime] |
|
343
|
-
statuses: List[Literal["Starting", "Processing", "Succeeded", "Failed", "Cancelled"]] |
|
344
|
-
task_types: List[Literal["Parse", "Extract"]] |
|
328
|
+
base64_urls: bool | Omit = omit,
|
329
|
+
cursor: Union[str, datetime] | Omit = omit,
|
330
|
+
end: Union[str, datetime] | Omit = omit,
|
331
|
+
include_chunks: bool | Omit = omit,
|
332
|
+
limit: int | Omit = omit,
|
333
|
+
sort: Literal["asc", "desc"] | Omit = omit,
|
334
|
+
start: Union[str, datetime] | Omit = omit,
|
335
|
+
statuses: List[Literal["Starting", "Processing", "Succeeded", "Failed", "Cancelled"]] | Omit = omit,
|
336
|
+
task_types: List[Literal["Parse", "Extract"]] | Omit = omit,
|
345
337
|
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
346
338
|
# The extra values given here take precedence over values defined on the client or passed to this method.
|
347
339
|
extra_headers: Headers | None = None,
|
348
340
|
extra_query: Query | None = None,
|
349
341
|
extra_body: Body | None = None,
|
350
|
-
timeout: float | httpx.Timeout | None | NotGiven =
|
342
|
+
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
351
343
|
) -> AsyncPaginator[TaskResponse, AsyncTasksPage[TaskResponse]]:
|
352
344
|
"""
|
353
345
|
Lists tasks for the authenticated user with cursor-based pagination and optional
|
@@ -417,7 +409,7 @@ class AsyncTasksResource(AsyncAPIResource):
|
|
417
409
|
extra_headers: Headers | None = None,
|
418
410
|
extra_query: Query | None = None,
|
419
411
|
extra_body: Body | None = None,
|
420
|
-
timeout: float | httpx.Timeout | None | NotGiven =
|
412
|
+
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
421
413
|
idempotency_key: str | None = None,
|
422
414
|
) -> None:
|
423
415
|
"""
|
@@ -462,7 +454,7 @@ class AsyncTasksResource(AsyncAPIResource):
|
|
462
454
|
extra_headers: Headers | None = None,
|
463
455
|
extra_query: Query | None = None,
|
464
456
|
extra_body: Body | None = None,
|
465
|
-
timeout: float | httpx.Timeout | None | NotGiven =
|
457
|
+
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
466
458
|
) -> None:
|
467
459
|
"""
|
468
460
|
Cancel a task that hasn't started processing yet:
|
@@ -498,25 +490,20 @@ class AsyncTasksResource(AsyncAPIResource):
|
|
498
490
|
self,
|
499
491
|
task_id: Optional[str],
|
500
492
|
*,
|
501
|
-
base64_urls: bool |
|
502
|
-
include_chunks: bool |
|
503
|
-
wait_for_completion: bool | NotGiven = NOT_GIVEN,
|
493
|
+
base64_urls: bool | Omit = omit,
|
494
|
+
include_chunks: bool | Omit = omit,
|
504
495
|
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
505
496
|
# The extra values given here take precedence over values defined on the client or passed to this method.
|
506
497
|
extra_headers: Headers | None = None,
|
507
498
|
extra_query: Query | None = None,
|
508
499
|
extra_body: Body | None = None,
|
509
|
-
timeout: float | httpx.Timeout | None | NotGiven =
|
500
|
+
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
510
501
|
) -> TaskResponse:
|
511
502
|
"""
|
512
|
-
Retrieves the current state of a task
|
513
|
-
completion.
|
503
|
+
Retrieves the current state of a task.
|
514
504
|
|
515
505
|
Returns task details such as processing status, configuration, output (when
|
516
|
-
available), file metadata, and timestamps.
|
517
|
-
provided, the server will hold the request briefly. If the task does not reach a
|
518
|
-
terminal state during that window, the response will indicate a retry with
|
519
|
-
appropriate headers.
|
506
|
+
available), file metadata, and timestamps.
|
520
507
|
|
521
508
|
Typical uses:
|
522
509
|
|
@@ -530,8 +517,6 @@ class AsyncTasksResource(AsyncAPIResource):
|
|
530
517
|
|
531
518
|
include_chunks: Whether to include chunks in the output response
|
532
519
|
|
533
|
-
wait_for_completion: Whether to wait for the task to complete
|
534
|
-
|
535
520
|
extra_headers: Send extra headers
|
536
521
|
|
537
522
|
extra_query: Add additional query parameters to the request
|
@@ -553,7 +538,6 @@ class AsyncTasksResource(AsyncAPIResource):
|
|
553
538
|
{
|
554
539
|
"base64_urls": base64_urls,
|
555
540
|
"include_chunks": include_chunks,
|
556
|
-
"wait_for_completion": wait_for_completion,
|
557
541
|
},
|
558
542
|
task_get_params.TaskGetParams,
|
559
543
|
),
|
chunkr_ai/resources/webhooks.py
CHANGED
@@ -7,7 +7,7 @@ from typing import Mapping, cast
|
|
7
7
|
|
8
8
|
import httpx
|
9
9
|
|
10
|
-
from .._types import
|
10
|
+
from .._types import Body, Query, Headers, NotGiven, not_given
|
11
11
|
from .._compat import cached_property
|
12
12
|
from .._models import construct_type
|
13
13
|
from .._resource import SyncAPIResource, AsyncAPIResource
|
@@ -79,7 +79,7 @@ class WebhooksResource(SyncAPIResource):
|
|
79
79
|
extra_headers: Headers | None = None,
|
80
80
|
extra_query: Query | None = None,
|
81
81
|
extra_body: Body | None = None,
|
82
|
-
timeout: float | httpx.Timeout | None | NotGiven =
|
82
|
+
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
83
83
|
) -> WebhookURLResponse:
|
84
84
|
"""Get or create webhook for user and return dashboard URL"""
|
85
85
|
return self._get(
|
@@ -145,7 +145,7 @@ class AsyncWebhooksResource(AsyncAPIResource):
|
|
145
145
|
extra_headers: Headers | None = None,
|
146
146
|
extra_query: Query | None = None,
|
147
147
|
extra_body: Body | None = None,
|
148
|
-
timeout: float | httpx.Timeout | None | NotGiven =
|
148
|
+
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
149
149
|
) -> WebhookURLResponse:
|
150
150
|
"""Get or create webhook for user and return dashboard URL"""
|
151
151
|
return await self._get(
|
chunkr_ai/types/__init__.py
CHANGED
@@ -15,7 +15,6 @@ from .ocr_result import OcrResult as OcrResult
|
|
15
15
|
from .bounding_box import BoundingBox as BoundingBox
|
16
16
|
from .version_info import VersionInfo as VersionInfo
|
17
17
|
from .task_response import TaskResponse as TaskResponse
|
18
|
-
from .llm_processing import LlmProcessing as LlmProcessing
|
19
18
|
from .file_url_params import FileURLParams as FileURLParams
|
20
19
|
from .task_get_params import TaskGetParams as TaskGetParams
|
21
20
|
from .chunk_processing import ChunkProcessing as ChunkProcessing
|
@@ -26,7 +25,6 @@ from .file_create_params import FileCreateParams as FileCreateParams
|
|
26
25
|
from .segment_processing import SegmentProcessing as SegmentProcessing
|
27
26
|
from .files_list_response import FilesListResponse as FilesListResponse
|
28
27
|
from .parse_configuration import ParseConfiguration as ParseConfiguration
|
29
|
-
from .llm_processing_param import LlmProcessingParam as LlmProcessingParam
|
30
28
|
from .unwrap_webhook_event import UnwrapWebhookEvent as UnwrapWebhookEvent
|
31
29
|
from .webhook_url_response import WebhookURLResponse as WebhookURLResponse
|
32
30
|
from .extract_configuration import ExtractConfiguration as ExtractConfiguration
|
@@ -7,13 +7,56 @@ __all__ = ["ExtractOutputResponse"]
|
|
7
7
|
|
8
8
|
class ExtractOutputResponse(BaseModel):
|
9
9
|
citations: object
|
10
|
-
"""Mirror of `results`; leaves are `Vec<Citation>` for the corresponding field
|
10
|
+
"""Mirror of `results`; leaves are `Vec<Citation>` for the corresponding field
|
11
|
+
|
12
|
+
Example:
|
13
|
+
|
14
|
+
```json
|
15
|
+
{
|
16
|
+
"field_name": [
|
17
|
+
{
|
18
|
+
"citation_id": "abc1234",
|
19
|
+
"citation_type": "Segment",
|
20
|
+
"bboxes": [
|
21
|
+
{
|
22
|
+
"left": 10,
|
23
|
+
"top": 20,
|
24
|
+
"width": 100,
|
25
|
+
"height": 18
|
26
|
+
}
|
27
|
+
],
|
28
|
+
"content": "Example content",
|
29
|
+
"segment_id": "seg_001",
|
30
|
+
"segment_type": "Text",
|
31
|
+
"page_number": 1,
|
32
|
+
"page_height": 297,
|
33
|
+
"page_width": 210,
|
34
|
+
"ss_ranges": ["A1:C10"],
|
35
|
+
"ss_sheet_name": "Sheet1"
|
36
|
+
}
|
37
|
+
]
|
38
|
+
}
|
39
|
+
```
|
40
|
+
"""
|
11
41
|
|
12
42
|
metrics: object
|
13
43
|
"""
|
14
44
|
Mirror of `results`; leaves contain a `Metrics` object for the corresponding
|
15
45
|
field
|
46
|
+
|
47
|
+
Example:
|
48
|
+
|
49
|
+
```json
|
50
|
+
{ "field_name": { "confidence": "High" } }
|
51
|
+
```
|
16
52
|
"""
|
17
53
|
|
18
54
|
results: object
|
19
|
-
"""JSON data that matches the provided schema
|
55
|
+
"""JSON data that matches the provided schema
|
56
|
+
|
57
|
+
Example:
|
58
|
+
|
59
|
+
```json
|
60
|
+
{ "field_name": "value" }
|
61
|
+
```
|
62
|
+
"""
|