Commit Graph

3 Commits

Author SHA1 Message Date
Nima Karimi 01dd039b21
Suggest product categories with AI (#39437)
* Accept arguments for the TinyContent getContent method.

Used to fetch the plain text version of the description.

* Add a class to the loading message content

* Set the max description length as global constant

* Create a MagicButton component and use it

* Get plain text description instead of HTML

* Return full category hierarchy (Parent > Child)

* Add method to return all available categories on the product edit page

* Helper function to generate product data instructions for the prompt

* Helper function to select category checkboxes on DOM

* Create component to display a list of suggestion items as pills

* Add product category suggestions to product edit page

* Use the AI package to get text completion

* Add tracks

* Add changelog

* Fix merge conflict

* Remove NoMatch state for category suggestions

* Get available categories using WC REST API

* Suggest new categories

* Run separate prompts for existing and new category generation

* Fix overflow in suggestion pills

* Don't include existing selected categories in prompt

* Add util to encode html entities

* Exclude "Uncategorized" category from product data

* Allow excluding properties from the product data instructions

* Create category from suggestion if it doesn't exist

* Show suggestions as links instead of pills

* Ask for feedback after suggestion selected

* Decode html entities in available categories results

* Don't encode html entities when comparing available categories

* Change feedback box style

* Suggest only one category

* Remove log

* Show feedback box after generating suggestions

Instead of showing it after a suggestion is selected

* Fix typo
2023-09-12 19:59:26 +03:00
Thomas Shellberg 8ec91504ff
Add Short Description "Write With AI" Button + Inform about automatic generation (#39805)
* Add "Write With AI" button to product short description media buttons area.
2023-09-06 12:36:14 +02:00
Joel Thiessen 8098c35588
Add initial release of WooAI plugin (#38610)
Co-authored-by: Joel Thiessen <444632+joelclimbsthings@users.noreply.github.com>
Co-authored-by: Nima Karimi <73110514+nima-karimi@users.noreply.github.com>
Co-authored-by: Thomas Shellberg <tommy.shellberg@automattic.com>
2023-06-08 13:20:05 -07:00