ModelInvocationContextSnapshot
Immutable model-visible context for a single provider invocation.
Retries of the same invocation MUST reuse the same snapshot.
Class Diagram
Section titled “Class Diagram”---
title: ModelInvocationContextSnapshot
config:
look: handDrawn
theme: colorful
class:
hideEmptyMembersBox: true
---
classDiagram
class ModelInvocationContextSnapshot {
+string id
+string sessionId
+string turnId
+string invocationId
+int32 iteration
+Message[] messages
+InvocationContextDecision[] decisions
+int32 stablePrefixMessages
+InvocationContextState contextState
+dictionary metadata
}
class Message {
+string role
+ContentPart[] parts
+dictionary metadata
}
ModelInvocationContextSnapshot *-- Message
class InvocationContextDecision {
+string candidateId
+string disposition
+string reason
+int32 rank
+int32 estimatedTokens
+dictionary metadata
}
ModelInvocationContextSnapshot *-- InvocationContextDecision
class InvocationContextState {
+string portability
+DelegatedStateReference[] delegatedState
}
ModelInvocationContextSnapshot *-- InvocationContextState
Yaml Example
Section titled “Yaml Example”id: context:inv_abc123sessionId: sess_abc123turnId: turn_abc123invocationId: inv_abc123Properties
Section titled “Properties”| Name | Type | Description |
|---|---|---|
| id | string | Stable identifier for this context snapshot |
| sessionId | string | Stable session identifier |
| turnId | string | Stable turn identifier |
| invocationId | string | Stable model invocation identifier |
| iteration | int32 | Zero-based model loop iteration |
| messages | Message[] | Canonical messages visible to the model |
| decisions | InvocationContextDecision[] | Context-planning decisions used to assemble the snapshot |
| stablePrefixMessages | int32 | Number of leading messages eligible for provider prefix-cache reuse |
| contextState | InvocationContextState | Provider-context state carried into this invocation |
| metadata | dictionary | Opaque host-specific snapshot metadata |
Composed Types
Section titled “Composed Types”The following types are composed within ModelInvocationContextSnapshot: