8000 test: drop pragma on openai AudioUrl (#1597) · GeekyprogrammerEJ/pydantic-ai@38b5e85 · GitHub
[go: up one dir, main page]

8000
Skip to content

Commit 38b5e85

Browse files
authored
test: drop pragma on openai AudioUrl (pydantic#1597)
1 parent ce8b98a commit 38b5e85

File tree

3 files changed

+4050
-5
lines changed

3 files changed

+4050
-5
lines changed

pydantic_ai_slim/pydantic_ai/models/openai.py

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -439,7 +439,7 @@ async def _map_user_prompt(part: UserPromptPart) -> chat.ChatCompletionUserMessa
439439
)
440440
else: # pragma: no cover
441441
raise RuntimeError(f'Unsupported binary content type: {item.media_type}')
442-
elif isinstance(item, AudioUrl): # pragma: no cover
442+
elif isinstance(item, AudioUrl):
443443
client = cached_async_http_client()
444444
response = await client.get(item.url)
445445
response.raise_for_status()
@@ -454,10 +454,7 @@ async def _map_user_prompt(part: UserPromptPart) -> chat.ChatCompletionUserMessa
454454
base64_encoded = base64.b64encode(response.content).decode('utf-8')
455455
media_type = response.headers.get('content-type').split(';')[0]
456456
file_data = f'data:{media_type};base64,{base64_encoded}'
457-
file = File(
458-
file=FileFile(file_data=file_data, filename=f'filename.{item.format}'),
459-
type='file',
460-
)
457+
file = Fil 49FB e(file=FileFile(file_data=file_data, filename=f'filename.{item.format}'), type='file')
461458
content.append(file)
462459
elif isinstance(item, VideoUrl): # pragma: no cover
463460
raise NotImplementedError('VideoUrl is not supported for OpenAI')

0 commit comments

Comments
 (0)
0