Class ChatOrchestrator
java.lang.Object
com.developer.nefarious.zjoule.plugin.chat.ChatOrchestrator
- All Implemented Interfaces:
IChatOrchestrator
Orchestrates the chat process by interacting with the AI client to retrieve
answers based on user prompts and active editor content. Implements the
IChatOrchestrator
interface to provide chat functionality.-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionGenerates an AI response for the given user prompt by performing the following steps: Determining which AI client to use. Fetching the chat message history from the client. Retrieving the content of the active editor window as context. Creating system and user messages for the AI. Obtaining the response from the AI client via a chat completion request. Saving the updated chat history back to the AI client. Returning the response message as a string.
-
Constructor Details
-
ChatOrchestrator
public ChatOrchestrator()
-
-
Method Details
-
getAnswer
Generates an AI response for the given user prompt by performing the following steps:- Determining which AI client to use.
- Fetching the chat message history from the client.
- Retrieving the content of the active editor window as context.
- Creating system and user messages for the AI.
- Obtaining the response from the AI client via a chat completion request.
- Saving the updated chat history back to the AI client.
- Returning the response message as a string.
- Specified by:
getAnswer
in interfaceIChatOrchestrator
- Parameters:
userPrompt
- the prompt or query provided by the user.- Returns:
- the AI-generated response as a
String
.
-