Record Class RunStartEvent

java.lang.Object
java.lang.Record
com.tnsai.events.RunStartEvent
Record Components:
eventId - unique identifier for this event
timestamp - when the event occurred
runId - unique identifier for this run
threadId - optional thread/conversation identifier
agentId - identifier of the agent handling the run
agentName - name of the agent
input - the user input that triggered the run
All Implemented Interfaces:
TnsAIEvent

public record RunStartEvent(String eventId, Instant timestamp, String runId, String threadId, String agentId, String agentName, String input) extends Record implements TnsAIEvent
Event indicating that an agent run has started.

RunStartEvent is emitted at the beginning of a chat/run execution and contains the run identifier used to track the entire execution.

This event is paired with RunEndEvent.

  • Constructor Details

    • RunStartEvent

      public RunStartEvent(String eventId, Instant timestamp, String runId, String threadId, String agentId, String agentName, String input)
      Creates an instance of a RunStartEvent 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
      threadId - the value for the threadId record component
      agentId - the value for the agentId record component
      agentName - the value for the agentName record component
      input - the value for the input record component
  • Method Details

    • of

      public static RunStartEvent of(String runId, String threadId, String agentId, String agentName, String input)
      Creates a run start event.
      Parameters:
      runId - the run identifier
      threadId - optional thread identifier
      agentId - the agent identifier
      agentName - the agent name
      input - the user input
      Returns:
      new RunStartEvent
    • of

      public static RunStartEvent of(String agentId, String agentName, String input)
      Creates a run start event with auto-generated run ID.
      Parameters:
      agentId - the agent identifier
      agentName - the agent name
      input - the user input
      Returns:
      new RunStartEvent
    • 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
    • threadId

      public String threadId()
      Returns the value of the threadId record component.
      Returns:
      the value of the threadId record component
    • agentId

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

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

      public String input()
      Returns the value of the input record component.
      Returns:
      the value of the input record component