Skip to content

Commit

Permalink
Add waitUntilReady
Browse files Browse the repository at this point in the history
  • Loading branch information
Swimburger committed Jul 22, 2024
1 parent 12bc6a9 commit 24f7e44
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 4 deletions.
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ publishing {
maven(MavenPublication) {
groupId = 'com.assemblyai'
artifactId = 'assemblyai-java'
version = '2.1.2'
version = '2.1.3'
from components.java
pom {
scm {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -146,10 +146,15 @@ public Transcript transcribe(String url) {
*/
public Transcript transcribe(String url, TranscriptOptionalParams transcriptParams) {
Transcript transcriptResponse = submit(url, transcriptParams);
return awaitCompletion(transcriptResponse.getId());
return waitUntilReady(transcriptResponse.getId());
}

private Transcript awaitCompletion(String transcriptId) {
/**
* Wait until an existing transcript has the status "completed" or "error".
* @param transcriptId The ID of the transcript
* @return The transcript with status "completed" or "error"
*/
private Transcript waitUntilReady(String transcriptId) {
try {
while (true) {
Transcript transcript = this.client.transcripts().get(transcriptId);
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/com/assemblyai/api/core/Constants.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
package com.assemblyai.api.core;

public class Constants {
public static final String SDK_VERSION = "2.1.2";
public static final String SDK_VERSION = "2.1.3";
}

0 comments on commit 24f7e44

Please sign in to comment.