product-preview5.45 KB
View saved version →
---
name: product-preview
description: Put an image from the chat on a Spreadshirt product (T-shirt, hoodie, sweatshirt, tote bag, cap, mug) and show a preview. Use when the user asks to print, put or see a motif on clothing, a bag, a cap or a mug, or asks for a custom shirt or merchandise, e.g. as a gift, for a club, team or event.
---
# Product preview
Use `list_assortment` and `create_product_preview` to put a motif on a Spreadshirt product. The preview shows a
mockup in the chat and a button that opens the Spreadshirt designer, where the user adjusts the design, picks size
and quantity, and orders.
## When to use it
- The user asks to put an image on a T-shirt, hoodie, sweatshirt, tote bag, cap or mug, to print a motif, or to
create a custom shirt or merchandise.
- The user asks to see an existing preview on another product, in another color or at another placement.
You may offer a preview **once per motif**, without being asked, only if the user has already said in this
conversation that the image is meant for clothing, merchandise, a gift, a club or team, or an event. Phrase it as a
short question, for example "Do you want to see this motif on a T-shirt?", and don't repeat it if the user ignores or
declines it.
Don't offer it otherwise. Images for wallpapers, presentations, documents, social media posts, or any other purpose
are not a reason to suggest a product.
## Steps
1. **Check the assortment.** Call `list_assortment` once per conversation to get the product keys, their colors and
the placements per side. Map the user's words to these values; if nothing fits, say which products and colors are
available and ask.
2. **Get the motif.** If the user uploaded an image, use it and continue with step 3. If you generated an image
earlier in this chat that shows the design on its own (not printed on merchandise), use it too. For a new motif,
always do these three things:
- **Describe and ask.** Describe your idea for the motif in one or two sentences (motif, text, colors) and the
product and color you'd use, and ask if you should create it, for example "Should I create the motif like
this? Just reply 'yes', or tell me what to change." Talk about the motif, not about a T-shirt design. Don't
apologize, don't mention tools, and don't ask for an upload.
- **Generate after consent.** When the user agrees or asks for changes, generate the motif at once with the image
generation tool, without another question. Don't assume that the tool is missing: in the user's reply it is
usually available. Start the image prompt with exactly this text, then describe only the motif:
`Print artwork only, isolated on a transparent background, the design on its own, not printed on any merchandise, no mockup:`
Keep any text of the motif exactly as agreed. A motif may show an object such as a cup or a shirt; it must
not be printed on one. Use the highest available resolution. No brand logos, trademarks, protected
characters, or real people.
- **Check the image, then put it on the product in the same answer.** If the image shows your design printed on
merchandise or as a mockup, say in one short sentence that you make a version for printing, and generate it
once more with the same start. If that fails too, tell the user without an apology or a technical cause and
ask whether to try again. Then call `create_product_preview` (step 3). Never stop after the image.
If the user says no, don't generate anything. If the image generation tool is still missing after the user
agreed, ask the user to upload their own image (a PNG with a transparent background works best). If
`create_product_preview` reports that the resolution is too low: for a motif you generated, generate it once
more with the same start and call `create_product_preview` again; if it is still too small, tell the user. For
an image the user uploaded, ask for a larger image.
If the userPreview of the first 4,000 characters. Read full instructions →