diff --git a/README.md b/README.md index 32ce2840..24795a9d 100644 --- a/README.md +++ b/README.md @@ -79,7 +79,7 @@ When you create a transcript, you can either pass in a URL to an audio file or upload a file directly. ```java -import com.assemblyai.api.types.Transcript; +import com.assemblyai.api.resources.transcripts.types.Transcript; // Transcribe file at remote URL Transcript transcript = aai.transcripts().transcribe( @@ -94,7 +94,7 @@ transcript = aai.transcripts().transcribe( If you don't want to wait until the transcript is ready, you can use submit: ```java -import com.assemblyai.api.types.Transcript; +import com.assemblyai.api.resources.transcripts.types.Transcript; // Transcribe file at remote URL Transcript transcript = aai.transcripts().submit( @@ -111,7 +111,7 @@ audio streams and sends data over websockets. The Realtime Transcriber will take event handlers ```java -import com.assemblyai.api.Transcriber; +import com.assemblyai.api.RealtimeTranscriber; RealtimeTranscriber realtime = RealtimeTranscriber.builder() .apiKey("YOUR_API_KEY") @@ -135,13 +135,44 @@ method on `CreateTranscriptParameters` until you have specified the mandatory audioUrl variable. ```java -import com.assemblyai.api.TranscriptParams; +import com.assemblyai.api.resources.transcripts.requests.TranscriptParams; TranscriptParams params = TranscriptParams.builder() - .audioUrl("https://...") - .build(); + .audioUrl("https://...") + .build(); +``` + +## Timeouts + +The SDK uses the default timeouts of OkHttpClient: +* 10 seconds for connection timeout +* 10 seconds for read timeout +* 10 seconds for write timeout +* No timeout for call timeout + +However, there are **no timeouts for any LeMUR** HTTP request. + +To specify your own timeout, you can pass `RequestOptions` to each request method: + +```java +import com.assemblyai.api.core.RequestOptions; + +// initialize client + +client.transcripts() + .get( + "50c54d73-7a3f-44dc-af6b-f4579841b1ce", + RequestOptions.builder() + .timeout(30, TimeUnit.SECONDS) + .build() + ); ``` +For this operation, the call timeout will be 30 seconds, and the other timeouts will be turned off. + +The default timeout should be sufficient for most use cases. +However, depending on your network speed and distance, you may occasionally experience timeouts, in which case you can increase the timeout. + ## Contributing While we value open-source contributions to this SDK, this library is generated programmatically. Additions made directly to this library