ContextEvent
Defined in: packages/sdk/src/hooks.ts:49
What transformContext receives: the conversation as it stands before the model call.
Extends
Section titled “Extends”Properties
Section titled “Properties”callId?
Section titled “callId?”
readonlyoptionalcallId?:string
Defined in: packages/sdk/src/hooks.ts:41
The tool call’s id, for the two tool hooks; absent for the others.
Inherited from
Section titled “Inherited from”lastUsage?
Section titled “lastUsage?”
readonlyoptionallastUsage?:Usage
Defined in: packages/sdk/src/hooks.ts:57
The usage of the last response the run went on with, not a failed turn-retry attempt’s. Absent on the first call.
messages
Section titled “messages”
readonlymessages: readonlyMessage[]
Defined in: packages/sdk/src/hooks.ts:53
The whole conversation so far, never a view an earlier call’s transform returned.
readonlymodel:ModelRef
Defined in: packages/sdk/src/hooks.ts:55
The model the run was started with.
readonlyrunId:string
Defined in: packages/sdk/src/hooks.ts:37
The run’s id.
Inherited from
Section titled “Inherited from”signal
Section titled “signal”
readonlysignal:AbortSignal
Defined in: packages/sdk/src/hooks.ts:43
The run’s abort signal. Pass it on to any I/O the hook does.
Inherited from
Section titled “Inherited from”stepIndex
Section titled “stepIndex”
readonlystepIndex:number
Defined in: packages/sdk/src/hooks.ts:39
The index of the model call the hook belongs to, counted from 0.
Inherited from
Section titled “Inherited from”system
Section titled “system”
readonlysystem:string
Defined in: packages/sdk/src/hooks.ts:51
The system prompt.
timestamp
Section titled “timestamp”
readonlytimestamp:string
Defined in: packages/sdk/src/hooks.ts:45
When the hook was called, from the run’s clock, in ISO 8601.
Inherited from
Section titled “Inherited from”These docs are licensedCC BY 4.0. Thelicence text is in the repository.