Download the PHP package tmonier/sylius-ai-catalog-copilot-plugin without Composer

On this page you can find all versions of the php package tmonier/sylius-ai-catalog-copilot-plugin. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package sylius-ai-catalog-copilot-plugin

Sylius AI Catalog Copilot Plugin

Build

Reviewable AI suggestions for product descriptions, SEO metas and translations in the Sylius 2 back office.

Writing and translating product texts is the slowest part of catalog work. Language models are good at it, but a merchant cannot let them publish unreviewed texts: models invent facts, and in the EU some claims ("eco-friendly", "carbon neutral") are now banned when they are not substantiated.

This plugin asks the model of your choice (Mistral, OpenAI, Anthropic, a self-hosted Ollama... through Symfony AI) for suggestions. Nothing is written on a product until an administrator accepts it.

Features

Need What the plugin does
Write the texts of a product AI copilot toolbar in each locale of the product Translations tab: Generate the description, short description, meta description or meta keywords.
Translate a product Translate from <default locale> in the other locales, field by field.
Keep control Every answer becomes a pending suggestion. The product page lists them with Accept / Reject; a side-by-side page compares the current and the suggested text. Accepting writes the field server-side and reloads the page: the product form (a Live Component) is never modified in the browser.
Review in bulk AI suggestions grid (Catalog menu) with filters (state, field, product, locale), accept / reject per row and bulk accept / reject.
Never overwrite a human A suggestion is refused when the field changed since it was generated. Older pending suggestions of the same field are rejected when a new one is generated.
Facts, not hallucinations Prompts give the model the product name, categories, attributes and options as the only facts it may state. They never contain customer data.
EU environmental claims Generic claims ("eco-friendly", "green", "energy efficient", "écologique", "nachhaltigen", "ekologicznego", "biodegradable", "carbon neutral"... with their inflections in 7 languages) not backed by an ecolabel attribute are flagged: highlighted in the text, with a warning in the grid, the product page and the comparison page, before the reviewer accepts. Carbon / climate neutrality, net zero and offsetting claims (banned outright) are always removed. A remove mode removes every unsubstantiated claim. See Legal.
Clean output Plain text only (HTML through Symfony HtmlSanitizer: the text of any element is kept, tables and lists become lines, scripts, styles and embeds are dropped, Markdown fences removed), length limits (meta description 50-160 characters, truncated on a word boundary), warnings shown on the suggestion.
Know what was AI-written Provenance markers: model and dates stored for each field written from a suggestion, a badge in the admin, an optional shop notice and data-ai-* attributes. Texts of the demo generator are never presented as AI-generated.
Bulk generation tmonier:ai-copilot:generate --field=description --locale=en_US --only-empty creates pending suggestions for many products (capped per run, with a cursor to continue).
Try it without an API key The default demo generator assembles texts from the product facts with fixed sentences in the language of the locale (en, fr, de, es, it, nl, pl; English otherwise), without any AI call; "Translate from" rebuilds the text from the product data instead of translating. Its suggestions are clearly labelled in the admin.
Integrate AiSuggestionAccepted event after each accepted suggestion.

Also included: translations in English, French, German, Spanish, Italian, Dutch and Polish; prompts as overridable Twig templates; Twig Hooks everywhere; MySQL, MariaDB and PostgreSQL support.

Screenshots

Requirements

Version
PHP 8.2+ (Sylius 2.3 needs 8.3+)
Sylius 2.2, 2.3
Symfony 7.4, 8.0 (Symfony 8 with Sylius 2.3 only)
Symfony AI symfony/ai-bundle and symfony/ai-platform 0.14.x

Symfony 6.4 is not supported: Symfony AI requires Symfony 7.3+.

Symfony AI is 0.x. Each minor (about one a month) may break its API, so this plugin pins ^0.14 (>= 0.14.0, < 0.15) and a new plugin version follows each Symfony AI minor (a weekly CI job tests the next one). Until Symfony AI 1.0, the plugin cannot be installed next to a package that pins another Symfony AI minor.

Installation

  1. Require the package, and the Symfony AI bridge of your provider when you use one:

  2. Register the bundles in config/bundles.php (Symfony Flex does it automatically once a recipe exists):

  3. Import the configuration in config/packages/tmonier_sylius_ai_catalog_copilot.yaml:

  4. Import the admin routes in config/routes/tmonier_sylius_ai_catalog_copilot.yaml:

  5. Run the migrations (two tables: tmonier_ai_copilot_suggestion, tmonier_ai_copilot_provenance):

The plugin now works with the demo generator: its fixed sentences only show the workflow. Real wording, and real translations of your texts, need a real model: plug one as below.

Plugging a model

Platforms and credentials are configured with symfony/ai-bundle, from environment variables. No credential is ever stored in the database. The plugin only needs the service id of the platform (ai.platform.<name>) and a model name.

A self-hosted Ollama keeps product data on your servers. Whatever the provider, only catalog data is sent (product name, code, categories, attributes, options, and the source text for a translation).

To use something else (a local model, a proxy, a company gateway), implement Tmonier\SyliusAiCatalogCopilotPlugin\Generator\TextGeneratorInterface and set generator: { type: service, service: app.my_generator }.

Models newer than the Symfony AI model catalog of the installed minor (e.g. claude-haiku-5-5 with Symfony AI 0.14) are refused by the platform: set model_class to the bridge model class (Symfony\AI\Platform\Bridge\Anthropic\Claude for Anthropic) to use any model id. The generator type can also be an environment variable ('%env(TMONIER_AI_GENERATOR)%', value demo or platform), resolved at runtime; in demo mode the platform is never created. When the platform cannot be created (e.g. missing API key), the admin shows an error message and nothing is generated. API keys stay in environment variables: they are never stored in the database, shown in the admin, or written in the logs (failures are logged with the exception class and message only).

Configuration

The rate limiter uses two independent sliding-window counters: one per admin user (keyed by getUserIdentifier()) and one global (keyed 'global'). Both tokens are consumed on every generation; if either counter is exhausted the request is denied with a flash error and the product page is reloaded — nothing is generated. The admin can retry once their quota refills. Set enabled: false if your infrastructure already throttles these routes, or if you run the plugin in a context without a persistent cache (the CLI command is never rate-limited).

The cache.rate_limiter pool comes from Symfony's Rate Limiter component defaults. To use a dedicated pool (recommended in production):

Usage

Customisation

Sibling plugins

Both are optional: this plugin depends on neither.

Legal notes

This section is information, not legal advice. Check your obligations with a lawyer.

Limitations

Development

The test application uses the demo generator: no test, CI job or dev environment calls an AI service. The Symfony AI adapter is tested against Symfony AI's InMemoryPlatform.

Trying with a real model (Anthropic Claude)

The test application is wired to Anthropic but uses the demo generator unless told otherwise (the tests and the CI always force the demo generator: no API call).

  1. Put these lines in tests/TestApplication/.env.local (gitignored, never commit it):

  2. Clear the cache: vendor/bin/console cache:clear.
  3. In the admin, generate or translate a field again (Generate / Translate from in the product Translations tab), then review the pending suggestion.

Each click is one paid API call (a few hundred to a few thousand tokens). Only catalog data is sent to Anthropic: product name and code, categories, attributes, options and, for a translation, the source text; never customer data. Remove the lines (or set TMONIER_AI_GENERATOR=demo) and clear the cache to go back to the demo generator.

License

MIT. See LICENSE.


All versions of sylius-ai-catalog-copilot-plugin with dependencies

PHP Build Version
Package Version
Requires php Version ^8.2
sylius/sylius Version ^2.2
symfony/ai-bundle Version ^0.14
symfony/ai-platform Version ^0.14
symfony/html-sanitizer Version ^7.4 || ^8.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package tmonier/sylius-ai-catalog-copilot-plugin contains the following files

Loading the files please wait ...