MessagePart
A discrete piece of content within a Message. Parts are typed by their direction and purpose: RequestPart parts go to the LLM, ResponsePart parts come from the LLM, and ContentPart parts (text, attachments) are valid in both directions.
Inheritors
Types
Attachment content part of the message.
Represents a part of a message that can be used in both request and response contexts. Parts can be text MessagePart.Text or attachments MessagePart.Attachment.
Represents a reasoning message exchanged in a chat system, encapsulating the content, role, and associated metadata, with an optional reference to the original thinking process.
A part that can appear in a request sent to the LLM. All request parts carry an optional cacheControl directive.
A part that can appear in a response received from the LLM (e.g. text, reasoning, or tool calls).
Text content part of the message.
Represents messages exchanged with tools, either as calls or results.