-
Notifications
You must be signed in to change notification settings - Fork 221
Conversation
To avoid creating products that are things that cannot be sold in stores (forests, people, etc.)
The release ZIP for this PR is accessible via:
Script Dependencies ReportThere is no changed script dependency between this branch and trunk. This comment was automatically generated by the TypeScript Errors Report
🎉 🎉 This PR does not introduce new TS errors. |
Size Change: -4 B (0%) Total Size: 1.61 MB
ℹ️ View Unchanged
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great work! Tested with the following prompts:
I sell milk
![Screenshot 2023-11-27 at 20 26 21](https://private-user-images.githubusercontent.com/15730971/286007385-bbf85594-1e2d-407f-be2f-6177171be1b6.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3Mzg5OTcyMjUsIm5iZiI6MTczODk5NjkyNSwicGF0aCI6Ii8xNTczMDk3MS8yODYwMDczODUtYmJmODU1OTQtMWUyZC00MDdmLWJlMmYtNjE3NzE3MWJlMWI2LnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTAyMDglMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUwMjA4VDA2NDIwNVomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPWNiN2M2MGRlYjgxN2Y2NWJkYWQ3MjA2MThhYjZlOGRiOTcyNDRiOWI1MzNiZjNhMzc0NDFmMGJkY2Y0Njg1NGYmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.ZwK3qNnUBaAH1_9JCk7LQYmn-KPtKaMHy6fJLchkf9U)
A premier online destination for the latest electronic gadgets, offering everything from cutting-edge smartphones to innovative smart home devices, with expert reviews and tech support.
![Screenshot 2023-11-27 at 20 30 19](https://private-user-images.githubusercontent.com/15730971/286007663-2445f030-f789-4dc5-9446-6696e71f8691.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3Mzg5OTcyMjUsIm5iZiI6MTczODk5NjkyNSwicGF0aCI6Ii8xNTczMDk3MS8yODYwMDc2NjMtMjQ0NWYwMzAtZjc4OS00ZGM1LTk0NDYtNjY5NmU3MWY4NjkxLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTAyMDglMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUwMjA4VDA2NDIwNVomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTllMzllMjQyM2NjYjkwN2QwMjk4ZGVkNGY2ZTNlNzE5ZWFmZjViMDA4ODI4MTM3ZmI3ODY4NTY5NjlkOTBiYjQmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.bZr5VjkW0uimR5YKWbiC-a4NgI3GG8kBYjHD2ihrtQ8)
A paradise for book lovers, featuring a vast collection of books in various genres, including rare and out-of-print editions, with a community forum for discussions and book recommendations.
![Screenshot 2023-11-27 at 20 32 33](https://private-user-images.githubusercontent.com/15730971/286007846-832abe0e-eabc-4b18-bf6c-6e8f450b55ff.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3Mzg5OTcyMjUsIm5iZiI6MTczODk5NjkyNSwicGF0aCI6Ii8xNTczMDk3MS8yODYwMDc4NDYtODMyYWJlMGUtZWFiYy00YjE4LWJmNmMtNmU4ZjQ1MGI1NWZmLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTAyMDglMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUwMjA4VDA2NDIwNVomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPWQ1YTUxOGQ1NTUxZTkyMWRkZjE2MzhkZDkwYzA1YWI3OTgyZWY4YWIwZGE2M2YxMTkzOGIzNzUxZDEwYzkxN2MmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.-FXM_kk9UBensToojPjWpvg2ptV5cjgs60pQpLJz_WY)
An online store dedicated to pet lovers, providing a variety of pet supplies, toys, and food for different animals, along with a pet adoption service and a blog for pet care tips.
![Screenshot 2023-11-27 at 20 36 51](https://private-user-images.githubusercontent.com/15730971/286008561-48a145ab-8b0d-451e-aa2c-e01dc8688a7f.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3Mzg5OTcyMjUsIm5iZiI6MTczODk5NjkyNSwicGF0aCI6Ii8xNTczMDk3MS8yODYwMDg1NjEtNDhhMTQ1YWItOGIwZC00NTFlLWFhMmMtZTAxZGM4Njg4YTdmLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTAyMDglMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUwMjA4VDA2NDIwNVomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTBlOWZkNGVkMGZiMDE3MGZiZDc0MWQ1ZTQ2NWVjNjQyNTBlOTI2ZWNlNDMwMDFhMDQxMWYwYmYxNjczY2VmMDYmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.8GJ9nysg9rzyDmixORyybC5KthVACnMrTYQu5jCo160)
I still see some instances where the product description doesn't necessarily describe what the business is selling, such as "Pots fence" for a pet supplies store or "Coffee Table Set" for a bookshop.
We still need to further investigate if it's possible to fine-tune these prompts to ensure the business description consistently takes priority over the image description, but can be done on a separate PR.
Regarding:
It also adds a condition to check the images param in the PatternUpdater to avoid a fatal error when calling the endpoint without any images:
[23-Nov-2023 08:42:10 UTC] PHP Fatal error: Uncaught TypeError: count(): Argument #1 ($value) must be of type Countable|array, null given in /public/wp-content/plugins/woocommerce-gutenberg-products-block-11877/src/Patterns/PatternUpdater.php:64
Nice catch!
What
This PR does some prompt fine-tuning to avoid creating products that are things that cannot be sold in stores (forests, people, etc.).
It also adds a condition to check the images param in the
PatternUpdater
to avoid a fatal error when calling the endpoint without any images:[23-Nov-2023 08:42:10 UTC] PHP Fatal error: Uncaught TypeError: count(): Argument woocommerce/woocommerce-blocks#12058 ($value) must be of type Countable|array, null given in /public/wp-content/plugins/woocommerce-gutenberg-products-block-11877/src/Patterns/PatternUpdater.php:64
Why
Testing Instructions
Please consider any edge cases this change may have, and also other areas of the product this may impact.
/wp-admin/tools.php?page=woocommerce-admin-test-helper
and enablecustomize-store
feature flag:Test the CYS experience
Screenshots or screencast
WooCommerce Visibility
Required:
Checklist
Required:
[type]
label or a[skip-changelog]
label.Conditional:
[skip-changelog]
label is not present).Changelog