Record Class ChatMessageResponse
java.lang.Object
java.lang.Record
bg.codexio.ai.openai.api.payload.chat.response.ChatMessageResponse
- All Implemented Interfaces:
Mergeable<ChatMessageResponse>
public record ChatMessageResponse(String id, String object, long created, String model, ChatUsageResponse usage, List<ChatChoiceResponse> choices)
extends Record
implements Mergeable<ChatMessageResponse>
Represents a
invalid input: '<'a href="https://platform.openai.com/docs/api-reference/chat/object>Chat completion object
-
Constructor Summary
ConstructorsConstructorDescriptionChatMessageResponse(String id, String object, long created, String model, ChatUsageResponse usage, List<ChatChoiceResponse> choices) Creates an instance of aChatMessageResponserecord class. -
Method Summary
Modifier and TypeMethodDescriptionchoices()Returns the value of thechoicesrecord component.longcreated()Returns the value of thecreatedrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.id()Returns the value of theidrecord component.merge(ChatMessageResponse other) model()Returns the value of themodelrecord component.object()Returns the value of theobjectrecord component.final StringtoString()Returns a string representation of this record class.usage()Returns the value of theusagerecord component.
-
Constructor Details
-
ChatMessageResponse
public ChatMessageResponse(String id, String object, long created, String model, ChatUsageResponse usage, List<ChatChoiceResponse> choices) Creates an instance of aChatMessageResponserecord class.- Parameters:
id- the value for theidrecord componentobject- the value for theobjectrecord componentcreated- the value for thecreatedrecord componentmodel- the value for themodelrecord componentusage- the value for theusagerecord componentchoices- the value for thechoicesrecord component
-
-
Method Details
-
merge
- Specified by:
mergein interfaceMergeable<ChatMessageResponse>
-
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 '=='. -
id
Returns the value of theidrecord component.- Returns:
- the value of the
idrecord component
-
object
Returns the value of theobjectrecord component.- Returns:
- the value of the
objectrecord component
-
created
public long created()Returns the value of thecreatedrecord component.- Returns:
- the value of the
createdrecord component
-
model
Returns the value of themodelrecord component.- Returns:
- the value of the
modelrecord component
-
usage
Returns the value of theusagerecord component.- Returns:
- the value of the
usagerecord component
-
choices
Returns the value of thechoicesrecord component.- Returns:
- the value of the
choicesrecord component
-