diff --git a/demo/assets/controllers/chat_controller.js b/demo/assets/controllers/blog_controller.js similarity index 100% rename from demo/assets/controllers/chat_controller.js rename to demo/assets/controllers/blog_controller.js diff --git a/demo/composer.json b/demo/composer.json index 4f85b611c..ea319937b 100644 --- a/demo/composer.json +++ b/demo/composer.json @@ -14,8 +14,6 @@ "php-http/discovery": "^1.20", "runtime/frankenphp-symfony": "^0.2.0", "symfony/ai-bundle": "@dev", - "symfony/ai-open-meteo-tool": "@dev", - "symfony/ai-serp-api-tool": "@dev", "symfony/asset": "~7.3.0", "symfony/asset-mapper": "~7.3.0", "symfony/clock": "~7.3.0", diff --git a/demo/config/packages/ai.yaml b/demo/config/packages/ai.yaml index 74a850ef0..b2dfab7aa 100644 --- a/demo/config/packages/ai.yaml +++ b/demo/config/packages/ai.yaml @@ -106,9 +106,6 @@ services: autoconfigure: true # Symfony\AI\Agent\Toolbox\Tool\Clock: ~ - # Symfony\AI\Agent\Bridge\OpenMeteo\OpenMeteo: ~ - # Symfony\AI\Agent\Bridge\SerpApi\SerpApi: - # $apiKey: '%env(SERP_API_KEY)%' Symfony\AI\Agent\Toolbox\Tool\Wikipedia: ~ Symfony\AI\Agent\Toolbox\Tool\SimilaritySearch: $vectorizer: '@ai.vectorizer.openai' diff --git a/demo/config/services.yaml b/demo/config/services.yaml index f8cd0e4d5..ceb2c1789 100644 --- a/demo/config/services.yaml +++ b/demo/config/services.yaml @@ -18,5 +18,3 @@ services: - '../src/DependencyInjection/' - '../src/Entity/' - '../src/Kernel.php' - - Symfony\Component\Serializer\Normalizer\PropertyNormalizer: ~ diff --git a/demo/src/Blog/Post.php b/demo/src/Blog/Post.php deleted file mode 100644 index 13f9819b3..000000000 --- a/demo/src/Blog/Post.php +++ /dev/null @@ -1,62 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace App\Blog; - -use Symfony\Component\Uid\Uuid; - -final readonly class Post -{ - public function __construct( - public Uuid $id, - public string $title, - public string $link, - public string $description, - public string $content, - public string $author, - public \DateTimeImmutable $date, - ) { - } - - public function toString(): string - { - return <<title} - From: {$this->author} on {$this->date->format('Y-m-d')} - Description: {$this->description} - {$this->content} - TEXT; - } - - /** - * @return array{ - * id: string, - * title: string, - * link: string, - * description: string, - * content: string, - * author: string, - * date: string, - * } - */ - public function toArray(): array - { - return [ - 'id' => $this->id->toRfc4122(), - 'title' => $this->title, - 'link' => $this->link, - 'description' => $this->description, - 'content' => $this->content, - 'author' => $this->author, - 'date' => $this->date->format('Y-m-d'), - ]; - } -} diff --git a/demo/symfony.lock b/demo/symfony.lock index 05c2c95d4..daa01e0e1 100644 --- a/demo/symfony.lock +++ b/demo/symfony.lock @@ -197,7 +197,7 @@ "files": [ "assets/bootstrap.js", "assets/controllers.json", - "assets/controllers/chat_controller.js" + "assets/controllers/blog_controller.js" ] }, "symfony/twig-bundle": { diff --git a/demo/templates/components/blog.html.twig b/demo/templates/components/blog.html.twig index 868e5105f..834f61e60 100644 --- a/demo/templates/components/blog.html.twig +++ b/demo/templates/components/blog.html.twig @@ -1,6 +1,6 @@ {% import "_message.html.twig" as message %} -
+
{{ ux_icon('mdi:symfony', { height: '32px', width: '32px' }) }} Symfony Blog Bot diff --git a/demo/tests/Blog/PostTest.php b/demo/tests/Blog/PostTest.php deleted file mode 100644 index 7e5dc9f70..000000000 --- a/demo/tests/Blog/PostTest.php +++ /dev/null @@ -1,67 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace App\Tests\Blog; - -use App\Blog\Post; -use PHPUnit\Framework\TestCase; -use Symfony\Component\Uid\Uuid; - -final class PostTest extends TestCase -{ - public function testPostToString() - { - $post = new Post( - Uuid::v4(), - 'Hello, World!', - 'https://example.com/hello-world', - 'This is a test description.', - 'This is a test post.', - 'John Doe', - new \DateTimeImmutable('2024-12-08 09:39:00'), - ); - - $expected = <<assertSame($expected, $post->toString()); - } - - public function testPostToArray() - { - $id = Uuid::v4(); - $post = new Post( - $id, - 'Hello, World!', - 'https://example.com/hello-world', - 'This is a test description.', - 'This is a test post.', - 'John Doe', - new \DateTimeImmutable('2024-12-08 09:39:00'), - ); - - $expected = [ - 'id' => $id->toRfc4122(), - 'title' => 'Hello, World!', - 'link' => 'https://example.com/hello-world', - 'description' => 'This is a test description.', - 'content' => 'This is a test post.', - 'author' => 'John Doe', - 'date' => '2024-12-08', - ]; - - $this->assertSame($expected, $post->toArray()); - } -}