poma 0.2.2__tar.gz → 0.2.3__tar.gz

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.4
2
2
  Name: poma
3
- Version: 0.2.2
3
+ Version: 0.2.3
4
4
  Summary: Official Python SDK for the Poma document-processing API
5
5
  Author-email: "POMA AI GmbH, Berlin" <sdk@poma-ai.com>
6
6
  License-Expression: MPL-2.0
@@ -139,6 +139,8 @@ class Poma:
139
139
  """
140
140
  time.sleep(initial_delay)
141
141
  current_interval = poll_interval
142
+ last_status = None
143
+
142
144
  while True:
143
145
  time.sleep(current_interval)
144
146
  try:
@@ -181,9 +183,18 @@ class Poma:
181
183
  elif status == "processing":
182
184
  if show_progress:
183
185
  print(f"Job {job_id} is still processing...")
186
+ if last_status == "pending":
187
+ current_interval = poll_interval
188
+ current_interval = min(current_interval * 1.5, max_interval)
189
+ elif status == "pending":
190
+ if show_progress:
191
+ print(
192
+ f"Job {job_id} is pending (queued due to rate limiting, sequential processing - common on demo accounts)..."
193
+ )
184
194
  current_interval = min(current_interval * 1.5, max_interval)
185
195
  else:
186
196
  raise InvalidResponseError(f"Unexpected job status: {status}")
197
+ last_status = status
187
198
  except httpx.HTTPStatusError as error:
188
199
  raise RemoteServerError(
189
200
  f"HTTP error: {error.response.status_code} {error.response.text}"
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: poma
3
- Version: 0.2.2
3
+ Version: 0.2.3
4
4
  Summary: Official Python SDK for the Poma document-processing API
5
5
  Author-email: "POMA AI GmbH, Berlin" <sdk@poma-ai.com>
6
6
  License-Expression: MPL-2.0
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "poma"
3
- version = "0.2.2"
3
+ version = "0.2.3"
4
4
  description = "Official Python SDK for the Poma document-processing API"
5
5
  authors = [{ name = "POMA AI GmbH, Berlin", email = "sdk@poma-ai.com" }]
6
6
  readme = "README.md"
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes