java.lang.Object
java.lang.Record
com.agentforge4j.runtime.llm.AgentInvocationResult
- Record Components:
rawResponse- raw model output text before command parsingcommands- parsed commands from the responsemodelUsed- the concrete model the provider ran; sourced fromLlmExecutionResponse.modelUsed(); nullable — absent when invocation did not go through an LLM (e.g. test doubles) or when the provider did not report ittokenUsage- token counts for this invocation; sourced fromLlmExecutionResponse.tokenUsage(); nullable — absent when invocation did not go through an LLM or when the provider did not report usageresolvedModel- the model string the runtime resolved and sent on the request; non-null forModelSource.PINandModelSource.TIER,nullforModelSource.PROVIDER_DEFAULT(no model was sent)modelSource- howresolvedModelwas determined; nevernullrequestedModelTier- the capability tier requested for this call (step tier overriding agent tier), ornullwhen no tier applied
public record AgentInvocationResult(String rawResponse, List<LlmCommand> commands, String modelUsed, TokenUsageReport tokenUsage, String resolvedModel, ModelSource modelSource, ModelTier requestedModelTier)
extends Record
The parsed result of a single LLM call: the raw response text plus the parsed list of commands.
Keeping the raw text alongside the commands allows the runtime to record the original output on the event log for auditing, even after the structured commands have been applied.
-
Nested Class Summary
Nested Classes -
Constructor Summary
ConstructorsConstructorDescriptionAgentInvocationResult(String rawResponse, List<LlmCommand> commands, String modelUsed, TokenUsageReport tokenUsage, String resolvedModel, ModelSource modelSource, ModelTier requestedModelTier) Creates an instance of aAgentInvocationResultrecord class. -
Method Summary
Modifier and TypeMethodDescriptionbuilder()Returns a newAgentInvocationResult.Builderfor assembling anAgentInvocationResultwithout positional arguments.commands()Returns the value of thecommandsrecord 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 themodelSourcerecord component.Returns the value of themodelUsedrecord component.Returns the value of therawResponserecord component.Returns the value of therequestedModelTierrecord component.Returns the value of theresolvedModelrecord component.Returns the value of thetokenUsagerecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
AgentInvocationResult
public AgentInvocationResult(String rawResponse, List<LlmCommand> commands, String modelUsed, TokenUsageReport tokenUsage, String resolvedModel, ModelSource modelSource, ModelTier requestedModelTier) Creates an instance of aAgentInvocationResultrecord class.- Parameters:
rawResponse- the value for therawResponserecord componentcommands- the value for thecommandsrecord componentmodelUsed- the value for themodelUsedrecord componenttokenUsage- the value for thetokenUsagerecord componentresolvedModel- the value for theresolvedModelrecord componentmodelSource- the value for themodelSourcerecord componentrequestedModelTier- the value for therequestedModelTierrecord component
-
-
Method Details
-
builder
Returns a newAgentInvocationResult.Builderfor assembling anAgentInvocationResultwithout positional arguments. The tier-resolution metadata is optional:modelSourcedefaults toModelSource.PROVIDER_DEFAULTand bothresolvedModelandrequestedModelTierdefault tonull, so callers on non-LLM paths (chiefly tests) only set the four core components. Required fields are validated whenAgentInvocationResult.Builder.build()is called.- Returns:
- new builder; never
null
-
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). -
rawResponse
Returns the value of therawResponserecord component.- Returns:
- the value of the
rawResponserecord component
-
commands
Returns the value of thecommandsrecord component.- Returns:
- the value of the
commandsrecord component
-
modelUsed
Returns the value of themodelUsedrecord component.- Returns:
- the value of the
modelUsedrecord component
-
tokenUsage
Returns the value of thetokenUsagerecord component.- Returns:
- the value of the
tokenUsagerecord 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
-