Package org.eclnt.ccee.prompting.chatgpt
Class PromptingChatGPT
java.lang.Object
org.eclnt.ccee.prompting.PromptingBase
org.eclnt.ccee.prompting.PromptingWithToolsBase
org.eclnt.ccee.prompting.chatgpt.PromptingChatGPT
- All Implemented Interfaces:
IPrompting,IPromptingWithTools
ChatGPT API implementation using ChatGPT's assistant API. This is a quite
outdated version of interfacing to ChatGPT - the more up to date version is
PromptingChatGPTResponsesAPI.-
Nested Class Summary
Nested classes/interfaces inherited from class org.eclnt.ccee.prompting.PromptingBase
PromptingBase.ErrorRequestCancelled, PromptingBase.PromptingRequestThread -
Field Summary
Fields inherited from class org.eclnt.ccee.prompting.PromptingWithToolsBase
m_contextAssigner, m_promptingToolFields inherited from class org.eclnt.ccee.prompting.PromptingBase
m_listeners -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidprotected voidprotected voidpostIsolatedPrompt(String prompt) During a prompt processing you may post dedicated prompts to the prompting that are not part of the original prompt processing.
Example: the user sends a message into the prompting.voidThis function to be called by the callback processing transferring the result of processing back to the LLM.protected voidstartNewMessageExecute(List<PromptingMessage> messages) Actual implementation of sending the prompt text to the LLM.Methods inherited from class org.eclnt.ccee.prompting.PromptingWithToolsBase
callBackTools, initializeContextToToolsThreadAssigner, initializeToolMethods inherited from class org.eclnt.ccee.prompting.PromptingBase
addInitialSystemMessage, addInterimComment, addMessage, addMessageExtender, addPromptingListener, cancelCurrentRequest, createRequestThread, getMessageExtenders, getWithInterimFramgents, mdComment, prepareNewMessage, processResponseCompleted, processResponseMarkdownFragmentReceived, removeMessageExtender, removePromptingListener, setWithInterimFramgents, startNewMessageMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.eclnt.ccee.prompting.IPrompting
addInterimComment, addMessage, addPromptingListener, cancelCurrentRequest, removePromptingListener, startNewMessageMethods inherited from interface org.eclnt.ccee.prompting.IPromptingWithTools
initializeContextToToolsThreadAssigner, initializeTool
-
Constructor Details
-
PromptingChatGPT
public PromptingChatGPT()
-
-
Method Details
-
initialize
protected void initialize() -
calculateAssistantId
protected void calculateAssistantId() -
calculateThreadId
protected void calculateThreadId() -
startNewMessageExecute
Description copied from class:PromptingBaseActual implementation of sending the prompt text to the LLM.- Overrides:
startNewMessageExecutein classPromptingBase- Parameters:
messages- All the messages of this prompting session.
-
processToolOutput
Description copied from interface:IPromptingWithToolsThis function to be called by the callback processing transferring the result of processing back to the LLM.- Specified by:
processToolOutputin interfaceIPromptingWithTools- Overrides:
processToolOutputin classPromptingWithToolsBase
-
postIsolatedPrompt
Description copied from interface:IPromptingDuring a prompt processing you may post dedicated prompts to the prompting that are not part of the original prompt processing.
Example: the user sends a message into the prompting. During processing of this message the prompting processing wants to summarize this message.- Specified by:
postIsolatedPromptin interfaceIPrompting
-