Skip to content

Commit 6fe97e8

Browse files
chengzeyiclaude
andcommitted
Add retry and sync mode documentation to README
🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <[email protected]>
1 parent 35e5f88 commit 6fe97e8

File tree

1 file changed

+32
-2
lines changed

1 file changed

+32
-2
lines changed

README.md

Lines changed: 32 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,8 +62,38 @@ output = client.run("wavespeed-ai/z-image/turbo", input={"prompt": "Cat"})
6262
output = wavespeed.run(
6363
"wavespeed-ai/z-image/turbo",
6464
input={"prompt": "Cat"},
65-
timeout=36000.0 # Max wait time in seconds (default: 36000.0)
66-
poll_interval=1.0, # Status check interval (default: 1.0)
65+
timeout=36000.0, # Max wait time in seconds (default: 36000.0)
66+
poll_interval=1.0, # Status check interval (default: 1.0)
67+
enable_sync_mode=False, # Single request mode, no polling (default: False)
68+
)
69+
```
70+
71+
### Sync Mode
72+
73+
Use `enable_sync_mode=True` for a single request that waits for the result (no polling).
74+
75+
> **Note:** Not all models support sync mode. Check the model documentation for availability.
76+
77+
```python
78+
output = wavespeed.run(
79+
"wavespeed-ai/z-image/turbo",
80+
input={"prompt": "Cat"},
81+
enable_sync_mode=True,
82+
)
83+
```
84+
85+
### Retry Configuration
86+
87+
Configure retries at the client level:
88+
89+
```python
90+
from wavespeed import Client
91+
92+
client = Client(
93+
api_key="your-api-key",
94+
max_retries=0, # Task-level retries (default: 0)
95+
max_connection_retries=5, # HTTP connection retries (default: 5)
96+
retry_interval=1.0, # Base delay between retries in seconds (default: 1.0)
6797
)
6898
```
6999

0 commit comments

Comments
 (0)