Interface: ILLMClientHooks
Defined in: internal/llm-client/types.ts:286
Decisions and side effects the LLMClient outsources during a run. All implemented by the gateway.
Methods
decideToolCall()
decideToolCall(
args):TToolCallPolicyResult|Promise<TToolCallPolicyResult>
Defined in: internal/llm-client/types.ts:300
The verdict on this call before it runs (D87): ALLOW executes it, DENY writes a denied result, NEEDS_APPROVAL pauses the run. May look something up (a tool's own predicate).
Parameters
args
call
Returns
TToolCallPolicyResult | Promise<TToolCallPolicyResult>
endsRun()
endsRun(
args):boolean|Promise<boolean>
Defined in: internal/llm-client/types.ts:312
True = this executed tool call ends the run (D86). Asked right after executeTool returned; never for a call that failed.
tools are the ones the model was offered in that step.
Parameters
args
call
output
unknown
What executeTool returned.
tools
IToolDef<unknown, unknown>[]
Returns
boolean | Promise<boolean>
executeTool()
executeTool(
args):Promise<unknown>
Defined in: internal/llm-client/types.ts:291
Runs a tool the model asked for; tools are the ones the model was offered in that step, the only ones that may run (D72).
abortSignal is the call's, when the caller gave one: the tool runs under it, and a rejection with its reason ends the run.
Parameters
args
abortSignal?
AbortSignal
The call's signal, when the caller gave one; the tool runs under it.
call
stepIndex
number
Step of the run (0-based) that asked for the call; reported with a failure.
tools
IToolDef<unknown, unknown>[]
Returns
Promise<unknown>
onEvent()
onEvent(
args):void
Defined in: internal/llm-client/types.ts:319
Streaming and progress; the gateway hands them to the call's events (D38).
Parameters
args
event
Returns
void
prepareStep()
prepareStep(
args):IToolDef<unknown,unknown>[]
Defined in: internal/llm-client/types.ts:304
Tools visible for the next step (guarded workflows).
Parameters
args
executed
string[]
stepIndex
number
Returns
IToolDef<unknown, unknown>[]