Skip to content

acseo/sylius-ai-tools

Repository files navigation

ACSEO

Sylius AI Tools

Use AI to improve eShop experience

Installation

To integrate the Sylius AI Tools into your project, follow these steps:

Step 1: Install the Package

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

Step 2: Register the Plugin

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],
];

Step 3: Import Required Configuration

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" }

Step 4: Import Routing Configuration

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"

Step 5: Finalize the Installation

To complete the installation process, clear the cache and update the database schema. Execute the following command:

$ bin/console cache:clear

Step 6: Configure Twig Paths

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': ~

Step 7: Add Plugin Templates

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/

Step 8: Configure the Environment

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