Package com.tnsai.events
Record Class StatusEvent
java.lang.Object
java.lang.Record
com.tnsai.events.StatusEvent
- Record Components:
eventId- unique identifier for this eventtimestamp- when the event occurredrunId- the run this status belongs tostatusType- type of status updatemessage- human-readable status messageagentName- name of the agentavailableTools- list of tools available (for tool selection status)
- All Implemented Interfaces:
TnsAIEvent
public record StatusEvent(String eventId, Instant timestamp, String runId, StatusEvent.StatusType statusType, String message, String agentName, List<String> availableTools)
extends Record
implements TnsAIEvent
Event representing a status update during agent execution.
StatusEvent provides meaningful progress updates to the user interface during long-running operations like LLM calls or tool executions.
Status types:
- LLM_THINKING - LLM is processing the request
- TOOL_SELECTING - LLM is deciding which tools to use
- PROCESSING - General processing status
-
Nested Class Summary
Nested Classes -
Constructor Summary
ConstructorsConstructorDescriptionStatusEvent(String eventId, Instant timestamp, String runId, StatusEvent.StatusType statusType, String message, String agentName, List<String> availableTools) Creates an instance of aStatusEventrecord class. -
Method Summary
Modifier and TypeMethodDescriptionReturns the value of theagentNamerecord component.Returns the value of theavailableToolsrecord 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 StatusEventllmThinking(String runId, String agentName, List<String> tools) Creates a status event for LLM thinking phase.message()Returns the value of themessagerecord component.static StatusEventprocessing(String runId, String message) Creates a generic processing status event.runId()Returns the value of therunIdrecord component.Returns the value of thestatusTyperecord component.Returns the value of thetimestamprecord component.static StatusEventtoolSelecting(String runId, String agentName, List<String> tools) Creates a status event for tool selection phase.final StringtoString()Returns a string representation of this record class.Methods inherited from interface com.tnsai.events.TnsAIEvent
eventType
-
Constructor Details
-
StatusEvent
public StatusEvent(String eventId, Instant timestamp, String runId, StatusEvent.StatusType statusType, String message, String agentName, List<String> availableTools) Creates an instance of aStatusEventrecord class.- Parameters:
eventId- the value for theeventIdrecord componenttimestamp- the value for thetimestamprecord componentrunId- the value for therunIdrecord componentstatusType- the value for thestatusTyperecord componentmessage- the value for themessagerecord componentagentName- the value for theagentNamerecord componentavailableTools- the value for theavailableToolsrecord component
-
-
Method Details
-
llmThinking
Creates a status event for LLM thinking phase.- Parameters:
runId- the run IDagentName- name of the agenttools- list of available tool names- Returns:
- new StatusEvent
-
toolSelecting
Creates a status event for tool selection phase.- Parameters:
runId- the run IDagentName- name of the agenttools- list of available tool names- Returns:
- new StatusEvent
-
processing
Creates a generic processing status event.- Parameters:
runId- the run IDmessage- the status message- Returns:
- new StatusEvent
-
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
-
runId
Returns the value of therunIdrecord component.- Returns:
- the value of the
runIdrecord component
-
statusType
Returns the value of thestatusTyperecord component.- Returns:
- the value of the
statusTyperecord component
-
message
Returns the value of themessagerecord component.- Returns:
- the value of the
messagerecord component
-
agentName
Returns the value of theagentNamerecord component.- Returns:
- the value of the
agentNamerecord component
-
availableTools
Returns the value of theavailableToolsrecord component.- Returns:
- the value of the
availableToolsrecord component
-