Package ai.optfor.springopenaiapi.model
Record Class ChatCompletionRequest
java.lang.Object
java.lang.Record
ai.optfor.springopenaiapi.model.ChatCompletionRequest
public record ChatCompletionRequest(String model, List<ChatMessage> messages, double temperature, int max_tokens)
extends Record
-
Constructor Summary
ConstructorsConstructorDescriptionChatCompletionRequest(String model, List<ChatMessage> messages, double temperature, int max_tokens) Creates an instance of aChatCompletionRequestrecord class. -
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.intReturns the value of themax_tokensrecord component.messages()Returns the value of themessagesrecord component.model()Returns the value of themodelrecord component.doubleReturns the value of thetemperaturerecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
ChatCompletionRequest
public ChatCompletionRequest(String model, List<ChatMessage> messages, double temperature, int max_tokens) Creates an instance of aChatCompletionRequestrecord class.- Parameters:
model- the value for themodelrecord componentmessages- the value for themessagesrecord componenttemperature- the value for thetemperaturerecord componentmax_tokens- the value for themax_tokensrecord component
-
-
Method Details
-
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. Reference components are compared withObjects::equals(Object,Object); primitive components are compared with '=='. -
model
Returns the value of themodelrecord component.- Returns:
- the value of the
modelrecord component
-
messages
Returns the value of themessagesrecord component.- Returns:
- the value of the
messagesrecord component
-
temperature
public double temperature()Returns the value of thetemperaturerecord component.- Returns:
- the value of the
temperaturerecord component
-
max_tokens
public int max_tokens()Returns the value of themax_tokensrecord component.- Returns:
- the value of the
max_tokensrecord component
-