Skip to content
Prompty

ModelInvocationContextSnapshot

Immutable model-visible context for a single provider invocation.

Retries of the same invocation MUST reuse the same snapshot.

---
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
id: context:inv_abc123
sessionId: sess_abc123
turnId: turn_abc123
invocationId: inv_abc123
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

The following types are composed within ModelInvocationContextSnapshot: