10up / classifai

Supercharge WordPress Content Workflows and Engagement with Artificial Intelligence.
https://classifaiplugin.com
GNU General Public License v2.0
567 stars 52 forks source link

Ensure all required options are in new onboarding #449

Open dkotter opened 1 year ago

dkotter commented 1 year ago

Describe the bug

We added a new onboarding feature in #411. This makes it much easier to get up and running with ClassifAI. In testing that out prior to the v2.1.0 release I noticed an issue though.

Most of our existing integrations require a number of things to actually work correctly:

  1. Valid credentials
  2. The feature needs to be turned on
  3. Other settings need to be configured typically, like which roles have access or which post statuses we should run on

The onboarding wizard properly accounts for 1 and 2 but doesn't take into account 3. I put a fix in place for both OpenAI integrations and the Azure integration prior to the v2.1.0 release (can see that change here) but the IBM Watson integration still needs to be fixed as well as potentially re-thinking how we handle this.

The fix I put in place sets a default value to the settings we need if no values are passed when saving (which should only happen during the onboarding). While this works, it may be better to actually show those settings in the onboarding so users can tweak those to match their needs.

Here are the settings we need to account for during onboarding, in order for things to work properly (this doesn't take into account API credentials as those are already handled):

So right now, if you were to configure IBM Watson in the onboarding wizard, things won't actually work until you go to the main settings page and configure the things mentioned above. The other providers will work since I put in place defaults but again, we may want to bring those options into the wizard, like so:

Screen Shot 2023-05-02 at 9 22 31 AM

Steps to Reproduce

  1. Install ClassifAI on a new site and go through the onboarding wizard
  2. Configure IBM Watson and don't worry about the others
  3. Without going to the actual settings page, save a new post and see if any taxonomy terms are added (they shouldn't)
  4. Go to the settings page for IBM Watson and configure the options that were left blank
  5. Save the post again and see terms being added

Screenshots, screen recording, code snippet

No response

Environment information

No response

WordPress information

No response

Code of Conduct

dkotter commented 1 year ago

This also gets trickier when thinking of new features that are coming, like the OpenAI Embeddings feature. This requires you to choose at least one post type, one post status and one taxonomy to use. If any of those aren't chosen, things won't work. I don't know if we surface all of those options during onboarding or if we force those settings to some sort of default.

iamdharmesh commented 1 year ago

@dkotter @jeffpaul I tried to add the required settings for IBM Watson NLU, but it makes the onboarding form longer. We may look into applying a combination (Default values + Onboarding form) on required form settings to keep the onboarding process simple. what do you think?

Thanks.

screencapture-classifai-local-wp-admin-admin-php-2023-05-18-19_17_44

dkotter commented 1 year ago

Yeah, I don't want to overwhelm people when they are getting set up, so I don't love the idea of showing all of these options immediately.

I like the idea of ensuring we have defaults for any fields that are required for features to work. This way once something is turned on and valid authentication is in place, things work without additional configuration (this impacts NLU the most but we just merged in a bunch of new features that might also be impacted).

Beyond having proper defaults, the other option I thought of was adding secondary setting screens for each of these. So you would choose which features you want enabled, you'd then register ClassifAI and then end up on the same provider configuration screen. But after putting in valid credentials for a provider, you'd then get a new screen that has all other settings, allowing you to modify those if desired.