chunkr-ai 0.0.5__py3-none-any.whl → 0.0.6__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/api/task.py CHANGED
@@ -24,6 +24,7 @@ class TaskResponse(BaseModel):
24
24
  output: Optional[OutputResponse]
25
25
  page_count: Optional[int]
26
26
  pdf_url: Optional[str]
27
+ started_at: Optional[datetime]
27
28
  status: Status
28
29
  task_id: str
29
30
  task_url: Optional[str]
@@ -57,8 +58,9 @@ class TaskResponse(BaseModel):
57
58
  while True:
58
59
  try:
59
60
  r = await self._client._client.get(self.task_url, headers=self._client._headers())
60
- await r.raise_for_status()
61
- return await r.json()
61
+ r.raise_for_status()
62
+ response = r.json()
63
+ return response
62
64
  except (ConnectionError, TimeoutError) as _:
63
65
  print("Connection error while polling the task, retrying...")
64
66
  await asyncio.sleep(0.5)
@@ -117,15 +119,4 @@ class TaskResponse(BaseModel):
117
119
 
118
120
  def content(self) -> str:
119
121
  """Get full text for the task"""
120
- return self._get_content("content")
121
-
122
- class TaskPayload(BaseModel):
123
- current_configuration: Configuration
124
- file_name: str
125
- image_folder_location: str
126
- input_location: str
127
- output_location: str
128
- pdf_location: str
129
- previous_configuration: Optional[Configuration]
130
- task_id: str
131
- user_id: str
122
+ return self._get_content("content")
chunkr_ai/models.py CHANGED
@@ -20,7 +20,7 @@ from .api.config import (
20
20
  SegmentationStrategy,
21
21
  )
22
22
 
23
- from .api.task import TaskResponse, TaskPayload, Status
23
+ from .api.task import TaskResponse, Status
24
24
 
25
25
  __all__ = [
26
26
  'BoundingBox',
@@ -43,6 +43,5 @@ __all__ = [
43
43
  'SegmentType',
44
44
  'SegmentationStrategy',
45
45
  'Status',
46
- 'TaskPayload',
47
46
  'TaskResponse'
48
47
  ]
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.2
2
2
  Name: chunkr-ai
3
- Version: 0.0.5
3
+ Version: 0.0.6
4
4
  Summary: Python client for Chunkr: open source document intelligence
5
5
  Author-email: Ishaan Kapoor <ishaan@lumina.sh>
6
6
  Project-URL: Homepage, https://chunkr.ai
@@ -9,6 +9,7 @@ License-File: LICENSE
9
9
  Requires-Dist: httpx>=0.28.1
10
10
  Requires-Dist: pillow>=11.1.0
11
11
  Requires-Dist: pydantic>=2.10.4
12
+ Requires-Dist: pytest-asyncio>=0.25.2
12
13
  Requires-Dist: python-dotenv>=1.0.1
13
14
  Requires-Dist: requests>=2.32.3
14
15
  Provides-Extra: test
@@ -1,6 +1,6 @@
1
1
  chunkr_ai/__init__.py,sha256=eXygrEhGxxIHXNYIlHF2eied8rGsx2RphgR8Wo4lRyo,110
2
2
  chunkr_ai/main.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
3
- chunkr_ai/models.py,sha256=d-B4vfgZClJOoHdPaH3vagwUc4qxeQSmUxab77DKYtQ,874
3
+ chunkr_ai/models.py,sha256=kNeYtBO4TFvQWKFCent7tLEQjyKlVUieKNiuTt3u564,842
4
4
  chunkr_ai/api/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
5
5
  chunkr_ai/api/api.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
6
6
  chunkr_ai/api/auth.py,sha256=iSd5Jek2BFaHGw9HY-RrqgwP56BHFU0xbSuJS4fU6AA,425
@@ -9,9 +9,9 @@ chunkr_ai/api/chunkr.py,sha256=LkBFzGB_T0y3fnBeIn_nwQW6Mb7eZO-iTlzWrmWBoko,3450
9
9
  chunkr_ai/api/chunkr_async.py,sha256=B9deRVoe4h3Csh_jEuQxuxQ-DKSuZPdwkanFTyfHmeM,3603
10
10
  chunkr_ai/api/config.py,sha256=K0s1giImciPksu-bO9gzRwUaK2Vo1nxNKQkXlRQ2cb8,3785
11
11
  chunkr_ai/api/protocol.py,sha256=XKS9RmtvBpJItYhPg18qlOCKpaSHdOuQTRSUxAdUz2g,479
12
- chunkr_ai/api/task.py,sha256=ALU-rYlObbitlM1MKEFeSz_IBUpzb9736Iqu9huWg7c,4392
13
- chunkr_ai-0.0.5.dist-info/LICENSE,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
14
- chunkr_ai-0.0.5.dist-info/METADATA,sha256=Roj63O2Ms3D1vNfgEmnCYAJESFrOQ9nnsSlyXkvORU4,4806
15
- chunkr_ai-0.0.5.dist-info/WHEEL,sha256=In9FTNxeP60KnTkGw7wk6mJPYd_dQSjEZmXdBdMCI-8,91
16
- chunkr_ai-0.0.5.dist-info/top_level.txt,sha256=0IZY7PZIiS8bw5r4NUQRUQ-ATi-L_3vLQVq3ZLouOW8,10
17
- chunkr_ai-0.0.5.dist-info/RECORD,,
12
+ chunkr_ai/api/task.py,sha256=_WOGRirlLEow_wS9kJB_dNYb2RvYE9nlu7Spq16AhME,4172
13
+ chunkr_ai-0.0.6.dist-info/LICENSE,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
14
+ chunkr_ai-0.0.6.dist-info/METADATA,sha256=TuBBU6n1g7kdLVky2vAx94TFWZVyu8PqQ_47vi6tN5E,4844
15
+ chunkr_ai-0.0.6.dist-info/WHEEL,sha256=In9FTNxeP60KnTkGw7wk6mJPYd_dQSjEZmXdBdMCI-8,91
16
+ chunkr_ai-0.0.6.dist-info/top_level.txt,sha256=0IZY7PZIiS8bw5r4NUQRUQ-ATi-L_3vLQVq3ZLouOW8,10
17
+ chunkr_ai-0.0.6.dist-info/RECORD,,