Class AsyncPromiseStage
- java.lang.Object
-
- bg.codexio.ai.openai.api.sdk.voice.translation.TranslationConfigurationStage
-
- bg.codexio.ai.openai.api.sdk.voice.translation.AsyncPromiseStage
-
public class AsyncPromiseStage extends TranslationConfigurationStage
Registers callbacks and sends request
-
-
Field Summary
-
Fields inherited from class bg.codexio.ai.openai.api.sdk.voice.translation.TranslationConfigurationStage
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 on each line of the responsevoidthen(Consumer<bg.codexio.ai.openai.api.payload.voice.response.SpeechTextResponse> afterAll)Sends request in asynchronous fashion, registers a callback to be called when response arrives.voidthen(Consumer<String> onEachLine, Consumer<bg.codexio.ai.openai.api.payload.voice.response.SpeechTextResponse> afterAll)Sends request in asynchronous fashion, registers callbacks to be called when response arrives and on each line of the response
-
-
-
Method Detail
-
then
public void then(Consumer<bg.codexio.ai.openai.api.payload.voice.response.SpeechTextResponse> afterAll)
Sends request in asynchronous fashion, registers a callback to be called when response arrives.- Parameters:
afterAll- a callback which accepts theSpeechTextResponse
-
onEachLine
public void onEachLine(Consumer<String> onEachLine)
Sends request in asynchronous fashion, registers a callback to be called on each line of the response- Parameters:
onEachLine- a callback which accepts the String line of the response
-
then
public void then(Consumer<String> onEachLine, Consumer<bg.codexio.ai.openai.api.payload.voice.response.SpeechTextResponse> afterAll)
Sends request in asynchronous fashion, registers callbacks to be called when response arrives and on each line of the response- Parameters:
onEachLine- a callback which accepts the String line of the responseafterAll- a callback which accepts theSpeechTextResponse
-
-