Content Part
Content part of a ModelMessage. Sealed so consumers exhaust over variants — adding a new content type forces a compile error at every dispatch site.
Approval-related parts:
ToolApprovalRequest appears on assistant messages when a tool called by the model needs approval before execution. Per v6 semantics, generation completes after emitting these parts; the host inspects them and calls Agent.generate again with…
ToolApprovalResponse on a tool message — one per pending approval — to resume the loop.
Inheritors
Types
File content — payload data the model produced or that's attached to a turn. Per historical parity gap #38, mirrors v6's richer FilePart.data. Currently base64 is the only data shape; a URL-shaped variant lives in Source. filename is the user-facing label (Anthropic models produce it for artifact-like outputs; v6 has a dedicated slot for it).
Image content — distinct from generic File so multimodal models (vision providers, image-generation tools) get a typed variant. Per historical parity gap #39, mirrors v6's ImagePart. mediaType is the MIME type (e.g. image/png); base64 is the raw image bytes encoded.
Forward-compatible escape hatch for content parts a gateway or provider knows about before this SDK does. The raw JSON is preserved so callers can inspect or round-trip it instead of silently losing content.
Assistant content: the LLM called a tool that requires approval.
Tool content: the host's decision on a previously requested approval.
Tool execution result. output is the canonical FULL payload — persisted, dispatched to UI converters, rendered as the rich card. modelVisible is what the LLM provider includes in the prompt on subsequent turns — defaults to output, but tools with a toModelOutput callback (see Tool.toModelOutput) supply a short summary so multi-turn conversations don't keep re-feeding 10k+ tokens of structured payload into the model's KV cache. The two are intentionally separate: rehydrating the UI card needs the full schema; the model only needs enough context to compose a follow-up response.