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

    Modifier and Type
    Method
    Description
    void
    onEachLine(Consumer<String> onEachLine)
    Sends request in asynchronous fashion, registers a callback to be called on each line of the response
    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.
    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

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Method Details

    • 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 the SpeechTextResponse
    • 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 response
      afterAll - a callback which accepts the SpeechTextResponse