langchain - 💡(How to fix) Fix VideoContentBlock ValueError: Block of type video is not supported

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…

I'm using VideoContentBlock and I want it to convert:

VideoContentBlock(url="https://test.com/test.mp4", type="video", mime_type="video/mp4")

into the following format:

{
    "type": "video_url",
    "video_url":{
        "url": "https://test.com/test.mp4",
        "mime_type": "video/mp4"
    }
}

However, I'm actually encountering an error:

else:
    error_msg = f"Block of type {block['type']} is not supported."
    raise ValueError(error_msg)
```"

Error Message

File ~/project/python/me/langchain-example/.venv/lib/python3.12/site-packages/langchain_core/messages/block_translators/openai.py:150, in convert_to_openai_data_block(block, api) 148 else: 149 error_msg = f"Block of type {block['type']} is not supported." --> 150 raise ValueError(error_msg) 152 return formatted_block

ValueError: Block of type video is not supported.

Root Cause

I'm using VideoContentBlock and I want it to convert:

VideoContentBlock(url="https://test.com/test.mp4", type="video", mime_type="video/mp4")

into the following format:

{
    "type": "video_url",
    "video_url":{
        "url": "https://test.com/test.mp4",
        "mime_type": "video/mp4"
    }
}

However, I'm actually encountering an error:

else:
    error_msg = f"Block of type {block['type']} is not supported."
    raise ValueError(error_msg)
```"

Fix Action

Fix / Workaround

  • This is a bug, not a usage question.
  • I added a clear and descriptive title that summarizes this issue.
  • I used the GitHub search to find a similar question and didn't find it.
  • I am sure that this is a bug in LangChain rather than my code.
  • The bug is not resolved by updating to the latest stable version of LangChain (or the specific integration package).
  • This is not related to the langchain-community package.
  • I posted a self-contained, minimal, reproducible example. A maintainer can copy it and run it AS IS.

Other Dependencies

anthropic: 0.104.0 httpx: 0.28.1 jsonpatch: 1.33 langgraph: 1.2.1 ollama: 0.6.2 openai: 2.38.0 orjson: 3.11.9 packaging: 26.2 pydantic: 2.13.4 pyyaml: 6.0.3 requests: 2.34.2 requests-toolbelt: 1.0.0 rich: 15.0.0 tenacity: 9.1.4 tiktoken: 0.13.0 typing-extensions: 4.15.0 uuid-utils: 0.16.0 xxhash: 3.7.0 zstandard: 0.25.0

Code Example

from langchain.messages import VideoContentBlock, HumanMessage, TextContentBlock
from langchain.chat_models import init_chat_model

model = init_chat_model(
model="qwen3.6-35b-a3b",
base_url="https://dashscope.aliyuncs.com/compatible-mode/v1"
)
messages = HumanMessage(content_blocks=[
    TextContentBlock(text="描述一下这个视频?", type="text"),
    VideoContentBlock(url="https://test.com/test.mp4", type="video", mime_type="video/mp4")
])
response = model.invoke([messages])

---

File ~/project/python/me/langchain-example/.venv/lib/python3.12/site-packages/langchain_core/messages/block_translators/openai.py:150, in convert_to_openai_data_block(block, api)
    148 else:
    149     error_msg = f"Block of type {block['type']} is not supported."
--> 150     raise ValueError(error_msg)
    152 return formatted_block

ValueError: Block of type video is not supported.

---

VideoContentBlock(url="https://test.com/test.mp4", type="video", mime_type="video/mp4")

---

{
    "type": "video_url",
    "video_url":{
        "url": "https://test.com/test.mp4",
        "mime_type": "video/mp4"
    }
}

---

else:
    error_msg = f"Block of type {block['type']} is not supported."
    raise ValueError(error_msg)
RAW_BUFFERClick to expand / collapse

Submission checklist

  • This is a bug, not a usage question.
  • I added a clear and descriptive title that summarizes this issue.
  • I used the GitHub search to find a similar question and didn't find it.
  • I am sure that this is a bug in LangChain rather than my code.
  • The bug is not resolved by updating to the latest stable version of LangChain (or the specific integration package).
  • This is not related to the langchain-community package.
  • I posted a self-contained, minimal, reproducible example. A maintainer can copy it and run it AS IS.

Package (Required)

  • langchain
  • langchain-openai
  • langchain-anthropic
  • langchain-classic
  • langchain-core
  • langchain-model-profiles
  • langchain-tests
  • langchain-text-splitters
  • langchain-chroma
  • langchain-deepseek
  • langchain-exa
  • langchain-fireworks
  • langchain-groq
  • langchain-huggingface
  • langchain-mistralai
  • langchain-nomic
  • langchain-ollama
  • langchain-openrouter
  • langchain-perplexity
  • langchain-qdrant
  • langchain-xai
  • Other / not sure / general

Related Issues / PRs

VideoContentBlock ValueError: Block of type video is not supported

Reproduction Steps / Example Code (Python)

from langchain.messages import VideoContentBlock, HumanMessage, TextContentBlock
from langchain.chat_models import init_chat_model

model = init_chat_model(
model="qwen3.6-35b-a3b",
base_url="https://dashscope.aliyuncs.com/compatible-mode/v1"
)
messages = HumanMessage(content_blocks=[
    TextContentBlock(text="描述一下这个视频?", type="text"),
    VideoContentBlock(url="https://test.com/test.mp4", type="video", mime_type="video/mp4")
])
response = model.invoke([messages])

Error Message and Stack Trace (if applicable)

File ~/project/python/me/langchain-example/.venv/lib/python3.12/site-packages/langchain_core/messages/block_translators/openai.py:150, in convert_to_openai_data_block(block, api)
    148 else:
    149     error_msg = f"Block of type {block['type']} is not supported."
--> 150     raise ValueError(error_msg)
    152 return formatted_block

ValueError: Block of type video is not supported.

Description

I'm using VideoContentBlock and I want it to convert:

VideoContentBlock(url="https://test.com/test.mp4", type="video", mime_type="video/mp4")

into the following format:

{
    "type": "video_url",
    "video_url":{
        "url": "https://test.com/test.mp4",
        "mime_type": "video/mp4"
    }
}

However, I'm actually encountering an error:

else:
    error_msg = f"Block of type {block['type']} is not supported."
    raise ValueError(error_msg)
```"

### System Info

System Information
------------------
> OS:  Darwin
> OS Version:  Darwin Kernel Version 25.5.0: Mon Apr 27 20:41:26 PDT 2026; root:xnu-12377.121.6~2/RELEASE_ARM64_T8132
> Python Version:  3.12.11 (main, Sep 18 2025, 19:41:45) [Clang 20.1.4 ]

Package Information
-------------------
> langchain_core: 1.4.0
> langchain: 1.3.1
> langsmith: 0.8.5
> langchain_anthropic: 1.4.3
> langchain_deepseek: 1.0.1
> langchain_ollama: 1.1.0
> langchain_openai: 1.2.2
> langchain_protocol: 0.0.15
> langgraph_sdk: 0.3.14

Optional packages not installed
-------------------------------
> deepagents
> deepagents-cli

Other Dependencies
------------------
> anthropic: 0.104.0
> httpx: 0.28.1
> jsonpatch: 1.33
> langgraph: 1.2.1
> ollama: 0.6.2
> openai: 2.38.0
> orjson: 3.11.9
> packaging: 26.2
> pydantic: 2.13.4
> pyyaml: 6.0.3
> requests: 2.34.2
> requests-toolbelt: 1.0.0
> rich: 15.0.0
> tenacity: 9.1.4
> tiktoken: 0.13.0
> typing-extensions: 4.15.0
> uuid-utils: 0.16.0
> xxhash: 3.7.0
> zstandard: 0.25.0

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING