Example:
From 3a2b1c4d5e6f7890 Mon Sep 17 00:00:00 2001 From: Sideko Engineer <team@sideko.dev> Date: Tue, 21 Jan 2025 09:15:00 -0800 Subject: [PATCH] Add retry mechanism with exponential backoff
Add robust retry handling for API requests with exponential backoff. Includes comprehensive type hints and error handling.
diff --git a/sdk/client.py b/sdk/client.py index 1234567..89abcdef 100644 --- a/sdk/client.py +++ b/sdk/client.py @@ -1,8 +1,42 @@ -from typing import Any, Dict, Optional +from typing import Any, Dict, Optional, TypeVar from time import sleep +from functools import wraps
-class APIClient: - def make_request(self, endpoint: str, data: Optional[Dict[str, Any]] = None) -> Dict[str, Any]: - response = self._send_request(endpoint, data) - return response.json() +T = TypeVar('T')