From 087ddee227b9c3d3f019ec51068027b0d6283367 Mon Sep 17 00:00:00 2001 From: Cesar Garcia <128240629+Chesars@users.noreply.github.com> Date: Mon, 12 Jan 2026 08:39:23 -0300 Subject: [PATCH] docs: update message content types link and add content types table (#18209) * docs: update message content types link and add content types table - Update "See All Message Values" link to point to main branch (line 664) instead of outdated commit 8600ec7 (line 392) - Add Content Types table documenting all 6 multimodal content types: text, image_url, input_audio, video_url, file, document - Link to existing docs for vision, audio, and document understanding * docs: add type definition links for text and video_url * docs: fix text type definition link to line 598 * docs: remove provider labels from file/document types * docs: add examples for all content types per review feedback --- docs/my-website/docs/completion/input.md | 42 +++++++++++++++++++++++- 1 file changed, 41 insertions(+), 1 deletion(-) diff --git a/docs/my-website/docs/completion/input.md b/docs/my-website/docs/completion/input.md index 7df4f77017a..2f6da4bedcd 100644 --- a/docs/my-website/docs/completion/input.md +++ b/docs/my-website/docs/completion/input.md @@ -142,7 +142,47 @@ def completion( - `tool_call_id`: *str (optional)* - Tool call that this message is responding to. -[**See All Message Values**](https://github.com/BerriAI/litellm/blob/8600ec77042dacad324d3879a2bd918fc6a719fa/litellm/types/llms/openai.py#L392) +[**See All Message Values**](https://github.com/BerriAI/litellm/blob/main/litellm/types/llms/openai.py#L664) + +#### Content Types + +`content` can be a string (text only) or a list of content blocks (multimodal): + +| Type | Description | Docs | +|------|-------------|------| +| `text` | Text content | [Type Definition](https://github.com/BerriAI/litellm/blob/main/litellm/types/llms/openai.py#L598) | +| `image_url` | Images | [Vision](./vision.md) | +| `input_audio` | Audio input | [Audio](./audio.md) | +| `video_url` | Video input | [Type Definition](https://github.com/BerriAI/litellm/blob/main/litellm/types/llms/openai.py#L625) | +| `file` | Files | [Document Understanding](./document_understanding.md) | +| `document` | Documents/PDFs | [Document Understanding](./document_understanding.md) | + +**Examples:** +```python +# Text +messages=[{"role": "user", "content": [{"type": "text", "text": "Hello!"}]}] + +# Image +messages=[{"role": "user", "content": [{"type": "image_url", "image_url": {"url": "https://example.com/image.jpg"}}]}] + +# Audio +messages=[{"role": "user", "content": [{"type": "input_audio", "input_audio": {"data": "", "format": "wav"}}]}] + +# Video +messages=[{"role": "user", "content": [{"type": "video_url", "video_url": {"url": "https://example.com/video.mp4"}}]}] + +# File +messages=[{"role": "user", "content": [{"type": "file", "file": {"file_id": "https://example.com/doc.pdf"}}]}] + +# Document +messages=[{"role": "user", "content": [{"type": "document", "source": {"type": "text", "media_type": "application/pdf", "data": ""}}]}] + +# Combining multiple types (multimodal) +messages=[{"role": "user", "content": [ + {"type": "text", "text": "Generate a product description based on this image"}, + {"type": "image_url", "image_url": {"url": "https://example.com/image.jpg"}} +]}] +``` ## Optional Fields