Module agentforge4j.runtime
Package com.agentforge4j.runtime.llm
Record Class LlmCallObserver.LlmCallCompletedPayload
java.lang.Object
java.lang.Record
com.agentforge4j.runtime.llm.LlmCallObserver.LlmCallCompletedPayload
- Record Components:
agentId- the agent that triggered the callprovider- the provider name (e.g."claude")modelUsed- the concrete model the provider reported running; nullableresolvedModel- the model the runtime resolved and sent;nullfor a provider defaultmodelSource- how the model was determined (pin, tier, or provider default)requestedModelTier- the requested capability tier, ornullwhen none appliedinputTokens- prompt token count, ornullwhen not reportedoutputTokens- completion token count, ornullwhen not reportedtotalTokens-inputTokens + outputTokens, ornullwhen neither was reportedcachedTokens- prompt-cache input tokens the provider reported, ornullwhen not reportedstepUid- the current step's dispatch execution uid, ornullwhen the step has no recorded dispatch uid; disambiguates repeated dispatches of the same stepId (loop iterations, retries) from one anothercallAttempt- 1-based ordinal of this call within its dispatch; a schema-parse-retried step makes multiple calls under onestepUid, each with its owncallAttempt
- 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 Summary
ConstructorsConstructorDescriptionLlmCallCompletedPayload(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 aLlmCallCompletedPayloadrecord class. -
Method Summary
Modifier and TypeMethodDescriptionagentId()Returns the value of theagentIdrecord component.Returns the value of thecachedTokensrecord component.Returns the value of thecallAttemptrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.Returns the value of theinputTokensrecord component.Returns the value of themodelSourcerecord component.Returns the value of themodelUsedrecord component.Returns the value of theoutputTokensrecord component.provider()Returns the value of theproviderrecord component.Returns the value of therequestedModelTierrecord component.Returns the value of theresolvedModelrecord component.stepUid()Returns the value of thestepUidrecord component.final StringtoString()Returns a string representation of this record class.Returns the value of thetotalTokensrecord component.
-
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 aLlmCallCompletedPayloadrecord class.- Parameters:
agentId- the value for theagentIdrecord componentprovider- the value for theproviderrecord componentmodelUsed- the value for themodelUsedrecord componentresolvedModel- the value for theresolvedModelrecord componentmodelSource- the value for themodelSourcerecord componentrequestedModelTier- the value for therequestedModelTierrecord componentinputTokens- the value for theinputTokensrecord componentoutputTokens- the value for theoutputTokensrecord componenttotalTokens- the value for thetotalTokensrecord componentcachedTokens- the value for thecachedTokensrecord componentstepUid- the value for thestepUidrecord componentcallAttempt- the value for thecallAttemptrecord component
-
-
Method Details
-
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. -
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. -
equals
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 withObjects::equals(Object,Object). -
agentId
Returns the value of theagentIdrecord component.- Returns:
- the value of the
agentIdrecord component
-
provider
Returns the value of theproviderrecord component.- Returns:
- the value of the
providerrecord component
-
modelUsed
Returns the value of themodelUsedrecord component.- Returns:
- the value of the
modelUsedrecord component
-
resolvedModel
Returns the value of theresolvedModelrecord component.- Returns:
- the value of the
resolvedModelrecord component
-
modelSource
Returns the value of themodelSourcerecord component.- Returns:
- the value of the
modelSourcerecord component
-
requestedModelTier
Returns the value of therequestedModelTierrecord component.- Returns:
- the value of the
requestedModelTierrecord component
-
inputTokens
Returns the value of theinputTokensrecord component.- Returns:
- the value of the
inputTokensrecord component
-
outputTokens
Returns the value of theoutputTokensrecord component.- Returns:
- the value of the
outputTokensrecord component
-
totalTokens
Returns the value of thetotalTokensrecord component.- Returns:
- the value of the
totalTokensrecord component
-
cachedTokens
Returns the value of thecachedTokensrecord component.- Returns:
- the value of the
cachedTokensrecord component
-
stepUid
Returns the value of thestepUidrecord component.- Returns:
- the value of the
stepUidrecord component
-
callAttempt
Returns the value of thecallAttemptrecord component.- Returns:
- the value of the
callAttemptrecord component
-