We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 56b07ae commit ce8b98aCopy full SHA for ce8b98a
pydantic_ai_slim/pydantic_ai/models/openai.py
@@ -444,7 +444,8 @@ async def _map_user_prompt(part: UserPromptPart) -> chat.ChatCompletionUserMessa
444
response = await client.get(item.url)
445
response.raise_for_status()
446
base64_encoded = base64.b64encode(response.content).decode('utf-8')
447
- audio = InputAudio(data=base64_encoded, format=response.headers.get('content-type'))
+ audio_format: Any = response.headers['content-type'].removeprefix('audio/')
448
+ audio = InputAudio(data=base64_encoded, format=audio_format)
449
content.append(ChatCompletionContentPartInputAudioParam(input_audio=audio, type='input_audio'))
450
elif isinstance(item, DocumentUrl):
451
client = cached_async_http_client()
0 commit comments