Package com.intellijava.core.model.input
Class ChatGPTInput.Builder
java.lang.Object
com.intellijava.core.model.input.ChatGPTInput.Builder
- Enclosing class:
ChatGPTInput
Builder class for ChatGPTInput.
-
Constructor Summary
ConstructorDescriptionBuilder
(ChatGPTMessage systemMessage) Builder for ChatGPTInput with the system or chatbot instructions.Builder for ChatGPTInput with the system or chatbot instructions. -
Method Summary
Modifier and TypeMethodDescriptionaddMessage
(ChatGPTMessage message) Add the chat message.addUserMessage
(String prompt) Add input message for your prompt.build()
Build the final ChatGPTInput object.setMaxTokens
(int maxTokens) Sets the maxTokens.Sets chatGPT model name, default is gpt-3.5-turbo.setNumberOfOutputs
(int numberOfOutputs) Sets the numberOfOutputssetTemperature
(float temperature) Sets the temperature.
-
Constructor Details
-
Builder
Builder for ChatGPTInput with the system or chatbot instructions. Example of general system instruction: You are a helpful assistant.- Parameters:
systemMessage
- the system instruction to define the chat mode/theme.
-
Builder
Builder for ChatGPTInput with the system or chatbot instructions. Example of general system instruction: You are a helpful assistant.- Parameters:
systemPrompt
- string input to define the chat mode/theme.
-
-
Method Details
-
addMessage
Add the chat message.- Parameters:
message
- (content and role)- Returns:
- instance of Builder.
-
setTemperature
Sets the temperature.- Parameters:
temperature
- higher values means more risks and creativity.- Returns:
- instance of Builder.
-
setNumberOfOutputs
Sets the numberOfOutputs- Parameters:
numberOfOutputs
- number of model outputs, default value is 1.- Returns:
- instance of Builder.
-
setMaxTokens
Sets the maxTokens.- Parameters:
maxTokens
- maximum size of the model input and output.- Returns:
- instance of Builder.
-
addUserMessage
Add input message for your prompt.- Parameters:
prompt
- model input with user role.- Returns:
- instance of Builder.
-
setModel
Sets chatGPT model name, default is gpt-3.5-turbo.- Parameters:
model
- the model name.- Returns:
- instance of Builder.
-
build
Build the final ChatGPTInput object.- Returns:
- final LanguageModelInput object.
-