Package com.intellijava.core.model.input
Class LanguageModelInput
java.lang.Object
com.intellijava.core.model.input.LanguageModelInput
LanguageModelInput handle the input parameters for the majority of the remote language models.
Language models documentations:
- Openai : https://beta.openai.com/docs/api-reference/completions.
- Cohere : https://docs.cohere.ai/reference/generate
- Author:
- github.com/Barqawiz
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic class
Builder class for LanguageModelInput. -
Constructor Summary
ConstructorDescriptionLanguageModelInput
(String model, String prompt, float temperature, int maxTokens, int numberOfOutputs) LanguageModelInput default constructor. -
Method Summary
Modifier and TypeMethodDescriptionint
Gets the maxTokens.getModel()
Gets the model.int
Gets the number of model outputs.Gets the prompt.float
Gets the temperature.void
setMaxTokens
(int maxTokens) Sets the maxTokens.void
Sets the model.void
setNumberOfOutputs
(int numberOfOutputs) Sets the numberOfOutputs.void
Sets the prompt.void
setTemperature
(float temperature) Sets the temperature.
-
Constructor Details
-
LanguageModelInput
public LanguageModelInput(String model, String prompt, float temperature, int maxTokens, int numberOfOutputs) LanguageModelInput default constructor.- Parameters:
model
- name.prompt
- text.temperature
- model creativity between 0 and 1.maxTokens
- number of input and output tokens.numberOfOutputs
- number of generated text.
-
-
Method Details
-
getModel
Gets the model.- Returns:
- model
-
getPrompt
Gets the prompt.- Returns:
- prompt
-
getTemperature
public float getTemperature()Gets the temperature.- Returns:
- temperature
-
getMaxTokens
public int getMaxTokens()Gets the maxTokens.- Returns:
- maxTokens
-
getNumberOfOutputs
public int getNumberOfOutputs()Gets the number of model outputs.- Returns:
- numberOfOutputs
-
setModel
Sets the model.- Parameters:
model
-
-
setPrompt
Sets the prompt.- Parameters:
prompt
-
-
setTemperature
public void setTemperature(float temperature) Sets the temperature.- Parameters:
temperature
- higher values means more risks and creativity.
-
setMaxTokens
public void setMaxTokens(int maxTokens) Sets the maxTokens.- Parameters:
maxTokens
- maximum size of the model input and output.
-
setNumberOfOutputs
public void setNumberOfOutputs(int numberOfOutputs) Sets the numberOfOutputs.- Parameters:
numberOfOutputs
- number of model outputs, default value is 1.
-