Skip to content

Commit 0953ed9

Browse files
Update recipes 2025-07-18 (#146)
1 parent deee9e1 commit 0953ed9

File tree

2 files changed

+48
-0
lines changed

2 files changed

+48
-0
lines changed
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
<?php
2+
3+
declare(strict_types=1);
4+
5+
use Symfony\AI\Agent\Toolbox\Tool\Clock;
6+
use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator;
7+
8+
return static function (ContainerConfigurator $containerConfigurator): void {
9+
$services = $containerConfigurator->services();
10+
11+
$services->defaults()
12+
->autowire()
13+
->autoconfigure();
14+
15+
$services->set(Clock::class);
16+
17+
$containerConfigurator->extension('ai', [
18+
'platform' => [
19+
'openai' => [
20+
'api_key' => '%env(OPENAI_API_KEY)%',
21+
],
22+
],
23+
'agent' => [
24+
'default' => [
25+
'platform' => 'ai.platform.openai',
26+
'model' => [
27+
'class' => 'Symfony\AI\Platform\Bridge\OpenAI\GPT',
28+
'name' => 'gpt-4o-mini',
29+
],
30+
'system_prompt' => 'You are a helpful assistant and you can provide the current date and time.
31+
',
32+
'tools' => ['Symfony\AI\Agent\Toolbox\Tool\Clock'],
33+
],
34+
],
35+
]);
36+
};
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
{
2+
"bundles": {
3+
"Symfony\\AI\\AIBundle": ["all"]
4+
},
5+
"copy-from-recipe": {
6+
"config/": "%CONFIG_DIR%/"
7+
},
8+
"env": {
9+
"OPENAI_API_KEY": ""
10+
},
11+
"aliases": ["ai"]
12+
}

0 commit comments

Comments
 (0)