Skip to content

Commit f254e96

Browse files
KludexKRRT7
authored andcommitted
fix: use FileUrl.format to find the extension (pydantic#2280)
1 parent e109753 commit f254e96

File tree

4 files changed

+499
-11
lines changed

4 files changed

+499
-11
lines changed

pydantic_ai_slim/pydantic_ai/models/__init__.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -758,9 +758,7 @@ async def download_item(
758758

759759
data_type = media_type
760760
if type_format == 'extension':
761-
data_type = data_type.split('/')[1]
762-
if data_type == 'mpeg': # pragma: no cover
763-
data_type = 'mp3'
761+
data_type = item.format
764762

765763
data = response.content
766764
if data_format in ('base64', 'base64_uri'):

0 commit comments

Comments
 (0)