Use AI to improve eShop experience
To integrate the Sylius AI Tools into your project, follow these steps:
Install Sylius AI Tools using Composer. We recommend using stable, supported, and up-to-date versions of packages. Run the following command in your terminal:
$ composer require acseo/sylius-ai-tools
You need to register the plugin in your Symfony application. Open the config/bundles.php file and add the following line:
return [
ACSEO\SyliusAITools\SyliusAITools::class => ['all' => true],
];
Next, import the required configuration by adding the service definitions to your config/packages/_sylius.yaml file. Append the following lines:
# config/packages/_sylius.yaml
imports:
- { resource: "@SyliusAITools/Resources/config/services.yaml" }
To make the routes available, you need to import the routing configuration. Add the following lines to your config/routes.yaml file:
# config/routes.yaml
sylius_admin_ai_tools:
resource: "@SyliusAITools/Resources/config/routes/sylius_admin.yaml"
To complete the installation process, clear the cache and update the database schema. Execute the following command:
$ bin/console cache:clear
Update your Twig configuration to include the plugin's view templates. In your config/packages/twig.yaml, add the following path configuration:
twig:
paths:
'%kernel.project_dir%/vendor/acseo/sylius-ai-tools/src/Resources/views': ~
Copy the plugin templates into your project's template directory. Run the following command:
cp -R vendor/acseo/sylius-ai-tools/src/Resources/views/bundles/ templates/bundles/
Finally, set up your environment by adding the OpenAI API key to your .env file. Open the file and add the following line:
OPENAI_API_KEY=your_api_key_here