File tree Expand file tree Collapse file tree 1 file changed +32
-2
lines changed
Expand file tree Collapse file tree 1 file changed +32
-2
lines changed Original file line number Diff line number Diff line change @@ -62,8 +62,38 @@ output = client.run("wavespeed-ai/z-image/turbo", input={"prompt": "Cat"})
6262output = 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
You can’t perform that action at this time.
0 commit comments