woocommerce/plugins/woo-ai/src/constants.ts

6 lines
242 B
TypeScript
Raw Normal View History

export const WOO_AI_PLUGIN_FEATURE_NAME = 'woo_ai_plugin';
export const MAX_TITLE_LENGTH = 200;
export const MIN_TITLE_LENGTH_FOR_DESCRIPTION = 15;
export const MIN_DESC_LENGTH_FOR_SHORT_DESC = 100;
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 16:59:26 +00:00
export const DESCRIPTION_MAX_LENGTH = 300;