Class LLMCall<T>
- Type Parameters:
T- the answer type the last outgoing message's handler declares
- All Implemented Interfaces:
GuardedExecution, Identifiable, Job<T>, ModelDependent, ModelDependentTool<Void,T>, Tool<Void, T>
ConversationContext: the last outgoing message's ResponseHandler defines
the answer type. Thinkers stay resource-free and spawn one of these per round-trip, so the
reservation, the output budget and the truncation ceiling are scoped to the call alone,
and the reservation is the input plus ConversationContext.resolveOutputBudget(),
the same number the client sends as max_tokens.
The call is a model-dependent tool like every other exchange with a model in the
runtime, built on AbstractModelDependentTool: the conversation is wired at
requirements time, the exchange runs through converse, and a malformed answer is
corrected under the shared ResponseCorrection budget. What is the call's own is
its seat: the conversation's grade, its depth, and a pin when the thinker that spawned it
is pinned, so a benchmark that pins a thinker pins every call it makes.
On OutputTruncationRetryException (raised by a client when the response hits
stop_reason=max_tokens) the client has already bumped the outgoing message's
requestedOutputTokens to the model ceiling; because the thinker's conversation is
kept across attempts, the dispatcher's one-time re-run reserves and sends the escalated
budget.
- Since:
- 0.1 (2025-09-22)
- Author:
- Andrey Santrosyan
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intCorrection budget per job: at most this many parse/validation feedback retries.Fields inherited from class AbstractTool
inputFields inherited from class AbstractJob
timeout, upstreamRetriesFields inherited from interface Job
DEFAULT_UPSTREAM_RETRIESFields inherited from interface Tool
OBS_INPUT, OBS_OUTPUT -
Constructor Summary
ConstructorsConstructorDescriptionLLMCall(Identifiable parent, ConversationContext conversation) The model is the RESOLUTION's own, never an argument: this job declares the conversation's grade and depth through its seat, wires the resolved binding to the conversation, and the harness resolves it before execution - so the rate-limiter reservation, the output budget, the wire ceiling and the truncation ceiling all read one resolved cell and cannot silently diverge. -
Method Summary
Modifier and TypeMethodDescriptionexecute(JobResources resources, JobContext<T> context) Executes the job with the provided resources and context.getGrade()The seat's grade is the conversation's, read and written there, never held by the call.Gets the job type classification for analytics and cost attribution.Default requirements for tools.getRole()The seat's role is the conversation's too, stamped there from the thinker's declaration.voidpostExecute(JobContext<T> context) The answer is already recorded on the job as the call's response by the client wrapper; a tool's output metadata would repeat the whole turn beside it.voidRaises or lowers the declared grade for a run; a thinker refuses null.Methods inherited from class AbstractModelDependentTool
buildInputPrompt, client, converse, lastResponse, pinModel, pinnedModel, request, wireConversation, wireConversationMethods inherited from class AbstractTool
getInput, preExecute, setInputMethods inherited from class AbstractJob
getId, getName, getParentJobId, getPriority, getTimeout, getUpstreamRetries, getUserId, getWorkflowId, randomIdSuffix, setTimeout, setUpstreamRetries, toStringMethods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface GuardedExecution
declareAdmissionGuardrails, declareAuthGuardrails, declareContentGuardrailsMethods inherited from interface Identifiable
getParentJobId, getUserId, getWorkflowIdMethods inherited from interface Job
getDisplayName, getId, getJobId, getName, getPriority, getTimeout, getUpstreamRetries, preExecuteMethods inherited from interface ModelDependent
requireSeatMethods inherited from interface Tool
getInput, guardedInputTarget, setInput
-
Field Details
-
MAX_CORRECTIONS
public static final int MAX_CORRECTIONSCorrection budget per job: at most this many parse/validation feedback retries.- See Also:
-
-
Constructor Details
-
LLMCall
The model is the RESOLUTION's own, never an argument: this job declares the conversation's grade and depth through its seat, wires the resolved binding to the conversation, and the harness resolves it before execution - so the rate-limiter reservation, the output budget, the wire ceiling and the truncation ceiling all read one resolved cell and cannot silently diverge.
-
-
Method Details
-
getJobType
Description copied from interface:JobGets the job type classification for analytics and cost attribution. Override in subclasses that need a specific type (TOOL, THINKER, DOER, etc.).- Specified by:
getJobTypein interfaceJob<T>- Overrides:
getJobTypein classAbstractTool<Void,T> - Returns:
- the job type (default is JOB)
-
getGrade
The seat's grade is the conversation's, read and written there, never held by the call.- Specified by:
getGradein interfaceModelDependent- Overrides:
getGradein classAbstractModelDependentTool<Void,T>
-
setGrade
Description copied from interface:ModelDependentRaises or lowers the declared grade for a run; a thinker refuses null.- Specified by:
setGradein interfaceModelDependent- Overrides:
setGradein classAbstractModelDependentTool<Void,T>
-
getRole
The seat's role is the conversation's too, stamped there from the thinker's declaration. -
getRequirements
Description copied from class:AbstractToolDefault requirements for tools. Subclasses should override to add database, LLM, or other requirements. JobType is handled byAbstractTool.getJobType(), not here.- Specified by:
getRequirementsin interfaceJob<T>- Overrides:
getRequirementsin classAbstractTool<Void,T> - Returns:
- resource requirements, or null if the job needs no resources
-
execute
Description copied from interface:JobExecutes the job with the provided resources and context. A job reports progress and checks for cancellation through the context, and completes all its work before returning. A tool narrows this contract to the LLM-readable exceptions ofTool.execute(JobResources, JobContext).- Parameters:
resources- the allocated resourcescontext- the job execution context for monitoring- Returns:
- the job result, which may be null
- Throws:
LLMReadableCheckedException- if execution fails
-
postExecute
The answer is already recorded on the job as the call's response by the client wrapper; a tool's output metadata would repeat the whole turn beside it.- Specified by:
postExecutein interfaceJob<T>- Overrides:
postExecutein classAbstractTool<Void,T> - Parameters:
context- the job context
-