Record Class ThoughtEvent

java.lang.Object
java.lang.Record
com.tnsai.events.ThoughtEvent
Record Components:
eventId - unique identifier for this event
timestamp - when the event occurred
content - the thought content/reasoning text
step - optional step name/number in the reasoning chain
All Implemented Interfaces:
TnsAIEvent

public record ThoughtEvent(String eventId, Instant timestamp, String content, String step) extends Record implements TnsAIEvent
Event representing an agent's internal reasoning or thinking process.

ThoughtEvent captures the agent's chain-of-thought reasoning, which can be displayed to users for transparency or used for debugging.

Example thoughts:

  • "I need to search for information about this topic"
  • "The user seems to want a detailed explanation"
  • "I should verify this data before presenting it"
  • Constructor Details

    • ThoughtEvent

      public ThoughtEvent(String eventId, Instant timestamp, String content, String step)
      Creates an instance of a ThoughtEvent record class.
      Parameters:
      eventId - the value for the eventId record component
      timestamp - the value for the timestamp record component
      content - the value for the content record component
      step - the value for the step record component
  • Method Details

    • of

      public static ThoughtEvent of(String content)
      Creates a thought event with current timestamp and auto-generated ID.
      Parameters:
      content - the thought content
      Returns:
      new ThoughtEvent
    • of

      public static ThoughtEvent of(String content, String step)
      Creates a thought event with a step identifier.
      Parameters:
      content - the thought content
      step - the reasoning step name
      Returns:
      new ThoughtEvent
    • 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
    • content

      public String content()
      Returns the value of the content record component.
      Returns:
      the value of the content record component
    • step

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