Skip to content
This repository was archived by the owner on Apr 1, 2025. It is now read-only.

Commit d774143

Browse files
committed
Add section about timeouts
1 parent 827dd0f commit d774143

File tree

1 file changed

+33
-2
lines changed

1 file changed

+33
-2
lines changed

README.md

Lines changed: 33 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -138,10 +138,41 @@ audioUrl variable.
138138
import com.assemblyai.api.TranscriptParams;
139139

140140
TranscriptParams params = TranscriptParams.builder()
141-
.audioUrl("https://...")
142-
.build();
141+
.audioUrl("https://...")
142+
.build();
143+
```
144+
145+
## Timeouts
146+
147+
The SDK uses the default timeouts of OkHttpClient:
148+
- 10 seconds for connection timeout
149+
- 10 seconds for read timeout
150+
- 10 seconds for write timeout
151+
- No timeout for call timeout
152+
153+
However, there are **no timeouts for any LeMUR** HTTP request.
154+
155+
To specify your own timeout, you can pass `RequestOptions` to each request method:
156+
157+
```java
158+
import com.assemblyai.api.core.RequestOptions;
159+
160+
// initialize client
161+
162+
client.transcripts()
163+
.get(
164+
"50c54d73-7a3f-44dc-af6b-f4579841b1ce",
165+
RequestOptions.builder()
166+
.timeout(30, TimeUnit.SECONDS)
167+
.build()
168+
);
143169
```
144170

171+
For this operation, the call timeout will be 30 seconds, and the other timeouts will be turned off.
172+
173+
The default timeout should be sufficient for most use cases.
174+
However, depending on your network speed and distance, you may occasionally experience timeouts, in which case you can increase the timeout.
175+
145176
## Contributing
146177
While we value open-source contributions to this SDK, this library
147178
is generated programmatically. Additions made directly to this library

0 commit comments

Comments
 (0)