Skip to content

Documentation / @agentick/shared / ContextUpdateEvent

Type Alias: ContextUpdateEvent ​

ContextUpdateEvent = object & StreamEventBase

Defined in: streaming.ts:663

Context update event - provides real-time context utilization info.

Emitted after each tick with context window usage, model capabilities, and cumulative token usage. Enables React UIs to show context utilization bars.

Type Declaration ​

cacheCreationTokens? ​

optional cacheCreationTokens: number

Tokens written to KV cache this tick (provider-dependent)

cachedInputTokens? ​

optional cachedInputTokens: number

Input tokens served from KV cache (provider-dependent)

cacheHitRatio? ​

optional cacheHitRatio: number

Ratio of cached to total input tokens (0-1)

contextWindow? ​

optional contextWindow: number

Context window size in tokens

cumulativeUsage? ​

optional cumulativeUsage: object

Cumulative usage across all ticks in this execution

cumulativeUsage.inputTokens ​

inputTokens: number

cumulativeUsage.outputTokens ​

outputTokens: number

cumulativeUsage.ticks ​

ticks: number

cumulativeUsage.totalTokens ​

totalTokens: number

inputTokens ​

inputTokens: number

Input tokens used this tick

isReasoningModel? ​

optional isReasoningModel: boolean

maxOutputTokens? ​

optional maxOutputTokens: number

Max output tokens

modelId ​

modelId: string

Model ID (e.g., "gpt-4o", "claude-3-5-sonnet-20241022")

modelName? ​

optional modelName: string

Human-readable model name

outputTokens ​

outputTokens: number

Output tokens generated this tick

provider? ​

optional provider: string

Provider name

supportsToolUse? ​

optional supportsToolUse: boolean

supportsVision? ​

optional supportsVision: boolean

Model capabilities

totalTokens ​

totalTokens: number

Total tokens this tick

type ​

type: "context_update"

utilization? ​

optional utilization: number

Context utilization percentage (0-100)

Released under the ISC License.