anthropic.internal._lower_block

One content block at `position` -> its wire block, or null when it lowers to nothing. The Messages API's input modalities, per position:

Reference version

Signature

function anthropic.internal._lower_block(
block: ai.content.Block,
position: string,
preview: bool = …
) -> anthropic.internal.AnthBlock | null throws baml.errors.InvalidArgument | baml.errors.Io | baml.errors.Timeout | ai.errors.InvalidRequest | ai.errors.NetworkFailure | ai.errors.PreviewUnsupported

One content block at position -> its wire block, or null when it lowers to nothing. The Messages API's input modalities, per position:

position | text | image | pdf | audio | video system | Accept | Reject | Reject | Reject | Reject user | Accept | Accept | Accept | Reject | Reject assistant | Accept | Reject | Reject | Reject | Reject tool_result | Accept | Accept | Accept | Reject | Reject

Image and document blocks are user input: they belong in a user message or inside a tool_result (whose content is a list of the same blocks). There is no audio or video input block at all, so those are rejected everywhere — an invented {"type":"input_audio"} used to guarantee a 400.

Source:<builtin>/anthropic/ns_internal/messages.bamlbytes 1384015297