File tree Expand file tree Collapse file tree 2 files changed +18
-0
lines changed
pydantic_ai_slim/pydantic_ai/models Expand file tree Collapse file tree 2 files changed +18
-0
lines changed Original file line number Diff line number Diff line change @@ -1172,6 +1172,8 @@ async def download_item(
11721172 """
11731173 if item .url .startswith ('gs://' ):
11741174 raise UserError ('Downloading from protocol "gs://" is not supported.' )
1175+ elif item .url .startswith ('s3://' ):
1176+ raise UserError ('Downloading from protocol "s3://" is not supported.' )
11751177 elif isinstance (item , VideoUrl ) and item .is_youtube :
11761178 raise UserError ('Downloading YouTube videos is not supported.' )
11771179
Original file line number Diff line number Diff line change @@ -24,6 +24,22 @@ async def test_download_item_raises_user_error_with_gs_uri(
2424 _ = await download_item (url , data_format = 'bytes' )
2525
2626
27+ @pytest .mark .parametrize (
28+ 'url' ,
29+ (
30+ pytest .param (AudioUrl (url = 's3://my-bucket/audio.wav' )),
31+ pytest .param (DocumentUrl (url = 's3://my-bucket/document.pdf' )),
32+ pytest .param (ImageUrl (url = 's3://my-bucket/image.png' )),
33+ pytest .param (VideoUrl (url = 's3://my-bucket/video.mp4' )),
34+ ),
35+ )
36+ async def test_download_item_raises_user_error_with_s3_uri (
37+ url : AudioUrl | DocumentUrl | ImageUrl | VideoUrl ,
38+ ) -> None :
39+ with pytest .raises (UserError , match = 'Downloading from protocol "s3://" is not supported.' ):
40+ _ = await download_item (url , data_format = 'bytes' )
41+
42+
2743async def test_download_item_raises_user_error_with_youtube_url () -> None :
2844 with pytest .raises (UserError , match = 'Downloading YouTube videos is not supported.' ):
2945 _ = await download_item (VideoUrl (url = 'https://youtu.be/lCdaVNyHtjU' ), data_format = 'bytes' )
You can’t perform that action at this time.
0 commit comments