chunkr-ai 0.1.0a2__py3-none-any.whl → 0.1.0a4__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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: chunkr-ai
3
- Version: 0.1.0a2
3
+ Version: 0.1.0a4
4
4
  Summary: The official Python library for the chunkr API
5
5
  Project-URL: Homepage, https://github.com/lumina-ai-inc/chunkr-python
6
6
  Project-URL: Repository, https://github.com/lumina-ai-inc/chunkr-python
@@ -70,7 +70,7 @@ client = Chunkr(
70
70
  api_key=os.environ.get("CHUNKR_API_KEY"), # This is the default and can be omitted
71
71
  )
72
72
 
73
- task = client.task.parse.create(
73
+ task = client.tasks.parse.create(
74
74
  file="string",
75
75
  )
76
76
  print(task.task_id)
@@ -96,7 +96,7 @@ client = AsyncChunkr(
96
96
 
97
97
 
98
98
  async def main() -> None:
99
- task = await client.task.parse.create(
99
+ task = await client.tasks.parse.create(
100
100
  file="string",
101
101
  )
102
102
  print(task.task_id)
@@ -131,7 +131,7 @@ async def main() -> None:
131
131
  api_key="My API Key",
132
132
  http_client=DefaultAioHttpClient(),
133
133
  ) as client:
134
- task = await client.task.parse.create(
134
+ task = await client.tasks.parse.create(
135
135
  file="string",
136
136
  )
137
137
  print(task.task_id)
@@ -162,7 +162,7 @@ client = Chunkr()
162
162
 
163
163
  all_tasks = []
164
164
  # Automatically fetches more pages as needed.
165
- for task in client.task.list(
165
+ for task in client.tasks.list(
166
166
  limit=100,
167
167
  ):
168
168
  # Do something with task here
@@ -182,7 +182,7 @@ client = AsyncChunkr()
182
182
  async def main() -> None:
183
183
  all_tasks = []
184
184
  # Iterate through items across all pages, issuing requests as needed.
185
- async for task in client.task.list(
185
+ async for task in client.tasks.list(
186
186
  limit=100,
187
187
  ):
188
188
  all_tasks.append(task)
@@ -195,7 +195,7 @@ asyncio.run(main())
195
195
  Alternatively, you can use the `.has_next_page()`, `.next_page_info()`, or `.get_next_page()` methods for more granular control working with pages:
196
196
 
197
197
  ```python
198
- first_page = await client.task.list(
198
+ first_page = await client.tasks.list(
199
199
  limit=100,
200
200
  )
201
201
  if first_page.has_next_page():
@@ -209,7 +209,7 @@ if first_page.has_next_page():
209
209
  Or just work directly with the returned data:
210
210
 
211
211
  ```python
212
- first_page = await client.task.list(
212
+ first_page = await client.tasks.list(
213
213
  limit=100,
214
214
  )
215
215
 
@@ -229,13 +229,31 @@ from chunkr_ai import Chunkr
229
229
 
230
230
  client = Chunkr()
231
231
 
232
- task = client.task.parse.create(
232
+ task = client.tasks.parse.create(
233
233
  file="file",
234
234
  chunk_processing={},
235
235
  )
236
236
  print(task.chunk_processing)
237
237
  ```
238
238
 
239
+ ## File uploads
240
+
241
+ Request parameters that correspond to file uploads can be passed as `bytes`, or a [`PathLike`](https://docs.python.org/3/library/os.html#os.PathLike) instance or a tuple of `(filename, contents, media type)`.
242
+
243
+ ```python
244
+ from pathlib import Path
245
+ from chunkr_ai import Chunkr
246
+
247
+ client = Chunkr()
248
+
249
+ client.files.create(
250
+ file=Path("/path/to/file"),
251
+ file_metadata="file_metadata",
252
+ )
253
+ ```
254
+
255
+ The async client uses the exact same interface. If you pass a [`PathLike`](https://docs.python.org/3/library/os.html#os.PathLike) instance, the file contents will be read asynchronously automatically.
256
+
239
257
  ## Handling errors
240
258
 
241
259
  When the library is unable to connect to the API (for example, due to network connection problems or a timeout), a subclass of `chunkr_ai.APIConnectionError` is raised.
@@ -252,8 +270,8 @@ from chunkr_ai import Chunkr
252
270
  client = Chunkr()
253
271
 
254
272
  try:
255
- client.task.parse.create(
256
- file="base64 or url",
273
+ client.tasks.parse.create(
274
+ file="string",
257
275
  )
258
276
  except chunkr_ai.APIConnectionError as e:
259
277
  print("The server could not be reached")
@@ -297,8 +315,8 @@ client = Chunkr(
297
315
  )
298
316
 
299
317
  # Or, configure per-request:
300
- client.with_options(max_retries=5).task.parse.create(
301
- file="base64 or url",
318
+ client.with_options(max_retries=5).tasks.parse.create(
319
+ file="string",
302
320
  )
303
321
  ```
304
322
 
@@ -322,8 +340,8 @@ client = Chunkr(
322
340
  )
323
341
 
324
342
  # Override per-request:
325
- client.with_options(timeout=5.0).task.parse.create(
326
- file="base64 or url",
343
+ client.with_options(timeout=5.0).tasks.parse.create(
344
+ file="string",
327
345
  )
328
346
  ```
329
347
 
@@ -365,12 +383,12 @@ The "raw" Response object can be accessed by prefixing `.with_raw_response.` to
365
383
  from chunkr_ai import Chunkr
366
384
 
367
385
  client = Chunkr()
368
- response = client.task.parse.with_raw_response.create(
369
- file="base64 or url",
386
+ response = client.tasks.parse.with_raw_response.create(
387
+ file="string",
370
388
  )
371
389
  print(response.headers.get('X-My-Header'))
372
390
 
373
- parse = response.parse() # get the object that `task.parse.create()` would have returned
391
+ parse = response.parse() # get the object that `tasks.parse.create()` would have returned
374
392
  print(parse.task_id)
375
393
  ```
376
394
 
@@ -385,8 +403,8 @@ The above interface eagerly reads the full response body when you make the reque
385
403
  To stream the response body, use `.with_streaming_response` instead, which requires a context manager and only reads the response body once you call `.read()`, `.text()`, `.json()`, `.iter_bytes()`, `.iter_text()`, `.iter_lines()` or `.parse()`. In the async client, these are async methods.
386
404
 
387
405
  ```python
388
- with client.task.parse.with_streaming_response.create(
389
- file="base64 or url",
406
+ with client.tasks.parse.with_streaming_response.create(
407
+ file="string",
390
408
  ) as response:
391
409
  print(response.headers.get("X-My-Header"))
392
410
 
@@ -0,0 +1,53 @@
1
+ chunkr_ai/__init__.py,sha256=RqteAJ-1Ma7DnoNz_AJJIjmynGeoGJ3F4ZKrSnjp9zs,2793
2
+ chunkr_ai/_base_client.py,sha256=Nv5b_rmVdmmPbF42mlOfymbSC6lxcYsrsvBhKSBDXWQ,67038
3
+ chunkr_ai/_client.py,sha256=fseZHGtnXGw3uSa1Le8SxH2oSBeHczn6mOsLeLGj4rY,15867
4
+ chunkr_ai/_compat.py,sha256=VWemUKbj6DDkQ-O4baSpHVLJafotzeXmCQGJugfVTIw,6580
5
+ chunkr_ai/_constants.py,sha256=S14PFzyN9-I31wiV7SmIlL5Ga0MLHxdvegInGdXH7tM,462
6
+ chunkr_ai/_exceptions.py,sha256=ClgXUcwf4qhBTXnK4LzUPQCFdFldRxAlcYdOFFgpTxA,3220
7
+ chunkr_ai/_files.py,sha256=SUFtic_gwSzbvhLtMdQ7TBem8szrqZE2nZFFMRa0KTw,3619
8
+ chunkr_ai/_models.py,sha256=KvjsMfb88XZlFUKVoOxr8OyDj47MhoH2OKqWNEbBhk4,30010
9
+ chunkr_ai/_qs.py,sha256=AOkSz4rHtK4YI3ZU_kzea-zpwBUgEY8WniGmTPyEimc,4846
10
+ chunkr_ai/_resource.py,sha256=f5tiwjxcKdbeMor8idoHtMFTUhqD9yc2xXtq5rqeLLk,1100
11
+ chunkr_ai/_response.py,sha256=xXNpF53hiYARmAW7npKuxQ5UHAEjgAzm7ME_L3eIstY,28800
12
+ chunkr_ai/_streaming.py,sha256=ZmyrVWk7-AWkLAATR55WgNxnyFzYmaqJt2LthA_PTqQ,10100
13
+ chunkr_ai/_types.py,sha256=dnzU2Q2tLcuk29QFEcnPC1wp0-4XB4Cpef_3AnRhV5Y,6200
14
+ chunkr_ai/_version.py,sha256=hJYiv4ePWLGN-Ur1VkK5zJERczdAZjPDNh7APrmHgBE,169
15
+ chunkr_ai/pagination.py,sha256=bT-ErcJ80YlKBV6tWq2s9uqg-wv7o66SKe_AgUAGrKc,3533
16
+ chunkr_ai/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
17
+ chunkr_ai/_utils/__init__.py,sha256=PNZ_QJuzZEgyYXqkO1HVhGkj5IU9bglVUcw7H-Knjzw,2062
18
+ chunkr_ai/_utils/_logs.py,sha256=ylZvP2JTPNlFCbxYajpsnWkA253kDFgnFYDWWuvgf_Q,780
19
+ chunkr_ai/_utils/_proxy.py,sha256=aglnj2yBTDyGX9Akk2crZHrl10oqRmceUy2Zp008XEs,1975
20
+ chunkr_ai/_utils/_reflection.py,sha256=ZmGkIgT_PuwedyNBrrKGbxoWtkpytJNU1uU4QHnmEMU,1364
21
+ chunkr_ai/_utils/_resources_proxy.py,sha256=3KbSCApjaz7x_frFAxJe9ltY-dIJBQUVnIhR2GvVRY8,604
22
+ chunkr_ai/_utils/_streams.py,sha256=SMC90diFFecpEg_zgDRVbdR3hSEIgVVij4taD-noMLM,289
23
+ chunkr_ai/_utils/_sync.py,sha256=TpGLrrhRNWTJtODNE6Fup3_k7zrWm1j2RlirzBwre-0,2862
24
+ chunkr_ai/_utils/_transform.py,sha256=n7kskEWz6o__aoNvhFoGVyDoalNe6mJwp-g7BWkdj88,15617
25
+ chunkr_ai/_utils/_typing.py,sha256=D0DbbNu8GnYQTSICnTSHDGsYXj8TcAKyhejb0XcnjtY,4602
26
+ chunkr_ai/_utils/_utils.py,sha256=ts4CiiuNpFiGB6YMdkQRh2SZvYvsl7mAF-JWHCcLDf4,12312
27
+ chunkr_ai/lib/.keep,sha256=wuNrz-5SXo3jJaJOJgz4vFHM41YH_g20F5cRQo0vLes,224
28
+ chunkr_ai/lib/tasks_poll.py,sha256=3yosl_hH5j6NVNH9mANqneAW0FJSbIV9dMoTcF-OdJU,3341
29
+ chunkr_ai/resources/__init__.py,sha256=K-axuAEg2pJQl45N5ao1tm8AnRwpQVVNp_b6qSMgB6A,1426
30
+ chunkr_ai/resources/files.py,sha256=Dez080pD_xUr1jOW3y6QSg92sSSZhEYObPze2RWktoY,26304
31
+ chunkr_ai/resources/health.py,sha256=XTvUtRs5hEK-uccb_40mcIex85eEUo1a171nQUjpSOs,4965
32
+ chunkr_ai/resources/tasks/__init__.py,sha256=W-sclAx_Kfm7OBGlSs694QzNCMkewtz9LU9KRcb8Ud0,976
33
+ chunkr_ai/resources/tasks/parse.py,sha256=um0sw2ZU7bY6AK7LKAS0GxAHUyuSzav_NlhxXPjNjxY,28491
34
+ chunkr_ai/resources/tasks/tasks.py,sha256=UC15zZNpY7u85X_JJudDuNrnpaeULiISaBde4BRHGSw,21653
35
+ chunkr_ai/types/__init__.py,sha256=DSRAMgXVRTZM2t8s2yrFU-FHt3FTs_wpZfVILH1zjJ0,728
36
+ chunkr_ai/types/delete.py,sha256=EU78fjXpc8-fqvgcFTuJ0ejs5u_UjbhOz5frkeUHvxY,225
37
+ chunkr_ai/types/file.py,sha256=kOxR0g-3A-qOxz2cjuTcq0wFMqPoph9uQuLYQ56zb-c,718
38
+ chunkr_ai/types/file_create_params.py,sha256=eR5tUPv1ZxGk94y6Ps5PDF5AoHsTfPRM9jNxnrEEnCQ,440
39
+ chunkr_ai/types/file_list_params.py,sha256=oJGTf88aAxBhNfmQDbxGT63b95HdSbMXUubKjXM22_U,822
40
+ chunkr_ai/types/file_url.py,sha256=L434WnOXkNmt59dJiaAgT1_3pN3BIsxm2q14zHQK6xY,365
41
+ chunkr_ai/types/file_url_params.py,sha256=ZHfKiy_6B25StdDemulavGcsPggNNMKLWf6KN7xfPTY,413
42
+ chunkr_ai/types/files_list_response.py,sha256=ggSRWhTzZWjcDXxStyCzrYICXXB5TqnL2j-SN9mHH_g,506
43
+ chunkr_ai/types/health_check_response.py,sha256=6Zn5YYHCQf2RgMjDlf39mtiTPqfaBfC9Vv599U_rKCI,200
44
+ chunkr_ai/types/task.py,sha256=aew6aT0ngKtwgfUCSCvMTJOBQL1Xp0F0otB_wxumIGQ,46703
45
+ chunkr_ai/types/task_get_params.py,sha256=Nx2luhebcoaiuRln4KP4FarWvBPd1OYi__efi56zHPM,460
46
+ chunkr_ai/types/task_list_params.py,sha256=fCku42QW6QUsLmZgKJBaxisGvUcmcQ5fa6LgHHRIwiQ,1043
47
+ chunkr_ai/types/tasks/__init__.py,sha256=VdLEmQvgPoiykSEYaRhkMYVaIueGDkR4P_MjCq9SbQY,267
48
+ chunkr_ai/types/tasks/parse_create_params.py,sha256=PBg2VR_OnBdB8K4NihuefGJXgUXBn7v5317LZG7PDks,34340
49
+ chunkr_ai/types/tasks/parse_update_params.py,sha256=B1cKfdX_cNDh0m2zDoH0FiZP_Qc-a5GFy-5iXHDHuy8,34113
50
+ chunkr_ai-0.1.0a4.dist-info/METADATA,sha256=241RRJb1pTZBg9IG3oGx3_WASrJDN8a2myyJhQ9TUNE,16441
51
+ chunkr_ai-0.1.0a4.dist-info/WHEEL,sha256=C2FUgwZgiLbznR-k0b_5k3Ai_1aASOXDss3lzCUsUug,87
52
+ chunkr_ai-0.1.0a4.dist-info/licenses/LICENSE,sha256=3FDRL-L-DFkrFy8yJpb1Nxhuztm0PB2kawcCgK5utFg,11336
53
+ chunkr_ai-0.1.0a4.dist-info/RECORD,,
@@ -1,44 +0,0 @@
1
- chunkr_ai/__init__.py,sha256=scS30uHiCpLbaalKTAJSCFSTqnu_b9R5JCkTu2hmbzU,2587
2
- chunkr_ai/_base_client.py,sha256=Nv5b_rmVdmmPbF42mlOfymbSC6lxcYsrsvBhKSBDXWQ,67038
3
- chunkr_ai/_client.py,sha256=6Dmn7QJXjRXrP9TbOZUhTylnN9adREdxLmobyHrhnbo,15362
4
- chunkr_ai/_compat.py,sha256=VWemUKbj6DDkQ-O4baSpHVLJafotzeXmCQGJugfVTIw,6580
5
- chunkr_ai/_constants.py,sha256=S14PFzyN9-I31wiV7SmIlL5Ga0MLHxdvegInGdXH7tM,462
6
- chunkr_ai/_exceptions.py,sha256=ClgXUcwf4qhBTXnK4LzUPQCFdFldRxAlcYdOFFgpTxA,3220
7
- chunkr_ai/_files.py,sha256=KnEzGi_O756MvKyJ4fOCW_u3JhOeWPQ4RsmDvqihDQU,3545
8
- chunkr_ai/_models.py,sha256=KvjsMfb88XZlFUKVoOxr8OyDj47MhoH2OKqWNEbBhk4,30010
9
- chunkr_ai/_qs.py,sha256=AOkSz4rHtK4YI3ZU_kzea-zpwBUgEY8WniGmTPyEimc,4846
10
- chunkr_ai/_resource.py,sha256=f5tiwjxcKdbeMor8idoHtMFTUhqD9yc2xXtq5rqeLLk,1100
11
- chunkr_ai/_response.py,sha256=xXNpF53hiYARmAW7npKuxQ5UHAEjgAzm7ME_L3eIstY,28800
12
- chunkr_ai/_streaming.py,sha256=ZmyrVWk7-AWkLAATR55WgNxnyFzYmaqJt2LthA_PTqQ,10100
13
- chunkr_ai/_types.py,sha256=dnzU2Q2tLcuk29QFEcnPC1wp0-4XB4Cpef_3AnRhV5Y,6200
14
- chunkr_ai/_version.py,sha256=aZMksQV_irE9ZNKGRmM5QMcr3SxXmViodBDpjr3crag,169
15
- chunkr_ai/pagination.py,sha256=mKx7wg1MEeJT-stWQ60VUHotL6Y3QdDmTr1fjG9scP4,1924
16
- chunkr_ai/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
17
- chunkr_ai/_utils/__init__.py,sha256=PNZ_QJuzZEgyYXqkO1HVhGkj5IU9bglVUcw7H-Knjzw,2062
18
- chunkr_ai/_utils/_logs.py,sha256=ylZvP2JTPNlFCbxYajpsnWkA253kDFgnFYDWWuvgf_Q,780
19
- chunkr_ai/_utils/_proxy.py,sha256=aglnj2yBTDyGX9Akk2crZHrl10oqRmceUy2Zp008XEs,1975
20
- chunkr_ai/_utils/_reflection.py,sha256=ZmGkIgT_PuwedyNBrrKGbxoWtkpytJNU1uU4QHnmEMU,1364
21
- chunkr_ai/_utils/_resources_proxy.py,sha256=3KbSCApjaz7x_frFAxJe9ltY-dIJBQUVnIhR2GvVRY8,604
22
- chunkr_ai/_utils/_streams.py,sha256=SMC90diFFecpEg_zgDRVbdR3hSEIgVVij4taD-noMLM,289
23
- chunkr_ai/_utils/_sync.py,sha256=TpGLrrhRNWTJtODNE6Fup3_k7zrWm1j2RlirzBwre-0,2862
24
- chunkr_ai/_utils/_transform.py,sha256=n7kskEWz6o__aoNvhFoGVyDoalNe6mJwp-g7BWkdj88,15617
25
- chunkr_ai/_utils/_typing.py,sha256=D0DbbNu8GnYQTSICnTSHDGsYXj8TcAKyhejb0XcnjtY,4602
26
- chunkr_ai/_utils/_utils.py,sha256=ts4CiiuNpFiGB6YMdkQRh2SZvYvsl7mAF-JWHCcLDf4,12312
27
- chunkr_ai/lib/.keep,sha256=wuNrz-5SXo3jJaJOJgz4vFHM41YH_g20F5cRQo0vLes,224
28
- chunkr_ai/resources/__init__.py,sha256=zhuIEAnBOs0bLyNTeWngJbEFhlevoTx0NzTZMlX_cs8,976
29
- chunkr_ai/resources/health.py,sha256=XTvUtRs5hEK-uccb_40mcIex85eEUo1a171nQUjpSOs,4965
30
- chunkr_ai/resources/task/__init__.py,sha256=TrjBrfPuVqlcYULga_NosiVxZETfe8dKdUJHjIDJ5zE,963
31
- chunkr_ai/resources/task/parse.py,sha256=Sv4aIP6LEOPg_4lTEZBKpSxQrhRSN0daBKubLMg1dV0,28057
32
- chunkr_ai/resources/task/task.py,sha256=Rn2zfndPYOtFa5LacvGcNURJkEa7TCjgOtavKWmHO04,24172
33
- chunkr_ai/types/__init__.py,sha256=uDFPzVZGkt8tLxw7DID6EVKQQnemw_j4qZnzpK7WZng,355
34
- chunkr_ai/types/health_check_response.py,sha256=6Zn5YYHCQf2RgMjDlf39mtiTPqfaBfC9Vv599U_rKCI,200
35
- chunkr_ai/types/task_get_params.py,sha256=Nx2luhebcoaiuRln4KP4FarWvBPd1OYi__efi56zHPM,460
36
- chunkr_ai/types/task_list_params.py,sha256=fCku42QW6QUsLmZgKJBaxisGvUcmcQ5fa6LgHHRIwiQ,1043
37
- chunkr_ai/types/task/__init__.py,sha256=dglHZXlnA7NvA-Bz5O2aLS7Ug4NP6KuQDeYlQuEx5S8,298
38
- chunkr_ai/types/task/parse_create_params.py,sha256=YT4_p3k5eamPOud_e8BP3EailaDrTuGrG17gwVyHvr8,31794
39
- chunkr_ai/types/task/parse_update_params.py,sha256=GpIpT74YY44J_RoLksyAAWmSG39MlTxq2YR3WrdHrOc,31749
40
- chunkr_ai/types/task/task.py,sha256=p8HWN1usu35R-KS1sk24BZlS2pwsR7HBZWUkGUAEoXg,44340
41
- chunkr_ai-0.1.0a2.dist-info/METADATA,sha256=M88Syly-5DGBErrj2n0By9XYLY6wb6q4QtN2ff1IAC8,15854
42
- chunkr_ai-0.1.0a2.dist-info/WHEEL,sha256=C2FUgwZgiLbznR-k0b_5k3Ai_1aASOXDss3lzCUsUug,87
43
- chunkr_ai-0.1.0a2.dist-info/licenses/LICENSE,sha256=3FDRL-L-DFkrFy8yJpb1Nxhuztm0PB2kawcCgK5utFg,11336
44
- chunkr_ai-0.1.0a2.dist-info/RECORD,,