Class Threads
java.lang.Object
com.jackdaw.chatwithnpc.openaiapi.Threads
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic void
addMessage
(String threadId, String message) Add a message to the threadstatic void
createThread
(@NotNull ConversationHandler conversationHandler) Create a new thread and set the thread id to the npcstatic void
discardThread
(String threadId) Discard the thread id from the npc
-
Constructor Details
-
Threads
public Threads()
-
-
Method Details
-
createThread
public static void createThread(@NotNull @NotNull ConversationHandler conversationHandler) throws Exception Create a new thread and set the thread id to the npc- Parameters:
conversationHandler
- The conversation handler- Throws:
Exception
- If the thread id is null
-
addMessage
Add a message to the thread- Parameters:
threadId
- The thread idmessage
- The message- Throws:
Exception
- If the message is not sent
-
discardThread
Discard the thread id from the npc- Parameters:
threadId
- The thread id- Throws:
Exception
- If is there any error
-