Module agentforge4j.runtime
Package com.agentforge4j.runtime.llm
Class AgentInvocationResult.Builder
java.lang.Object
com.agentforge4j.runtime.llm.AgentInvocationResult.Builder
- Enclosing class:
- AgentInvocationResult
Fluent builder for
AgentInvocationResult. Lets callers omit the tier-resolution metadata
without passing trailing arguments to the canonical constructor. Validation is deferred to
build(), which delegates to the canonical constructor.-
Method Summary
Modifier and TypeMethodDescriptionbuild()Builds the validatedAgentInvocationResult.withCommands(List<LlmCommand> commands) Sets the parsed commands from the response.withModelSource(ModelSource modelSource) Sets howresolvedModelwas determined.withModelUsed(String modelUsed) Sets the concrete model the provider ran.withRawResponse(String rawResponse) Sets the raw model output text before command parsing.withRequestedModelTier(ModelTier requestedModelTier) Sets the capability tier requested for this call.withResolvedModel(String resolvedModel) Sets the model string the runtime resolved and sent on the request.withTokenUsage(TokenUsageReport tokenUsage) Sets the token counts for this invocation.
-
Method Details
-
withRawResponse
Sets the raw model output text before command parsing.- Parameters:
rawResponse- non-blank raw response text- Returns:
- this builder
-
withCommands
Sets the parsed commands from the response.- Parameters:
commands- parsed commands; must not benull- Returns:
- this builder
-
withModelUsed
Sets the concrete model the provider ran.- Parameters:
modelUsed- model the provider reported; nullable- Returns:
- this builder
-
withTokenUsage
Sets the token counts for this invocation.- Parameters:
tokenUsage- token usage; nullable- Returns:
- this builder
-
withResolvedModel
Sets the model string the runtime resolved and sent on the request.- Parameters:
resolvedModel- resolved model;nullforModelSource.PROVIDER_DEFAULT- Returns:
- this builder
-
withModelSource
Sets howresolvedModelwas determined. Defaults toModelSource.PROVIDER_DEFAULTwhen not set.- Parameters:
modelSource- model source; must not benull- Returns:
- this builder
-
withRequestedModelTier
Sets the capability tier requested for this call.- Parameters:
requestedModelTier- requested tier, ornullwhen no tier applied- Returns:
- this builder
-
build
Builds the validatedAgentInvocationResult.- Returns:
- immutable invocation result; never
null
-