Class AsyncPromise

java.lang.Object
bg.codexio.ai.openai.api.sdk.chat.ChatConfigurationStage
bg.codexio.ai.openai.api.sdk.chat.AsyncPromise

public class AsyncPromise extends ChatConfigurationStage
Promise abstraction. Accepts a callback which will be called when response is received.
  • Method Details

    • then

      public void then(Consumer<String> onResponse)
      Subscribe to the answer
      Parameters:
      onResponse - a callback that receives the string answer