Class AsyncPromiseStage
- java.lang.Object
-
- bg.codexio.ai.openai.api.sdk.voice.speech.SpeechConfigurationStage
-
- bg.codexio.ai.openai.api.sdk.voice.speech.AsyncPromiseStage
-
public class AsyncPromiseStage extends SpeechConfigurationStage
Registers callbacks
-
-
Field Summary
-
Fields inherited from class bg.codexio.ai.openai.api.sdk.voice.speech.SpeechConfigurationStage
executor, requestBuilder
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidonEachLine(Consumer<String> onEachLine)Sends request in asynchronous fashion, registers a callback to be called when String/byteArray line of the response is received.voidonEachLine(Consumer<String> onEachLine, Consumer<Throwable> onError)Sends request in asynchronous fashion, registers a callback to be called when String/byteArray line of the response is received.voidthen(Consumer<File> afterAll)Sends request in asynchronous fashion, registers a callback to be called when file is downloaded.voidthen(Consumer<File> afterAll, Consumer<Throwable> onError)Sends request in asynchronous fashion, registers a callback to be called when file is downloaded.voidthen(Consumer<String> onEachLine, Consumer<File> afterAll, Consumer<Throwable> onError)Sends request in asynchronous fashion, registers a callback to be called when file is downloaded and a callback to be called when String/byteArray line
-
-
-
Method Detail
-
then
public void then(Consumer<File> afterAll)
Sends request in asynchronous fashion, registers a callback to be called when file is downloaded.- Parameters:
afterAll- a callback which accepts the downloaded audioFile
-
then
public void then(Consumer<File> afterAll, Consumer<Throwable> onError)
Sends request in asynchronous fashion, registers a callback to be called when file is downloaded.- Parameters:
afterAll- a callback which accepts the downloaded audioFileonError- a callback which will be invoked if an error occurs
-
onEachLine
public void onEachLine(Consumer<String> onEachLine)
Sends request in asynchronous fashion, registers a callback to be called when String/byteArray line of the response is received.- Parameters:
onEachLine- a callback which accepts a String line of the response
-
onEachLine
public void onEachLine(Consumer<String> onEachLine, Consumer<Throwable> onError)
Sends request in asynchronous fashion, registers a callback to be called when String/byteArray line of the response is received.- Parameters:
onEachLine- a callback which accepts a String line of the responseonError- a callback which will be invoked if an error occurs
-
then
public void then(Consumer<String> onEachLine, Consumer<File> afterAll, Consumer<Throwable> onError)
Sends request in asynchronous fashion, registers a callback to be called when file is downloaded and a callback to be called when String/byteArray line- Parameters:
onEachLine- a callback which accepts a String line of the responseafterAll- a callback which accepts the downloaded audioFileonError- a callback which will be invoked if an error occurs
-
-