Skip to content

Commit 6ed950f

Browse files
committed
minor #958 [Demo][Website] Rename audio demo to speech (chr-hertel)
This PR was merged into the main branch. Discussion ---------- [Demo][Website] Rename audio demo to speech | Q | A | ------------- | --- | Bug fix? | no | New feature? | no | Docs? | | Issues | | License | MIT Following a discussion of #943 Commits ------- ffc2b64 Rename audio demo to speech
2 parents 3dac301 + ffc2b64 commit 6ed950f

File tree

12 files changed

+29
-28
lines changed

12 files changed

+29
-28
lines changed

ai.symfony.com/assets/styles/app.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -215,10 +215,10 @@ button#themeToggle {
215215
color: white;
216216
}
217217

218-
.demo-audio .demo-icon { background: linear-gradient(180deg, #42DEEE, #7069B0); }
219218
.demo-blog .demo-icon { background: linear-gradient(180deg, #433F77, #C43BC2); }
220219
.demo-crop .demo-icon { background: linear-gradient(180deg, #85A72B, #97BC43); }
221220
.demo-recipe .demo-icon { background: linear-gradient(180deg, #83A659, #71BCB8); }
221+
.demo-speech .demo-icon { background: linear-gradient(180deg, #42DEEE, #7069B0); }
222222
.demo-turbo .demo-icon { background: linear-gradient(180deg, #E94E77, #D68189); }
223223
.demo-video .demo-icon { background: linear-gradient(180deg, #3B9D87, #35A781); }
224224
.demo-wikipedia .demo-icon { background: linear-gradient(180deg, #1CA574, #56AB48); }

ai.symfony.com/templates/homepage.html.twig

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -256,15 +256,15 @@
256256
</div>
257257

258258
<div class="col-md-6">
259-
<article class="demo-audio sf-ai-card sf-ai-card-hover h-100">
259+
<article class="demo-speech sf-ai-card sf-ai-card-hover h-100">
260260
<div class="position-relative card-body p-3 p-lg-4 d-flex gap-3 align-items-start">
261261
<div class="demo-icon bg-success bg-opacity-10 text-success flex-shrink-0">
262262
{{ ux_icon('tabler:microphone', {width: 42, height: 42}) }}
263263
</div>
264264
<div class="flex-grow-1">
265265
<div class="d-flex align-items-start gap-2 mb-1">
266266
<h3 class="h5 ff-title fw-bold mb-0">
267-
<a href="https://github.com/symfony/ai-demo" class="stretched-link">Audio Bot + Subagent</a>
267+
<a href="https://github.com/symfony/ai-demo" class="stretched-link">Speech Bot + Subagent</a>
268268
</h3>
269269
{{ ux_icon('tabler:arrow-right', {width: 24, height: 24, class: 'ms-1'}) }}
270270
</div>

demo/assets/app.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
import './bootstrap.js';
22
import 'bootstrap/dist/css/bootstrap.min.css';
33
import './styles/app.css';
4-
import './styles/audio.css';
54
import './styles/blog.css';
65
import './styles/crop.css';
76
import './styles/recipe.css';
7+
import './styles/speech.css';
88
import './styles/stream.css';
99
import './styles/youtube.css';
1010
import './styles/video.css';

demo/assets/styles/audio.css renamed to demo/assets/styles/speech.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
.audio {
1+
.speech {
22
body&, .card-img-top {
33
background: #df662f;
44
background: linear-gradient(0deg, #df662f 0%, #a80a1d 100%);

demo/config/packages/ai.yaml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ ai:
4242
tools:
4343
- 'Symfony\AI\Agent\Toolbox\Tool\Wikipedia'
4444
include_sources: true
45-
audio:
45+
speech:
4646
platform: 'ai.platform.openai'
4747
model: 'gpt-4o-mini?temperature=1.0'
4848
prompt: |
@@ -52,6 +52,7 @@ ai:
5252
If you don't know the answer, say so. Keep in mind that you are in a spoken conversation, so keep your
5353
answers concise and to the point. They will be read out loud to the user.
5454
tools:
55+
- 'Symfony\AI\Agent\Toolbox\Tool\Clock'
5556
# Agent in agent 🤯
5657
- agent: 'blog'
5758
name: 'symfony_blog'
@@ -105,7 +106,7 @@ services:
105106
autowire: true
106107
autoconfigure: true
107108

108-
# Symfony\AI\Agent\Toolbox\Tool\Clock: ~
109+
Symfony\AI\Agent\Toolbox\Tool\Clock: ~
109110
Symfony\AI\Agent\Toolbox\Tool\Wikipedia: ~
110111
Symfony\AI\Agent\Toolbox\Tool\SimilaritySearch:
111112
$vectorizer: '@ai.vectorizer.openai'

demo/config/routes.yaml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,6 @@ index:
44
defaults:
55
template: 'index.html.twig'
66

7-
audio:
8-
path: '/audio'
9-
controller: 'Symfony\Bundle\FrameworkBundle\Controller\TemplateController'
10-
defaults:
11-
template: 'chat.html.twig'
12-
context: { chat: 'audio' }
13-
147
blog:
158
path: '/blog'
169
controller: 'Symfony\Bundle\FrameworkBundle\Controller\TemplateController'
@@ -31,6 +24,13 @@ recipe:
3124
template: 'chat.html.twig'
3225
context: { chat: 'recipe' }
3326

27+
speech:
28+
path: '/speech'
29+
controller: 'Symfony\Bundle\FrameworkBundle\Controller\TemplateController'
30+
defaults:
31+
template: 'chat.html.twig'
32+
context: { chat: 'speech' }
33+
3434
stream:
3535
path: '/stream'
3636
controller: 'Symfony\Bundle\FrameworkBundle\Controller\TemplateController'

demo/src/Audio/Chat.php renamed to demo/src/Speech/Chat.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
* file that was distributed with this source code.
1010
*/
1111

12-
namespace App\Audio;
12+
namespace App\Speech;
1313

1414
use Symfony\AI\Agent\AgentInterface;
1515
use Symfony\AI\Platform\Bridge\OpenAi\TextToSpeech\Voice;
@@ -29,7 +29,7 @@ public function __construct(
2929
#[Autowire(service: 'ai.platform.openai')]
3030
private readonly PlatformInterface $platform,
3131
private readonly RequestStack $requestStack,
32-
#[Autowire(service: 'ai.agent.audio')]
32+
#[Autowire(service: 'ai.agent.speech')]
3333
private readonly AgentInterface $agent,
3434
) {
3535
}
@@ -66,7 +66,7 @@ public function submitMessage(string $message): void
6666
'voice' => Voice::CORAL,
6767
'instructions' => 'Speak in a cheerful and positive tone.',
6868
]);
69-
$assistantMessage->getMetadata()->add('audio', $result->asDataUri('audio/mpeg'));
69+
$assistantMessage->getMetadata()->add('speech', $result->asDataUri('audio/mpeg'));
7070

7171
$this->saveMessages($messages);
7272
}

demo/src/Audio/TwigComponent.php renamed to demo/src/Speech/TwigComponent.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,15 +9,15 @@
99
* file that was distributed with this source code.
1010
*/
1111

12-
namespace App\Audio;
12+
namespace App\Speech;
1313

1414
use Symfony\AI\Platform\Message\MessageInterface;
1515
use Symfony\UX\LiveComponent\Attribute\AsLiveComponent;
1616
use Symfony\UX\LiveComponent\Attribute\LiveAction;
1717
use Symfony\UX\LiveComponent\Attribute\LiveArg;
1818
use Symfony\UX\LiveComponent\DefaultActionTrait;
1919

20-
#[AsLiveComponent('audio')]
20+
#[AsLiveComponent('speech')]
2121
final class TwigComponent
2222
{
2323
use DefaultActionTrait;

demo/templates/base.html.twig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@
3838
<a class="nav-link" href="{{ path('crop') }}">{{ ux_icon('material-symbols:crop', { height: '20px', width: '20px' }) }} Smart Crop</a>
3939
</li>
4040
<li class="nav-item">
41-
<a class="nav-link" href="{{ path('audio') }}">{{ ux_icon('iconoir:microphone-solid', { height: '20px', width: '20px' }) }} Audio</a>
41+
<a class="nav-link" href="{{ path('speech') }}">{{ ux_icon('iconoir:microphone-solid', { height: '20px', width: '20px' }) }} Speech</a>
4242
</li>
4343
<li class="nav-item">
4444
<a class="nav-link" href="{{ path('video') }}">{{ ux_icon('tabler:video-filled', { height: '20px', width: '20px' }) }} Video</a>

0 commit comments

Comments
 (0)