Package com.tnsai.events
Record Class ToolCallStartEvent
java.lang.Object
java.lang.Record
com.tnsai.events.ToolCallStartEvent
- Record Components:
eventId- unique identifier for this eventtimestamp- when the event occurredtoolCallId- unique identifier for this tool call (use to match with end event)toolName- the name of the tool being calledarguments- the arguments passed to the tool
- All Implemented Interfaces:
TnsAIEvent
public record ToolCallStartEvent(String eventId, Instant timestamp, String toolCallId, String toolName, Map<String,Object> arguments)
extends Record
implements TnsAIEvent
Event indicating that a tool call has started.
ToolCallStartEvent is emitted when the agent begins executing a tool/action. It contains the tool name and arguments that will be used.
This event is paired with ToolCallEndEvent which indicates completion.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionReturns the value of theargumentsrecord component.final booleanIndicates whether some other object is "equal to" this one.eventId()Returns the value of theeventIdrecord component.final inthashCode()Returns a hash code value for this object.static ToolCallStartEventCreates a tool call start event.static ToolCallStartEventCreates a tool call start event with auto-generated tool call ID.Returns the value of thetimestamprecord component.Returns the value of thetoolCallIdrecord component.toolName()Returns the value of thetoolNamerecord component.final StringtoString()Returns a string representation of this record class.Methods inherited from interface com.tnsai.events.TnsAIEvent
eventType
-
Constructor Details
-
ToolCallStartEvent
public ToolCallStartEvent(String eventId, Instant timestamp, String toolCallId, String toolName, Map<String, Object> arguments) Creates an instance of aToolCallStartEventrecord class.- Parameters:
eventId- the value for theeventIdrecord componenttimestamp- the value for thetimestamprecord componenttoolCallId- the value for thetoolCallIdrecord componenttoolName- the value for thetoolNamerecord componentarguments- the value for theargumentsrecord component
-
-
Method Details
-
of
public static ToolCallStartEvent of(String toolCallId, String toolName, Map<String, Object> arguments) Creates a tool call start event.- Parameters:
toolCallId- unique identifier for this tool calltoolName- the tool namearguments- the tool arguments- Returns:
- new ToolCallStartEvent
-
of
Creates a tool call start event with auto-generated tool call ID.- Parameters:
toolName- the tool namearguments- the tool arguments- Returns:
- new ToolCallStartEvent
-
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. All components in this record class are compared withObjects::equals(Object,Object). -
eventId
Returns the value of theeventIdrecord component.- Specified by:
eventIdin interfaceTnsAIEvent- Returns:
- the value of the
eventIdrecord component
-
timestamp
Returns the value of thetimestamprecord component.- Specified by:
timestampin interfaceTnsAIEvent- Returns:
- the value of the
timestamprecord component
-
toolCallId
Returns the value of thetoolCallIdrecord component.- Returns:
- the value of the
toolCallIdrecord component
-
toolName
Returns the value of thetoolNamerecord component.- Returns:
- the value of the
toolNamerecord component
-
arguments
Returns the value of theargumentsrecord component.- Returns:
- the value of the
argumentsrecord component
-