Skip to content

Conversation

alexmojaki
Copy link
Contributor

Manual test:

from pydantic_ai import Agent, AudioUrl

agent = Agent(model='openai:gpt-4o-audio-preview-2024-10-01')
result = agent.run_sync([AudioUrl(url='https://cdn.openai.com/API/docs/audio/alloy.wav')])
print(result.output)
print(result.usage())

Before this PR:

pydantic_ai.exceptions.ModelHTTPError: status_code: 400, model_name: gpt-4o-audio-preview-2024-10-01, body: {'message': "Invalid value: 'audio/wav'. Supported values are: 'wav' and 'mp3'.", 'type': 'invalid_request_error', 'param': 'messages[0].content[0].input_audio.format', 'code': 'invalid_value'}

Need to add an automated test someday...

@alexmojaki alexmojaki requested a review from Kludex April 25, 2025 13:56
Copy link

github-actions bot commented Apr 25, 2025

Docs Preview

commit: 64dae56
Preview URL: https://a516163b-pydantic-ai-previews.pydantic.workers.dev

@alexmojaki alexmojaki merged commit ce8b98a into main Apr 25, 2025
18 checks passed
@alexmojaki alexmojaki deleted the alex/fix-audio-format branch April 25, 2025 14:14
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.

1 participant