Skip to content

Conversation

@chr-hertel
Copy link
Member

Q A
Bug fix? no
New feature? yes
Docs? no
Issues
License MIT

Adding OpenAI TTS support:
https://platform.openai.com/docs/guides/text-to-speech

@chr-hertel chr-hertel added the Platform Issues & PRs about the AI Platform component label Nov 12, 2025
@chr-hertel chr-hertel requested a review from Copilot November 12, 2025 22:35
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR adds OpenAI text-to-speech (TTS) support to the Symfony AI Platform. The implementation enables users to convert text to audio using OpenAI's TTS models (tts-1, tts-1-hd, and gpt-4o-mini-tts) with various voice options.

Key changes:

  • Implementation of TextToSpeech model, client, and result converter
  • Addition of Voice and Format constant interfaces for TTS configuration
  • Registration of three TTS models in the model catalog with appropriate capabilities

Reviewed Changes

Copilot reviewed 11 out of 11 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
src/platform/src/Bridge/OpenAi/TextToSpeech.php Defines the TextToSpeech model class
src/platform/src/Bridge/OpenAi/TextToSpeech/ModelClient.php Implements the HTTP client for TTS API requests
src/platform/src/Bridge/OpenAi/TextToSpeech/ResultConverter.php Converts raw HTTP responses to BinaryResult objects
src/platform/src/Bridge/OpenAi/TextToSpeech/Voice.php Defines available voice constants
src/platform/src/Bridge/OpenAi/TextToSpeech/Format.php Defines supported audio format constants
src/platform/src/Bridge/OpenAi/ModelCatalog.php Registers TTS models with their capabilities
src/platform/src/Bridge/OpenAi/PlatformFactory.php Integrates TTS client and converter into the platform
src/platform/tests/Bridge/OpenAi/ModelCatalogTest.php Adds test cases for TTS models
src/platform/tests/Bridge/OpenAi/TextToSpeech/ModelClientTest.php Tests the TTS model client functionality
src/platform/tests/Bridge/OpenAi/TextToSpeech/ResultConverterTest.php Tests the TTS result converter
examples/openai/audio-output.php Demonstrates usage of TTS functionality

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@chr-hertel chr-hertel merged commit 07594e9 into symfony:main Nov 12, 2025
14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Feature New feature Platform Issues & PRs about the AI Platform component Status: Needs Review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants