Record Class HarnessEvent.WindowUsage

java.lang.Object
java.lang.Record
com.inductiveautomation.ignition.common.ai.HarnessEvent.WindowUsage
Record Components:
used - size in tokens of the conversation that was sent on the most recent request (system prompt + every retained message). Already cumulative; do not sum across events.
budget - the model's context window — the denominator the fullness meter divides used by.
All Implemented Interfaces:
HarnessEvent
Enclosing interface:
HarnessEvent

public static record HarnessEvent.WindowUsage(int used, int budget) extends Record implements HarnessEvent
Emitted at most once after each HarnessEvent.TurnFinished, reporting how full the orchestrator's conversation is as of the request that produced the final reply. This is a snapshot of the whole conversation's size at that moment — not a per-turn delta — and grows monotonically as the conversation accumulates messages. Compare used against budget to decide whether the conversation is near the input cap. Suppressed when the provider's chat response does not report an input token count, since the snapshot value is sourced from that report.
  • Constructor Details

    • WindowUsage

      public WindowUsage(int used, int budget)
      Creates an instance of a WindowUsage record class.
      Parameters:
      used - the value for the used record component
      budget - the value for the budget record component
  • Method Details

    • 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 the compare method from their corresponding wrapper classes.
      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.
    • used

      public int used()
      Returns the value of the used record component.
      Returns:
      the value of the used record component
    • budget

      public int budget()
      Returns the value of the budget record component.
      Returns:
      the value of the budget record component