Skip to content

Conversation

@chr-hertel
Copy link
Member

@chr-hertel chr-hertel commented Nov 12, 2025

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

Converting the audio bot demo to speech-to-text-to-speech with subagent for RAG on Symfony Blog.

image

Last Response

@chr-hertel chr-hertel added the Demo Issues & PRs about the demo application label Nov 12, 2025
@chr-hertel chr-hertel requested review from Copilot and removed request for Nyholm and OskarStark November 12, 2025 23:42
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 converts the audio demo from a simple audio bot to a speech-to-text-to-speech system with RAG capabilities on Symfony Blog content. The changes enable voice-based conversations where user speech is transcribed, processed by an agent with access to Symfony blog information, and responses are converted back to speech.

  • Adds text-to-speech conversion for assistant responses using OpenAI's TTS API
  • Enhances BinaryResult to support explicit MIME type specification in data URIs
  • Updates the audio demo UI to play assistant responses as audio instead of displaying text

Reviewed Changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated no comments.

Show a summary per file
File Description
src/platform/src/Result/BinaryResult.php Added optional mimeType parameter to toDataUri() method
src/platform/src/Result/DeferredResult.php Updated method name from asBase64() to asDataUri() with MIME type support
src/platform/tests/Result/BinaryResultTest.php Added test coverage for explicit MIME type in data URI generation
examples/huggingface/text-to-image.php Updated method call to use renamed asDataUri()
demo/src/Audio/Chat.php Implemented TTS for assistant responses and audio metadata storage
demo/templates/components/audio.html.twig Updated template to render audio player for assistant messages
demo/config/packages/ai.yaml Enhanced prompts and descriptions for voice assistant behavior

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

chr-hertel added a commit that referenced this pull request Nov 12, 2025
…sult` for clarity and add optional mimeType arg (chr-hertel)

This PR was merged into the main branch.

Discussion
----------

[Platform] Rename `asBase64` to `asDataUri` on `DeferredResult` for clarity and add optional mimeType arg

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

Just more consistent and convenient, see #861

Commits
-------

df13cce Rename `asBase64` to `asDataUri` on `DeferredResult` for clarity and add optional mimeType arg
@chr-hertel chr-hertel merged commit c840dad into symfony:main Nov 13, 2025
23 of 26 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Demo Issues & PRs about the demo application Feature New feature Status: Needs Review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants