Steps to Reproduce
Bugs:
-
WebP images get wrong MIME type with Anthropic provider. anthropic.py:132 uses mimetypes.types_map.get(f".{content['image']['format']}", "application/octet-stream"). Python's mimetypes module returns "application/octet-stream" for .webp, not "image/webp". WebP images will fail or be misprocessed. TypeScript uses an explicit switch statement that correctly maps webp.
-
GuardContent wraps unsupported image formats and missing image type support.bedrock.py:450-451 wraps ALL image formats in guardContent without format validation. TypeScript explicitly checks for png/jpeg only and skips unsupported formats. Additionally, GuardContent type (content.py) only has a "text" field — missing "image" support that TypeScript has. Wrapping unsupported formats will cause Bedrock API errors.
-
Video format "3gp" not mapped to "three_gp" for Bedrock API. bedrock.py:647 passes video format as-is. TypeScript maps "3gp" → "three_gp" to match the Bedrock API enum. 3GP videos will be rejected by Bedrock.
Missing format support (non-breaking gaps):
DocumentFormat missing "json" and "xml" (TypeScript has them)
ImageFormat missing "jpg" alias for jpeg (TypeScript has it)
ToolResultContent missing video support (TypeScript has VideoBlock)
DocumentSource missing { text: string } and { content: [...] } source types (TypeScript has them)
Expected Behavior
- WebP images should get
"image/webp" MIME type
- GuardContent should only wrap supported image formats (png, jpeg) and support image type
- "3gp" video format should be mapped to "three_gp"
- Format types should support json, xml documents; jpg alias; video in tool results; text document sources
Actual Behavior
- WebP →
"application/octet-stream" → Anthropic API error
- Unsupported image formats wrapped in guardContent → Bedrock API error
- "3gp" sent as-is → Bedrock API error
- Missing format types limit what content can be represented
Additional context
This was a finding from an agentic cross-SDK consistency scan between Python and TypeScript SDKs (strands-agents/sdk-typescript#789). The finding has been triaged, but verify that this needs an actual fix.
Steps to Reproduce
Bugs:
WebP images get wrong MIME type with Anthropic provider.
anthropic.py:132usesmimetypes.types_map.get(f".{content['image']['format']}", "application/octet-stream"). Python'smimetypesmodule returns"application/octet-stream"for.webp, not"image/webp". WebP images will fail or be misprocessed. TypeScript uses an explicit switch statement that correctly maps webp.GuardContent wraps unsupported image formats and missing image type support.
bedrock.py:450-451wraps ALL image formats inguardContentwithout format validation. TypeScript explicitly checks forpng/jpegonly and skips unsupported formats. Additionally,GuardContenttype (content.py) only has a"text"field — missing"image"support that TypeScript has. Wrapping unsupported formats will cause Bedrock API errors.Video format "3gp" not mapped to "three_gp" for Bedrock API.
bedrock.py:647passes video format as-is. TypeScript maps"3gp"→"three_gp"to match the Bedrock API enum. 3GP videos will be rejected by Bedrock.Missing format support (non-breaking gaps):
DocumentFormatmissing"json"and"xml"(TypeScript has them)ImageFormatmissing"jpg"alias for jpeg (TypeScript has it)ToolResultContentmissing video support (TypeScript hasVideoBlock)DocumentSourcemissing{ text: string }and{ content: [...] }source types (TypeScript has them)Expected Behavior
"image/webp"MIME typeActual Behavior
"application/octet-stream"→ Anthropic API errorAdditional context
This was a finding from an agentic cross-SDK consistency scan between Python and TypeScript SDKs (strands-agents/sdk-typescript#789). The finding has been triaged, but verify that this needs an actual fix.