Describes the document media type of the content. Not every provider supports every media type.
Includes also programming languages as document types for providers who support code running.
Convertible to and from MIME type strings.
Describes the content of a message, which can be text, a tool result, an image, audio, or
a document. Dependent on provider supporting the content type. Multimedia content is generally
base64 (defined by it’s format) encoded but additionally supports urls (for some providers).
Migration verification: every key path present in original (with a
non-null value) that is missing or unequal after a tolerant
load-and-reserialize round trip.
Serde route for Option<AdditionalParams> fields: an explicit null or
{} decodes as None, exactly like an absent field — a mechanically
migrated block that wrote "additional_params": {} classifies identically
to one that omitted the key. Any other non-object value is a loud decode
error: extras are a keyed namespace (every producer stores an object,
every extractor gets a key), so a mis-migrated [] or bare string is
malformed data, not a phantom annotation no reader can see.
require_non_empty with the shared response-direction rejection — the
one-line guard for a provider decode whose converted choice is empty.
Pairing the guard with EMPTY_RESPONSE_ERROR here keeps the wording
from forking per wire. A decode with a legal empty case (anthropic’s
documented empty end_turn) branches around the guard for that case and
still routes every other empty through it.