Skip to content

fix(voice): forward TTSModelSettings.speed to the OpenAI speech API - #4220

Merged
seratch merged 1 commit into
openai:mainfrom
adityasingh2400:fix-voice-tts-speed
Aug 5, 2026
Merged

fix(voice): forward TTSModelSettings.speed to the OpenAI speech API#4220
seratch merged 1 commit into
openai:mainfrom
adityasingh2400:fix-voice-tts-speed

Conversation

@adityasingh2400

Copy link
Copy Markdown
Contributor

TTSModelSettings.speed is a documented public setting ("Between 0.25 and 4.0") and it is even recorded on the speech span's model config, but OpenAITTSModel.run never passes it to audio.speech.with_streaming_response.create, so setting it has no effect on the generated audio. The OpenAI speech API takes speed as a first-class parameter, so this forwards the configured value and falls back to omit when it is unset, leaving the current default behavior unchanged.

Fail-before evidence: with the fix reverted via git checkout upstream/main -- src/agents/voice/models/openai_tts.py, the new test_openai_tts_forwards_speed fails with TypeError: fake_create() missing 1 required keyword-only argument: 'speed', and it passes with the fix restored. make format, make lint, make typecheck and the voice test suite are green.

@seratch seratch added this to the 0.20.x milestone Aug 5, 2026
@seratch
seratch enabled auto-merge (squash) August 5, 2026 22:52
@seratch
seratch merged commit a8ac730 into openai:main Aug 5, 2026
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants