Skip to content

Conversation

@DenysMoskalenko
Copy link
Contributor

@DenysMoskalenko DenysMoskalenko commented Nov 3, 2025

Add support for legacy Word documents in BinaryContent

Summary

  • include application/msword in DocumentMediaType and _document_format_lookup so .doc uploads resolve to the doc format
  • extend DocumentUrl inference to return the legacy Word MIME type for .doc
  • verify existing legacy Excel handling by ensuring .xls inference still returns application/vnd.ms-excel
  • backfill document tests to cover the legacy Word MIME for both BinaryContent and DocumentUrl

Testing

  • uv run pytest tests/test_messages.py
  • uv run pytest tests/models/test_bedrock.py
  • include application/msword in DocumentMediaType and _document_format_lookup so .doc uploads resolve to the doc format
  • extend DocumentUrl inference to return the legacy Word MIME type for .doc
  • verify existing legacy Excel handling by ensuring .xls inference still returns application/vnd.ms-excel
  • backfill document tests to cover the legacy Word MIME for both BinaryContent and DocumentUrl
  • Resolves Add support for legacy Microsoft Office document formats (application/msword and application/vnd.ms-excel) #3317 by allowing Bedrock and other providers to accept classic .doc uploads

@DouweM DouweM merged commit 59faf42 into pydantic:main Nov 3, 2025
31 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add support for legacy Microsoft Office document formats (application/msword and application/vnd.ms-excel)

2 participants