Class Run
java.lang.Object
com.jackdaw.chatwithnpc.openaiapi.Run
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classRepresents the result of a Run request. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidcallFunctionsAndReply(ConversationHandler conversation) Call the functions and reply the messagebooleanCheck if the run is completedbooleanCheck if the run requires actionstatic @NotNull Run.RunResultrun(@NotNull ConversationHandler conversation) Run the assistant for the NPC from the OpenAI API, and it will return the result.
-
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
Call the functions and reply the message- Parameters:
conversation- The conversation handler
-