Skip to main content

Automation rules

Automation rules functionality allows selected prompts to be run by Cron. The list of rules are located at System -> AI Assistant -> Automation rules.

image

Automation rule list

Here, you'll find the following fields:

  • ID: ID of the rule.
  • Title: rule name.
  • Is active: prompt status.
  • Action: actions on the selected prompts in the queue:
    • Edit: allow see and edit trigger.
    • Delete: allow delete source.

Configure automation rule

Each rule is created individually, but if you create multiple similar rules, use the Duplicate button for faster operation.

General information

Contains general information about the automation rule.

  • Title: the name of the rule that is visible in the grid of automation rules.
  • Entity type: type of entity to configure the rule for. You won't be able to change the entity type after you saved the rule. Currently, the extension allows creating rules for:
    • Products
    • Categories
  • Active: set to Yes if the rule should be executed.
  • Apply only once: set to Yes if the rule should be executed only one time.
  • Overwrite not empty field: set to Yes if the rule should overwrite any existing text in the selected text field.
  • Store views: select the applicable scope of the rule.

Configuration

Contains the selection of prompt, field, and conditions for applying the rule.

  • Prompt: select the existing prompt that should be used with this automation rule. For example, a prompt for generating meta title.
  • Field: select one field that will be used for inserting the prompt output. For example, a Product Meta Title field.
  • Conditions: select conditions to adjust entities for which the rule should be applied. Leave blank if the rule should be applied for all entities of the type selected at the stage 1.

Logs

Contains information about the application of the rule.

  • Level: shows the priority of the message's importance:
    • Error
    • Info
  • Message: brief information about the rule's operation.
  • Additional data: additional technical information for debugging the rule (prompt_id, title, code, forced, etc.)
  • Logged at: the date and time when the rule was triggered.
tip

To apply rule immediatelly after saving, use the CLI command:

bin/magento mirasvit:assistant:apply-rule --id 1

Where 1 is the identifier of the automation rule.

You can add command to Cron if necessary run it automatically.