Skip to content
Prompty

ModelInvocationResponse

Provider-neutral result of a single model invocation.

This is the live provider boundary. It is intentionally distinct from TurnModelResponse, which is the deterministic reference-runner callback.

---
title: ModelInvocationResponse
config:
  look: handDrawn
  theme: colorful
  class:
    hideEmptyMembersBox: true
---
classDiagram
    class ModelInvocationResponse {
        +unknown output
        +InvocationUsage usage
        +Message[] assistantMessages
        +ModelToolRequest[] toolRequests
        +InvocationContextState nextContextState
        +dictionary metadata
    }
    class InvocationUsage {
        +int64 inputTokens
        +int64 outputTokens
        +int64 totalTokens
    }
    ModelInvocationResponse *-- InvocationUsage
    class Message {
        +string role
        +ContentPart[] parts
        +dictionary metadata
    }
    ModelInvocationResponse *-- Message
    class ModelToolRequest {
        +string id
        +string name
        +unknown arguments
        +dictionary metadata
    }
    ModelInvocationResponse *-- ModelToolRequest
    class InvocationContextState {
        +string portability
        +DelegatedStateReference[] delegatedState
    }
    ModelInvocationResponse *-- InvocationContextState
Name Type Description
output unknown Provider-neutral final output when no additional tool calls are requested
usage InvocationUsage Complete cumulative token usage for this completed invocation, when available
assistantMessages Message[] Assistant messages to commit before tool results are made visible
toolRequests ModelToolRequest[] Tool requests returned by the provider
nextContextState InvocationContextState Provider-context state to carry into the next invocation
metadata dictionary Opaque provider-specific response metadata

The following types are composed within ModelInvocationResponse: