Record Class LlmCallObserver.LlmCallCompletedPayload

java.lang.Object
java.lang.Record
com.agentforge4j.runtime.llm.LlmCallObserver.LlmCallCompletedPayload
Record Components:
agentId - the agent that triggered the call
provider - the provider name (e.g. "claude")
modelUsed - the concrete model the provider reported running; nullable
resolvedModel - the model the runtime resolved and sent; null for a provider default
modelSource - how the model was determined (pin, tier, or provider default)
requestedModelTier - the requested capability tier, or null when none applied
inputTokens - prompt token count, or null when not reported
outputTokens - completion token count, or null when not reported
totalTokens - inputTokens + outputTokens, or null when neither was reported
cachedTokens - prompt-cache input tokens the provider reported, or null when not reported
stepUid - the current step's dispatch execution uid, or null when the step has no recorded dispatch uid; disambiguates repeated dispatches of the same stepId (loop iterations, retries) from one another
callAttempt - 1-based ordinal of this call within its dispatch; a schema-parse-retried step makes multiple calls under one stepUid, each with its own callAttempt
Enclosing class:
LlmCallObserver

public static record LlmCallObserver.LlmCallCompletedPayload(String agentId, String provider, String modelUsed, String resolvedModel, ModelSource modelSource, ModelTier requestedModelTier, Integer inputTokens, Integer outputTokens, Integer totalTokens, Integer cachedTokens, String stepUid, Integer callAttempt) extends Record
Typed shape of the WorkflowEventType.LLM_CALL_COMPLETED event payload. Serialized to JSON by Jackson; field declaration order is the emitted key order. modelSource and requestedModelTier serialize to their enum names (null stays null); all token counts may be null when the provider reported no usage.
  • Constructor Details

    • LlmCallCompletedPayload

      public LlmCallCompletedPayload(String agentId, String provider, String modelUsed, String resolvedModel, ModelSource modelSource, ModelTier requestedModelTier, Integer inputTokens, Integer outputTokens, Integer totalTokens, Integer cachedTokens, String stepUid, Integer callAttempt)
      Creates an instance of a LlmCallCompletedPayload record class.
      Parameters:
      agentId - the value for the agentId record component
      provider - the value for the provider record component
      modelUsed - the value for the modelUsed record component
      resolvedModel - the value for the resolvedModel record component
      modelSource - the value for the modelSource record component
      requestedModelTier - the value for the requestedModelTier record component
      inputTokens - the value for the inputTokens record component
      outputTokens - the value for the outputTokens record component
      totalTokens - the value for the totalTokens record component
      cachedTokens - the value for the cachedTokens record component
      stepUid - the value for the stepUid record component
      callAttempt - the value for the callAttempt 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 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.
    • agentId

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

      public String provider()
      Returns the value of the provider record component.
      Returns:
      the value of the provider record component
    • modelUsed

      public String modelUsed()
      Returns the value of the modelUsed record component.
      Returns:
      the value of the modelUsed record component
    • resolvedModel

      public String resolvedModel()
      Returns the value of the resolvedModel record component.
      Returns:
      the value of the resolvedModel record component
    • modelSource

      public ModelSource modelSource()
      Returns the value of the modelSource record component.
      Returns:
      the value of the modelSource record component
    • requestedModelTier

      public ModelTier requestedModelTier()
      Returns the value of the requestedModelTier record component.
      Returns:
      the value of the requestedModelTier record component
    • inputTokens

      public Integer inputTokens()
      Returns the value of the inputTokens record component.
      Returns:
      the value of the inputTokens record component
    • outputTokens

      public Integer outputTokens()
      Returns the value of the outputTokens record component.
      Returns:
      the value of the outputTokens record component
    • totalTokens

      public Integer totalTokens()
      Returns the value of the totalTokens record component.
      Returns:
      the value of the totalTokens record component
    • cachedTokens

      public Integer cachedTokens()
      Returns the value of the cachedTokens record component.
      Returns:
      the value of the cachedTokens record component
    • stepUid

      public String stepUid()
      Returns the value of the stepUid record component.
      Returns:
      the value of the stepUid record component
    • callAttempt

      public Integer callAttempt()
      Returns the value of the callAttempt record component.
      Returns:
      the value of the callAttempt record component