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

Commit 2b44044

Browse files
committed
Merge remote-tracking branch 'origin/main'
2 parents eba59dc + 5d1623a commit 2b44044

File tree

1 file changed

+37
-6
lines changed

1 file changed

+37
-6
lines changed

README.md

Lines changed: 37 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ When you create a transcript, you can either pass in a URL to an audio file
7979
or upload a file directly.
8080

8181
```java
82-
import com.assemblyai.api.types.Transcript;
82+
import com.assemblyai.api.resources.transcripts.types.Transcript;
8383

8484
// Transcribe file at remote URL
8585
Transcript transcript = aai.transcripts().transcribe(
@@ -94,7 +94,7 @@ transcript = aai.transcripts().transcribe(
9494
If you don't want to wait until the transcript is ready, you can use submit:
9595

9696
```java
97-
import com.assemblyai.api.types.Transcript;
97+
import com.assemblyai.api.resources.transcripts.types.Transcript;
9898

9999
// Transcribe file at remote URL
100100
Transcript transcript = aai.transcripts().submit(
@@ -111,7 +111,7 @@ audio streams and sends data over websockets. The Realtime Transcriber
111111
will take event handlers
112112

113113
```java
114-
import com.assemblyai.api.Transcriber;
114+
import com.assemblyai.api.RealtimeTranscriber;
115115

116116
RealtimeTranscriber realtime = RealtimeTranscriber.builder()
117117
.apiKey("YOUR_API_KEY")
@@ -135,13 +135,44 @@ method on `CreateTranscriptParameters` until you have specified the mandatory
135135
audioUrl variable.
136136

137137
```java
138-
import com.assemblyai.api.TranscriptParams;
138+
import com.assemblyai.api.resources.transcripts.requests.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)