Package com.tnsai.agents.async
Record Class ChatEvent.Error
java.lang.Object
java.lang.Record
com.tnsai.agents.async.ChatEvent.Error
- All Implemented Interfaces:
ChatEvent
- Enclosing interface:
ChatEvent
public static record ChatEvent.Error(Instant timestamp, String message, Throwable cause, boolean recoverable)
extends Record
implements ChatEvent
Error 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 TypeMethodDescriptioncause()Returns the value of thecauserecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.booleanReturns true if this is a terminal event.message()Returns the value of themessagerecord component.booleanReturns the value of therecoverablerecord component.Returns the value of thetimestamprecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
Error
-
Error
Creates an instance of aErrorrecord class.- Parameters:
timestamp- the value for thetimestamprecord componentmessage- the value for themessagerecord componentcause- the value for thecauserecord componentrecoverable- the value for therecoverablerecord 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. -
message
Returns the value of themessagerecord component.- Returns:
- the value of the
messagerecord component
-
cause
Returns the value of thecauserecord component.- Returns:
- the value of the
causerecord component
-
recoverable
public boolean recoverable()Returns the value of therecoverablerecord component.- Returns:
- the value of the
recoverablerecord component
-