InvokeModelContext
Defined in: src/middleware/stages.ts:75
Context passed to model-stage middleware. All inputs to the model call are explicit — middleware can inspect and transform any of them by passing a modified context to next().
Properties
Section titled “Properties”readonly agent: LocalAgent;Defined in: src/middleware/stages.ts:77
The agent instance (escape hatch for advanced use cases).
messages
Section titled “messages”readonly messages: readonly Message[];Defined in: src/middleware/stages.ts:79
The messages to send to the model.
systemPrompt?
Section titled “systemPrompt?”readonly optional systemPrompt?: SystemPrompt;Defined in: src/middleware/stages.ts:81
System prompt to guide the model’s behavior.
toolSpecs
Section titled “toolSpecs”readonly toolSpecs: readonly ToolSpec[];Defined in: src/middleware/stages.ts:83
Tool specifications available to the model.
toolChoice?
Section titled “toolChoice?”readonly optional toolChoice?: ToolChoice;Defined in: src/middleware/stages.ts:85
Controls how the model selects tools.
modelState
Section titled “modelState”readonly modelState: StateStore;Defined in: src/middleware/stages.ts:87
Runtime state for stateful model providers.
invocationState
Section titled “invocationState”readonly invocationState: InvocationState;Defined in: src/middleware/stages.ts:89
Per-invocation state shared across hooks and tools.