Package com.tnsai.agents.async
Record Class ChatEvent.ToolResult
java.lang.Object
java.lang.Record
com.tnsai.agents.async.ChatEvent.ToolResult
- All Implemented Interfaces:
ChatEvent
- Enclosing interface:
ChatEvent
public static record ChatEvent.ToolResult(Instant timestamp, String callId, Object result, boolean success)
extends Record
implements ChatEvent
Tool execution result 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
ConstructorsConstructorDescriptionToolResult(String callId, Object result, boolean success) ToolResult(Instant timestamp, String callId, Object result, boolean success) Creates an instance of aToolResultrecord class. -
Method Summary
Modifier and TypeMethodDescriptioncallId()Returns the value of thecallIdrecord 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.result()Returns the value of theresultrecord component.booleansuccess()Returns the value of thesuccessrecord component.Returns the value of thetimestamprecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
ToolResult
-
ToolResult
Creates an instance of aToolResultrecord class.- Parameters:
timestamp- the value for thetimestamprecord componentcallId- the value for thecallIdrecord componentresult- the value for theresultrecord componentsuccess- the value for thesuccessrecord 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. -
callId
Returns the value of thecallIdrecord component.- Returns:
- the value of the
callIdrecord component
-
result
Returns the value of theresultrecord component.- Returns:
- the value of the
resultrecord component
-
success
public boolean success()Returns the value of thesuccessrecord component.- Returns:
- the value of the
successrecord component
-