Skip to main content

MessageContent

Multi-modal content types for messages and variables in the Adaline SDK.

Overview

Content types support text, images, PDFs, tool calls/responses, reasoning, errors, and search results. All content uses the modality field as a discriminator.

MessageContent (Union Type)

Polymorphic content type supporting multiple modalities.
Type Narrowing:

Text Content

TextContent

See the dedicated TextContent page for full documentation. Plain text content for messages.
Example:
JSON:

Image Content

Base64ImageContentValue

Base64-encoded image data with media type.
Example:

UrlImageContentValue

URL reference to an externally hosted image.
Example:

ImageContentValue

Union of base64 or URL image content.
Example:

ImageContent

See the dedicated ImageContent page for full documentation. Image content with detail level specification.
Example:
JSON:

PDF Content

Base64PdfContentValue

Base64-encoded PDF document.
Example:

UrlPdfContentValue

URL reference to a PDF document.
Example:

PdfContentValue

Union of base64 or URL PDF content.

PdfContent

See the dedicated PdfContent page for full documentation. PDF document content with file metadata.
Example:
JSON:

Tool Content

ToolCallContent

See the dedicated ToolCallContent page for full documentation. Tool/function call request from LLM.
Example:
JSON:

ToolResponseContent

See the dedicated ToolResponseContent page for full documentation. Tool/function execution response.
Example:
JSON:

Reasoning Content

ReasoningContentValue

LLM reasoning/thinking content with signature.

RedactedReasoningContentValue

Redacted reasoning content for privacy.

ReasoningContentValueUnion

Union of reasoning content types.

ReasoningContent

See the dedicated ReasoningContent page for full documentation. Reasoning content for chain-of-thought responses.
Example:

Error Content

ErrorContent

See the dedicated ErrorContent page for full documentation. Error content type for LLM safety and content filtering errors.
Example:

Search Result Content

SearchResultContent

See the dedicated SearchResultContent page for full documentation. Search result content type for grounding LLM responses with web search data.
Example:

Complete Examples

Multi-Modal Message

Tool Call Flow

Helper Functions

Content Filtering