Record Class StatusEvent

java.lang.Object
java.lang.Record
com.tnsai.events.StatusEvent
Record Components:
eventId - unique identifier for this event
timestamp - when the event occurred
runId - the run this status belongs to
statusType - type of status update
message - human-readable status message
agentName - name of the agent
availableTools - 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
  • 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 a StatusEvent record class.
      Parameters:
      eventId - the value for the eventId record component
      timestamp - the value for the timestamp record component
      runId - the value for the runId record component
      statusType - the value for the statusType record component
      message - the value for the message record component
      agentName - the value for the agentName record component
      availableTools - the value for the availableTools record component
  • Method Details

    • llmThinking

      public static StatusEvent llmThinking(String runId, String agentName, List<String> tools)
      Creates a status event for LLM thinking phase.
      Parameters:
      runId - the run ID
      agentName - name of the agent
      tools - list of available tool names
      Returns:
      new StatusEvent
    • toolSelecting

      public static StatusEvent toolSelecting(String runId, String agentName, List<String> tools)
      Creates a status event for tool selection phase.
      Parameters:
      runId - the run ID
      agentName - name of the agent
      tools - list of available tool names
      Returns:
      new StatusEvent
    • processing

      public static StatusEvent processing(String runId, String message)
      Creates a generic processing status event.
      Parameters:
      runId - the run ID
      message - the status message
      Returns:
      new StatusEvent
    • toString

      public final String 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.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • 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.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      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 with Objects::equals(Object,Object).
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • eventId

      public String eventId()
      Returns the value of the eventId record component.
      Specified by:
      eventId in interface TnsAIEvent
      Returns:
      the value of the eventId record component
    • timestamp

      public Instant timestamp()
      Returns the value of the timestamp record component.
      Specified by:
      timestamp in interface TnsAIEvent
      Returns:
      the value of the timestamp record component
    • runId

      public String runId()
      Returns the value of the runId record component.
      Returns:
      the value of the runId record component
    • statusType

      public StatusEvent.StatusType statusType()
      Returns the value of the statusType record component.
      Returns:
      the value of the statusType record component
    • message

      public String message()
      Returns the value of the message record component.
      Returns:
      the value of the message record component
    • agentName

      public String agentName()
      Returns the value of the agentName record component.
      Returns:
      the value of the agentName record component
    • availableTools

      public List<String> availableTools()
      Returns the value of the availableTools record component.
      Returns:
      the value of the availableTools record component