Supported Content Types
| Type | Providers | Use Cases |
|---|---|---|
| Images | All | Charts, screenshots, diagrams |
| PDFs | Anthropic, Google | Documents, reports |
| Files | Varies | Various document types |
Images in Messages
In the Web App
Add images to messages:- Click the image icon in the editor
- Upload an image or paste a URL
- Add alt text for accessibility
In Code
Images appear as content blocks:Provider Conversion
Images are automatically converted to provider format:PDFs in Messages
Adding PDFs
In the web app:- Click the file icon
- Upload a PDF
- It appears inline in the message
PDF Block Types
Like images, PDFs usePDFContentFromSource—a discriminated union. You can pass a dict or explicit type:
- Dict Literal
- Explicit Types
PDF Types
type value | Class | Required Fields |
|---|---|---|
"url" | MediaDataPDFFromURL | url, media_type, filename |
"base64" | MediaDataPDFFromBase64 | base64, media_type, filename |
"bytes" | MediaDataPDFFromBytes | bytes, media_type, filename |
"local_file" | MediaDataPDFFromLocalFile | filepath, media_type, filename |
Signed URLs
For content stored in cloud storage (S3, GCS, etc.), Moxn uses signed URLs with automatic refresh.How It Works
Automatic Refresh
The SDK handles refresh automatically:Manual Registration
For prompts with signed content:Image Variables
Use variables for dynamic images:In the Web App
- Insert a variable with type “image”
- At runtime, provide the image object
In Code
Image variables useImageContentFromSource, a discriminated union type. The SDK automatically dispatches to the correct image type based on the type field.
Constructing Images
You can provide images in two ways:- Dict Literal
- Explicit Types
Pass a dict with the right structure—no extra imports needed:
Image Types
type value | Class | Required Fields |
|---|---|---|
"url" | MediaImageFromURL | url, media_type |
"base64" | MediaImageFromBase64 | base64, media_type |
"bytes" | MediaImageFromBytes | bytes, media_type |
"local_file" | MediaImageFromLocalFile | filepath, media_type |
media_type values: "image/jpeg", "image/png", "image/gif", "image/webp"
Provider-Specific Handling
Moxn supports multiple provider APIs, each with different multimodal capabilities:Anthropic
- Images: PNG, JPEG, GIF, WebP
- PDFs: Native support with citations
OpenAI
OpenAI has two distinct APIs with different invocation methods:- Images: Via data URIs or URLs
- PDFs: Limited support
- Images: Various formats
- PDFs: Native support
- Note: Vertex AI requires GCS URIs (
gs://) for remote files—public HTTP URLs are not supported