java.lang.Object
com.jackdaw.chatwithnpc.openaiapi.Run

public class Run extends Object
  • Constructor Details

    • Run

      public Run()
  • Method Details

    • run

      @NotNull public static @NotNull Run.RunResult run(@NotNull @NotNull ConversationHandler conversation) throws Exception
      Run the assistant for the NPC from the OpenAI API, and it will return the result.
      Parameters:
      conversation - The conversation handler
      Returns:
      The result of the run
      Throws:
      Exception - If the run status is null
    • isCompleted

      public boolean isCompleted()
      Check if the run is completed
      Returns:
      True if the run is completed
    • isRequiresAction

      public boolean isRequiresAction()
      Check if the run requires action
      Returns:
      True if the run requires action
    • callFunctionsAndReply

      public void callFunctionsAndReply(ConversationHandler conversation)
      Call the functions and reply the message
      Parameters:
      conversation - The conversation handler