feat: add automatic client retry logic with exponential backoff
All checks were successful
Publish to PyPI / publish (push) Successful in 16s
All checks were successful
Publish to PyPI / publish (push) Successful in 16s
This commit is contained in:
parent
5040d181d2
commit
93adb6c45c
7 changed files with 87 additions and 66 deletions
|
|
@ -349,7 +349,8 @@ SecureChatCompletion(
|
|||
base_url: str = "https://api.nomyo.ai",
|
||||
allow_http: bool = False,
|
||||
api_key: Optional[str] = None,
|
||||
secure_memory: bool = True
|
||||
secure_memory: bool = True,
|
||||
max_retries: int = 2
|
||||
)
|
||||
```
|
||||
|
||||
|
|
@ -359,6 +360,7 @@ SecureChatCompletion(
|
|||
- `allow_http`: Allow HTTP connections (ONLY for local development, never in production)
|
||||
- `api_key`: Optional API key for bearer authentication
|
||||
- `secure_memory`: Enable secure memory protection (default: True)
|
||||
- `max_retries`: Retries on retryable errors (429, 500, 502, 503, 504, network errors) with exponential backoff. Default: 2
|
||||
|
||||
#### Methods
|
||||
|
||||
|
|
@ -370,7 +372,7 @@ SecureChatCompletion(
|
|||
#### Constructor
|
||||
|
||||
```python
|
||||
SecureCompletionClient(router_url: str = "https://api.nomyo.ai")
|
||||
SecureCompletionClient(router_url: str = "https://api.nomyo.ai", allow_http: bool = False, max_retries: int = 2)
|
||||
```
|
||||
|
||||
#### Methods
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue