Developers
Message content
Preserve text, files, and provider metadata when processing chat message parts.
Chat messages contain an ordered list of parts. A part's type identifies its
content. Keep the order and preserve providerMetadata when storing or replaying
messages: providers can use that metadata to continue a conversation.
Files and reasoning
fileis an output attachment with amediaTypeandurl.reasoning-filehas the samemediaTypeandurlfields, but belongs to the model's reasoning. Keep it separate from output attachments.customcarries provider-specific content. Itskinduses a qualified name such asopenai.compaction. Preserve the part and itsproviderMetadataeven when your client has no display component for it.
A file URL may be an HTTPS address or a data URL. Do not treat an HTTPS address as base64 data. Reasoning visibility is separate from output attachment visibility: hiding reasoning should also hide its reasoning files.
Existing text, tool, and output-file parts retain their meanings. Clients that only render selected part types should preserve the other parts when saving or replaying a message.