Class AsyncPromise

java.lang.Object
bg.codexio.ai.openai.api.sdk.vision.VisionConfigurationStage
bg.codexio.ai.openai.api.sdk.vision.AsyncPromise

public class AsyncPromise extends VisionConfigurationStage
Async promise to choose between raw response or just a simple string answer.
  • Method Details

    • then

      public void then(Consumer<bg.codexio.ai.openai.api.payload.chat.response.ChatMessageResponse> afterAll, Consumer<String> onEachLine)
      Subscribe both to each line (whether streamed or from the whole response) and to the whole response when all lines are supplied.
      Parameters:
      afterAll - callback that accepts the ChatMessageResponse
      onEachLine - callback that accepts each response line as a string
    • onEachLine

      public void onEachLine(Consumer<String> onEachLine)
      Subscribe to each line (whether streamed or from the whole response)
      Parameters:
      onEachLine - callback that accepts each response line as a string
    • then

      public void then(Consumer<bg.codexio.ai.openai.api.payload.chat.response.ChatMessageResponse> afterAll)
      Subscribe to the whole response when all lines are supplied.
      Parameters:
      afterAll - callback that accepts the ChatMessageResponse