Wraps observable JavaFX properties for name, API provider, model identifier,
API key, and temperature bounds. Versioning is inherited from
BusinessDomainObject
and updated automatically when
observed properties change.
A lazily created Promptable
instance can be obtained
from the configured PromptableApi
using
PromptableFactory
.
- Since:
- 1.0
- Author:
- Felix Seggebäing
-
Property Summary
PropertiesTypePropertyDescriptionjavafx.beans.property.StringProperty
javafx.beans.property.ObjectProperty
<PromptableApi> javafx.beans.property.DoubleProperty
javafx.beans.property.DoubleProperty
javafx.beans.property.StringProperty
javafx.beans.property.StringProperty
-
Constructor Summary
ConstructorsConstructorDescriptionLLM()
Creates a newLLM
instance with default values.LLM
(String name, PromptableApi promptableApi, String model, String apiKey, double minTemperature, double maxTemperature) Creates a newLLM
instance with the given configuration.LLM
(String name, PromptableApi promptableApi, String model, String apiKey, double minTemperature, double maxTemperature, Long version) Creates a newLLM
instance with the given configuration. -
Method Summary
Modifier and TypeMethodDescriptionjavafx.beans.property.StringProperty
Gets the value of theapiKey
property.Gets the value of thellmApi
property.double
Gets the value of themaxTemperature
property.double
Gets the value of theminTemperature
property.getModel()
Gets the value of themodel
property.getName()
Gets the value of thename
property.Returns thePromptable
instance associated with this LLM.javafx.beans.property.ObjectProperty
<PromptableApi> javafx.beans.property.DoubleProperty
javafx.beans.property.DoubleProperty
javafx.beans.property.StringProperty
javafx.beans.property.StringProperty
void
Sets the value of theapiKey
property.void
setLlmApi
(PromptableApi promptableApi) Sets the API provider for this LLM.void
setMaxTemperature
(double maxTemperature) Sets the value of themaxTemperature
property.void
setMinTemperature
(double minTemperature) Sets the value of theminTemperature
property.void
Sets the value of themodel
property.void
Sets the value of thename
property.toString()
Returns a human-readable string representation of this LLM.Methods inherited from class de.seggebaeing.sqlanalyzer.logic.bdo.BusinessDomainObject
getVersion, refreshVersion, registerProperties, setVersion
-
Property Details
-
name
public javafx.beans.property.StringProperty nameProperty- See Also:
-
llmApi
- See Also:
-
minTemperature
public javafx.beans.property.DoubleProperty minTemperatureProperty- See Also:
-
maxTemperature
public javafx.beans.property.DoubleProperty maxTemperatureProperty- See Also:
-
model
public javafx.beans.property.StringProperty modelProperty- See Also:
-
apiKey
public javafx.beans.property.StringProperty apiKeyProperty- See Also:
-
-
Constructor Details
-
LLM
public LLM()Creates a newLLM
instance with default values.Initializes all string fields as empty, the API as
null
, temperatures as0
and1
, and the version asnull
. -
LLM
public LLM(String name, PromptableApi promptableApi, String model, String apiKey, double minTemperature, double maxTemperature) Creates a newLLM
instance with the given configuration.Sets the version to
null
, causing it to be initialized automatically.- Parameters:
name
- non-null name of the LLMpromptableApi
- non-null API providermodel
- non-null model identifierapiKey
- non-null API keyminTemperature
- minimum temperature valuemaxTemperature
- maximum temperature value- Throws:
NullPointerException
- if any string orpromptableApi
isnull
-
LLM
public LLM(String name, PromptableApi promptableApi, String model, String apiKey, double minTemperature, double maxTemperature, Long version) Creates a newLLM
instance with the given configuration.Initializes all fields and registers property listeners so that changes automatically update the version. If
version
isnull
, the version is initialized to the current time.- Parameters:
name
- non-null name of the LLMpromptableApi
- non-null API providermodel
- non-null model identifierapiKey
- non-null API keyminTemperature
- minimum temperature valuemaxTemperature
- maximum temperature valueversion
- initial version value, ornull
for auto-generation- Throws:
NullPointerException
- ifname
,model
, orapiKey
isnull
-
-
Method Details
-
toString
Returns a human-readable string representation of this LLM.Format:
name (model)
. -
getName
Gets the value of thename
property.- Property description:
- Returns:
- the value of the
name
property - See Also:
-
nameProperty
public javafx.beans.property.StringProperty nameProperty()- Returns:
- the
name
property - See Also:
-
getPromptable
Returns thePromptable
instance associated with this LLM.The instance is created lazily via
PromptableFactory
using the currentgetLlmApi()
value and cached for subsequent calls.- Returns:
- the lazily initialized
Promptable
for this LLM
-
setName
Sets the value of thename
property.- Property description:
- Parameters:
name
- the value for thename
property- See Also:
-
setLlmApi
Sets the API provider for this LLM.Also resets the cached
Promptable
instance so it will be recreated on the next call togetPromptable()
.- Parameters:
promptableApi
- API provider
-
getLlmApi
Gets the value of thellmApi
property.- Property description:
- Returns:
- the value of the
llmApi
property - See Also:
-
llmApiProperty
- Returns:
- the
llmApi
property - See Also:
-
setMinTemperature
public void setMinTemperature(double minTemperature) Sets the value of theminTemperature
property.- Property description:
- Parameters:
minTemperature
- the value for theminTemperature
property- See Also:
-
getMinTemperature
public double getMinTemperature()Gets the value of theminTemperature
property.- Property description:
- Returns:
- the value of the
minTemperature
property - See Also:
-
minTemperatureProperty
public javafx.beans.property.DoubleProperty minTemperatureProperty()- Returns:
- the
minTemperature
property - See Also:
-
setMaxTemperature
public void setMaxTemperature(double maxTemperature) Sets the value of themaxTemperature
property.- Property description:
- Parameters:
maxTemperature
- the value for themaxTemperature
property- See Also:
-
getMaxTemperature
public double getMaxTemperature()Gets the value of themaxTemperature
property.- Property description:
- Returns:
- the value of the
maxTemperature
property - See Also:
-
maxTemperatureProperty
public javafx.beans.property.DoubleProperty maxTemperatureProperty()- Returns:
- the
maxTemperature
property - See Also:
-
setModel
Sets the value of themodel
property.- Property description:
- Parameters:
model
- the value for themodel
property- See Also:
-
getModel
Gets the value of themodel
property.- Property description:
- Returns:
- the value of the
model
property - See Also:
-
modelProperty
public javafx.beans.property.StringProperty modelProperty()- Returns:
- the
model
property - See Also:
-
setApiKey
Sets the value of theapiKey
property.- Property description:
- Parameters:
model
- the value for theapiKey
property- See Also:
-
getApiKey
Gets the value of theapiKey
property.- Property description:
- Returns:
- the value of the
apiKey
property - See Also:
-
apiKeyProperty
public javafx.beans.property.StringProperty apiKeyProperty()- Returns:
- the
apiKey
property - See Also:
-