Product Text-to-Text Use Cases
The product text-to-text use cases involve the generation of text-based AI content for product data and includes prompts that generate output for: search terms, marketing descriptions, keyword density, attribute group attributes, and image descriptions.
An individual product can be associated with multiple prompts, and each prompt can be used for any number of different products. Prompts are executed by triggering a relevant product, which can be done in a variety of ways, such as a step within a workflow, as part of an import, or as part of an event processor process. Additionally, multiple products can be triggered at once if included in a collection when initiating a bulk update. This should only be done once the prompts have been finalized via prompt engineering (see below).
Once the product is triggered and an output is generated by the AI, it is saved in the dedicated prompt-output attribute on the relevant product. Next, the product is pushed into the Generative AI Review workflow to review the prompt output. The user can customize which product workflow or workflow step the product is pushed to when the output is generated.
Product text-to-text prompts
Prompts PTTT02, which generates marketing descriptions, and PTTT03, which calculates the keyword density of generated search terms, are used together to generate text for products based on existing product data and previously generated data. These two prompts can be executed in sequence where the output for one prompt can be used for the input of the other.
Prompt PTTT04 generates missing attribute values of all the attributes in an attribute group based on existing product data. Which attribute group needs attributes to be generated for it must be configured in the associated business rule.
Prompt PTTT05 generates description text for a product based on existing product data and the metadata of all referenced images. In order to utilize this prompt, the referenced images must have relevant metadata to pull from.
Copy output to attribute
Once an output has been generated, it is possible to copy it to a target attribute, if desired. Typically, this is only done if the generated output is being kept separate from existing product data. The existing data should only be overwritten if the AI-generated output has been reviewed (e.g., being approved in the review workflow).
Prompt engineering
A prompt is defined by its input, such as any relevant attributes, instructions, and the products which reference the prompt. Prompt input may include:
-
Parameters
-
Sort order for sequential prompt execution
-
Input attributes, focus attributes, and image metadata attributes
-
Persona, target audience, and message tone
-
Attribute group output
-
Output attributes and maximum number of characters
The most straightforward way to create a new prompt is to copy an existing one, duplicate output and target attributes for it, add them to the relevant List of Values (LOV), and then edit the new prompt.
The product input and output attributes used in each prompt get their selectable values from an LOV. The easiest method for creating a new input / output attribute is to duplicate an existing one and add the ID for the new product input / output attribute and the name of the LOV.
Automating the execution of prompts
By default, executing a prompt to generate an output is done by either manually selecting the Generate AI Output button, or by executing a relevant bulk update. In either case, a business rule is executed and an event is generated in the event processor. To automate prompt execution, use the code of the business rule which generates events for the event processor either as part of an import, as part of an existing workflow, or as part of another existing process or business rule.
Embed into existing workflow
By default, after the AI output is generated, the solution initiates products into a workflow called GenAI Review Workflow – Texts. If desired, this can be changed to another existing workflow or workflow state. To accomplish this, the user must edit the business rule GenAI - Text for Products – Generate Output and change the variable “aiReviewWorkflow” to the ID of the desired workflow. To initiate the product into a specific state of the workflow, change the code under “Initiate in Ai Review or Error Workflow”.
Automatically copy output to target attribute
By default, the business rule responsible for copying the generated output to the target attribute on the product is GenAI – Text for Products – Copy To Target. If desired, this can be changed to another attribute by enhancing the business rule with, for example, a lookup table that matches output and target attributes.