Skip to content

About

No description, website, or topics provided.

Resources

Stars

1 star

Watchers

0 watching

Forks

Repository files navigation

Symfony AI Logo

Workshop: Symfony AI - Discover The New Ecosystem

Requirements

What you need to participate in this workshop:

Technology

This small demo sits on top of following technologies:

And of course, the Symfony AI 1.0 Components & Bundles.

Setup

The setup is split into three parts, the Symfony application, the OpenAI configuration, and initializing the Chroma DB.

1. Symfony App

Checkout the repository, start the docker environment and install dependencies:

git clone git@github.com:sensiolabs-de/symfony-ai-workshop.git
cd symfony-ai-workshop
docker compose up -d
docker compose run composer install

Now you should be able to open https://localhost/ in your browser, and the chatbot UI should be available for you to start chatting.

Note

You might have to bypass the security warning of your browser with regard to self-signed certificates.

2. OpenAI Configuration

For using GPT and embedding models from OpenAI, you need to configure the OPENAI_API_KEY env variable.

This is done by copying the provided dev.decrypt.private.php file into config/secrets/dev/ directory.

Verify the success of this step by running the following command:

docker compose exec app bin/console secrets:list [--reveal]

You should see the OPENAI_API_KEY in the list of secrets.

And as a last step, you can call the test command:

docker compose exec app bin/console app:openai:test

3. Chroma DB

The Chroma DB vector store starts together with the docker environment and is available on port 8080 of your host.

Verify that it is up and running:

curl http://localhost:8080/api/v2/heartbeat

Setting up the collection and indexing the conference schedule is part of the workshop.

Don't forget to set up the project in your favorite IDE or editor.

Functionality

  • The chatbot application is a simple and small Symfony 7.4 application.
  • The UI is coupled to a Twig LiveComponent, that integrates different Chat implementations on top of the user's session.
  • You can reset the chat context by hitting the Reset button in the top right corner.
  • As part of this workshop, we will connect the Chat with GPT, a vector store and other tools.

MCP Server

The application comes with an MCP server, configured in config/packages/mcp.yaml. Once its tools are in place, you can connect your MCP client with one of the two transports:

  • HTTP: https://localhost/mcp/demo_app
  • STDIO: docker compose exec -T app bin/console mcp:server

Note

HTTP clients need to accept the self-signed certificate. If yours can't, use the STDIO transport instead.

To see what the server exposes, run:

docker compose exec app bin/console debug:mcp

Helpers

This repository comes with some tools for quality assurance installed, and a small wrapper script.

Execute all quality checks at once

bin/check

Composer

docker compose run composer install
docker compose run composer validate

PHP CS Fixer

docker compose exec app vendor/bin/php-cs-fixer fix

PHPStan

docker compose exec app vendor/bin/phpstan analyse --memory-limit=-1

PHPUnit

docker compose exec app vendor/bin/phpunit

About

No description, website, or topics provided.

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages