Package com.tnsai.llm
Record Class LLMResolver.LLMSpec
java.lang.Object
java.lang.Record
com.tnsai.llm.LLMResolver.LLMSpec
- Record Components:
model- the model nametemperature- the sampling temperature (may be null)
- All Implemented Interfaces:
LLMSpecSource
- Enclosing class:
LLMResolver
public static record LLMResolver.LLMSpec(String model, Float temperature)
extends Record
implements LLMSpecSource
LLM configuration record for passing model settings.
This is a simple config holder that can be used in the resolution chain. For framework-agnostic config, see PortableLLMSpec in tnsai-integration.
Implements LLMSpecSource for interoperability with other config types.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.booleanChecks if temperature is specified.model()Returns the value of themodelrecord component.static LLMResolver.LLMSpecCreates a config with just a model name.static LLMResolver.LLMSpecCreates a config with model and temperature.Returns the value of thetemperaturerecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
LLMSpec
Creates an instance of aLLMSpecrecord class.- Parameters:
model- the value for themodelrecord componenttemperature- the value for thetemperaturerecord component
-
-
Method Details
-
of
Creates a config with just a model name.- Parameters:
model- the model name- Returns:
- new LLM config
-
of
Creates a config with model and temperature.- Parameters:
model- the model nametemperature- the temperature- Returns:
- new LLM config
-
hasTemperature
public boolean hasTemperature()Description copied from interface:LLMSpecSourceChecks if temperature is specified.- Specified by:
hasTemperaturein interfaceLLMSpecSource- Returns:
- true if temperature is not null
-
toString
Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components. -
hashCode
public final int hashCode()Returns a hash code value for this object. The value is derived from the hash code of each of the record components. -
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared withObjects::equals(Object,Object). -
model
Returns the value of themodelrecord component.- Specified by:
modelin interfaceLLMSpecSource- Returns:
- the value of the
modelrecord component
-
temperature
Returns the value of thetemperaturerecord component.- Specified by:
temperaturein interfaceLLMSpecSource- Returns:
- the value of the
temperaturerecord component
-