Message Content Arrays
When a message contains multiple content items (e.g., text and images), the content is represented using themessage.contents array structure with flattened attributes.
Attribute Pattern
<messageIndex>is the zero-based index of the message<contentIndex>is the zero-based index of the content item within the message<attribute>is the specific content attribute
Content Type Attributes
Each content item has atype attribute that identifies its kind:
"text"- Text content"image"- Image content (URL or base64)"audio"- Audio content (URL or base64)
Content Types
Text Content
Image Content
For images referenced by URL:Audio Content
Privacy Considerations
Hiding Images
WhenOPENINFERENCE_HIDE_INPUT_IMAGES is set to true:
- Image URLs in input messages will be replaced with
"__REDACTED__" - This only applies when input messages are not already completely hidden
Base64 Image Truncation
WhenOPENINFERENCE_BASE64_IMAGE_MAX_LENGTH is set (default: 32000):
- Base64-encoded images longer than this limit will be truncated
- The truncation preserves the data URL prefix (e.g.,
data:image/png;base64,) - Only the base64 content portion is subject to the length limit
Hiding Text Content
WhenOPENINFERENCE_HIDE_INPUT_TEXT is set to true:
- Text content in multimodal messages will be replaced with
"__REDACTED__" - This only applies when input messages are not already completely hidden
Example: Multimodal Message
A user message with both text and image content:Fallback for Simple Messages
When a message contains only text content (no multimodal content), it can use the simpler format:The
message.content attribute is used for simple text-only messages, while message.contents is used for multimodal messages.