Package com.tnsai.agents.async
Record Class ChatEvent.Completed
java.lang.Object
java.lang.Record
com.tnsai.agents.async.ChatEvent.Completed
- All Implemented Interfaces:
ChatEvent
- Enclosing interface:
ChatEvent
public static record ChatEvent.Completed(Instant timestamp, String fullResponse, int totalTokens, long durationMillis)
extends Record
implements ChatEvent
Chat completed event.
-
Nested Class Summary
Nested classes/interfaces inherited from interface com.tnsai.agents.async.ChatEvent
ChatEvent.Completed, ChatEvent.Error, ChatEvent.Started, ChatEvent.Token, ChatEvent.ToolCall, ChatEvent.ToolResult -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionlongReturns the value of thedurationMillisrecord component.final booleanIndicates whether some other object is "equal to" this one.Returns the value of thefullResponserecord component.final inthashCode()Returns a hash code value for this object.booleanReturns true if this is a terminal event.Returns the value of thetimestamprecord component.final StringtoString()Returns a string representation of this record class.intReturns the value of thetotalTokensrecord component.
-
Constructor Details
-
Completed
-
Completed
Creates an instance of aCompletedrecord class.- Parameters:
timestamp- the value for thetimestamprecord componentfullResponse- the value for thefullResponserecord componenttotalTokens- the value for thetotalTokensrecord componentdurationMillis- the value for thedurationMillisrecord component
-
-
Method Details
-
isTerminal
public boolean isTerminal()Description copied from interface:ChatEventReturns true if this is a terminal event.- Specified by:
isTerminalin interfaceChatEvent
-
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 '=='. -
timestamp
Returns the value of thetimestamprecord component. -
fullResponse
Returns the value of thefullResponserecord component.- Returns:
- the value of the
fullResponserecord component
-
totalTokens
public int totalTokens()Returns the value of thetotalTokensrecord component.- Returns:
- the value of the
totalTokensrecord component
-
durationMillis
public long durationMillis()Returns the value of thedurationMillisrecord component.- Returns:
- the value of the
durationMillisrecord component
-