chunkr-ai 0.0.28__py3-none-any.whl → 0.0.29__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/decorators.py +4 -4
- {chunkr_ai-0.0.28.dist-info → chunkr_ai-0.0.29.dist-info}/METADATA +1 -1
- {chunkr_ai-0.0.28.dist-info → chunkr_ai-0.0.29.dist-info}/RECORD +6 -6
- {chunkr_ai-0.0.28.dist-info → chunkr_ai-0.0.29.dist-info}/LICENSE +0 -0
- {chunkr_ai-0.0.28.dist-info → chunkr_ai-0.0.29.dist-info}/WHEEL +0 -0
- {chunkr_ai-0.0.28.dist-info → chunkr_ai-0.0.29.dist-info}/top_level.txt +0 -0
chunkr_ai/api/decorators.py
CHANGED
@@ -61,12 +61,12 @@ def require_task() -> Callable[[Callable[P, Awaitable[T]]], Callable[P, Awaitabl
|
|
61
61
|
return wrapper
|
62
62
|
return decorator
|
63
63
|
|
64
|
-
def retry_on_429(max_retries: int =
|
64
|
+
def retry_on_429(max_retries: int = 25, initial_delay: float = 0.5) -> Callable[[Callable[P, Awaitable[T]]], Callable[P, Awaitable[T]]]:
|
65
65
|
"""Decorator that retries the request when encountering 429 Too Many Requests errors.
|
66
66
|
|
67
67
|
Args:
|
68
|
-
max_retries: Maximum number of retry attempts (default:
|
69
|
-
initial_delay: Initial delay in seconds, will be exponentially increased (default:
|
68
|
+
max_retries: Maximum number of retry attempts (default: 25)
|
69
|
+
initial_delay: Initial delay in seconds, will be exponentially increased (default: 0.5)
|
70
70
|
"""
|
71
71
|
def decorator(async_func: Callable[P, Awaitable[T]]) -> Callable[P, Awaitable[T]]:
|
72
72
|
@functools.wraps(async_func)
|
@@ -79,7 +79,7 @@ def retry_on_429(max_retries: int = 10, initial_delay: float = 0.5) -> Callable[
|
|
79
79
|
if e.response.status_code != 429 or retries >= max_retries:
|
80
80
|
raise
|
81
81
|
retries += 1
|
82
|
-
delay = initial_delay
|
82
|
+
delay = initial_delay * (2 ** retries)
|
83
83
|
# Use Retry-After header if available
|
84
84
|
retry_after = e.response.headers.get('Retry-After')
|
85
85
|
if retry_after:
|
@@ -5,12 +5,12 @@ chunkr_ai/api/auth.py,sha256=hlv0GiUmlsbFO1wLL9sslqOnsBSoBqkL_6Mk2SDvxgE,413
|
|
5
5
|
chunkr_ai/api/chunkr.py,sha256=VnbuAPlWLqyf8xCCU_kpdybgjVPTwZLarDQoD3uozY0,3065
|
6
6
|
chunkr_ai/api/chunkr_base.py,sha256=giW56fL7xxJphdOTpIH52dXxpNt7OdP8pNiPSqbNjGM,5835
|
7
7
|
chunkr_ai/api/configuration.py,sha256=m8QL6s2j1_xSo9bERzJ3UG5j8cE6o-cZIiQGxsSf7Ow,3805
|
8
|
-
chunkr_ai/api/decorators.py,sha256=
|
8
|
+
chunkr_ai/api/decorators.py,sha256=5MEA6e38Rdmry8vMQRyW1DUY0KLlbjH1DjSK8W-0PU8,4071
|
9
9
|
chunkr_ai/api/misc.py,sha256=5PBI6pvOXr0x-3WieSKLrC8MA0iGPa-IG-5FEZ3vnr0,5724
|
10
10
|
chunkr_ai/api/protocol.py,sha256=LjPrYSq52m1afIlAo0yVGXlGZxPRh8J6g7S4PAit3Zo,388
|
11
11
|
chunkr_ai/api/task_response.py,sha256=uvM5uNIImDnivsgujjOh2kxRYuUoqKDhLE1nOH2dJjo,6091
|
12
|
-
chunkr_ai-0.0.
|
13
|
-
chunkr_ai-0.0.
|
14
|
-
chunkr_ai-0.0.
|
15
|
-
chunkr_ai-0.0.
|
16
|
-
chunkr_ai-0.0.
|
12
|
+
chunkr_ai-0.0.29.dist-info/LICENSE,sha256=w3R12yNDyZpMiy2lxy_hvNbsldC75ww79sF0u11rkho,1069
|
13
|
+
chunkr_ai-0.0.29.dist-info/METADATA,sha256=xscJ4AZnLEYPLZeUdduC96W4HLPf0cTDlnW1L4lgGlc,6996
|
14
|
+
chunkr_ai-0.0.29.dist-info/WHEEL,sha256=In9FTNxeP60KnTkGw7wk6mJPYd_dQSjEZmXdBdMCI-8,91
|
15
|
+
chunkr_ai-0.0.29.dist-info/top_level.txt,sha256=0IZY7PZIiS8bw5r4NUQRUQ-ATi-L_3vLQVq3ZLouOW8,10
|
16
|
+
chunkr_ai-0.0.29.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|