langchain-ai/deepagents · error · NotImplementedError
Audio is not currently supported.
Error message
Audio is not currently supported.
What it means
`convert_audio_block_to_content_blocks` in libs/acp/deepagents_acp/utils.py unconditionally raises NotImplementedError: audio prompt blocks cannot yet be translated to LangChain content blocks. The ACP bridge supports text, image, resource, and embedded-resource blocks but not audio.
Source
Thrown at libs/acp/deepagents_acp/utils.py:42
def convert_image_block_to_content_blocks(block: ImageContentBlock) -> list[dict[str, object]]:
"""Convert an ACP image block to LangChain content blocks."""
# Primary case: inline base64 data (data is already a base64 string)
if block.data:
data_uri = f"data:{block.mime_type};base64,{block.data}"
return [{"type": "image_url", "image_url": {"url": data_uri}}]
# No data available
return [{"type": "text", "text": "[Image: no data available]"}]
def convert_audio_block_to_content_blocks(block: AudioContentBlock) -> list[dict[str, str]]:
"""Convert an ACP audio block to LangChain content blocks.
Raises:
NotImplementedError: Audio content is not yet supported.
"""
msg = "Audio is not currently supported."
raise NotImplementedError(msg)
def convert_resource_block_to_content_blocks(
block: ResourceContentBlock,
*,
root_dir: str,
) -> list[dict[str, str]]:
"""Convert an ACP resource block to LangChain content blocks."""
file_prefix = "file://"
resource_text = f"[Resource: {block.name}"
if block.uri:
# Truncate root_dir from path while preserving file:// prefix
uri = block.uri
has_file_prefix = uri.startswith(file_prefix)
path = uri[len(file_prefix) :] if has_file_prefix else uri
# Remove root_dir prefix to get path relative to agent's working directory
if path.startswith(root_dir):View on GitHub (pinned to a1af029e6e)
Solutions
- Remove the audio block from the prompt content before calling `prompt()`; send a text transcription instead
- Transcribe the audio client-side (e.g. with a speech-to-text model) and pass the text as a TextContentBlock
- If you control the client, filter unsupported block types before sending
- Track library updates for audio support before retrying audio blocks
Example fix
# before prompt_blocks = [AudioContentBlock(...), text_block] # after prompt_blocks = [TextContentBlock(type="text", text=transcribe(audio))]
Defensive patterns
Strategy: type-guard
Validate before calling
if any(isinstance(b, AudioContentBlock) for b in prompt_blocks):
raise ValueError("ACP transport does not support audio blocks; transcribe to text first") Type guard
def is_supported_block(block: object) -> bool:
return not isinstance(block, AudioContentBlock) Try / catch
try:
resp = await conn.prompt(blocks, session_id)
except NotImplementedError as exc:
if "Audio is not currently supported" in str(exc):
blocks = [b for b in blocks if not isinstance(b, AudioContentBlock)]
resp = await conn.prompt(blocks, session_id)
else:
raise Prevention
- Filter AudioContentBlock out of prompt content before sending over ACP
- Transcribe audio to text client-side and send a TextContentBlock instead
- Keep client block construction limited to text/image/resource types
- Re-check supported block types when upgrading the acp package
When it happens
Trigger: Sending a `prompt()` request whose content list contains an `AudioContentBlock` (ACP `audio` block with `AudioContentBlockData`) — conversion is attempted in server.py:983-984.
Common situations: An ACP client that records or forwards voice input; a protocol client configured to attach microphone audio; automated tests or proxies forwarding arbitrary block types to the agent.
Related errors
- Agent initialization failed
- -32600
- Could not parse embedded resource block. Block expected eith
- Default backend doesn't support command execution (SandboxBa
- NotImplementedError raised by abstract `ls` (backend does no
AI-assisted analysis of langchain-ai/deepagents@a1af029e6e (2026-08-29).
Data as JSON: /api/errors/9fb059fadee590a8.
Report an issue: GitHub.