classifai icon indicating copy to clipboard operation
classifai copied to clipboard

Request: Set Default Keys per Service

Open MadtownLems opened this issue 6 months ago • 1 comments

Is your enhancement related to a problem? Please describe.

I set up Title Generation using Gemini. Later, I wanted to add Custom Excerpt Generation using the same key. I was surprised to learn that I had to go dig up my key and enter it again.

Designs

Perhaps sties could store default keys per service, which would be overiddable for each given feature. So you could set a default Gemini key somewhere, and that key would be used for any features that are set to use Gemini (if an additional key wasn't already set).

Describe alternatives you've considered

No response

Code of Conduct

  • [x] I agree to follow this project's Code of Conduct

MadtownLems avatar Jun 03 '25 16:06 MadtownLems

Yeah, I've got a note here in a pile on my desk to open something similar wherein we detect that you've already added credentials for a specific service provider and when you're setting up a new feature we detect if any of the service providers for that feature are enabled elsewhere and throw a ~"you're using [provider name] for [feature name], do you want to use that here as well?" sort of a message with action buttons to dismiss/accept and then automatically set up the same credentials.

jeffpaul avatar Jun 03 '25 16:06 jeffpaul

@MadtownLems take a look at https://github.com/10up/classifai/pull/947 and see if that might resolve or be a decent workaround for what you're looking for here?

jeffpaul avatar Jun 27 '25 19:06 jeffpaul

That seems like a reasonable approach for most sites. Question, though: What if I want to update a key for a service? A default key storage location would let me update just one place, whereas I imagine this would require individual updates for each impacted service?

MadtownLems avatar Jun 27 '25 19:06 MadtownLems

@MadtownLems yes, the approach in #947 would likely not apply a newly added/changed key to all prior features using that same service.

jeffpaul avatar Jul 08 '25 18:07 jeffpaul

As the WP AI team crafts the PHP AI Client SDK, doing something like this might be easier as we consider how best to refactor ClassifAI to make use of that SDK.

jeffpaul avatar Jul 08 '25 18:07 jeffpaul

Here's are wireframes with the solution:

cc @jeffpaul @dkotter

Nicolas-knight avatar Sep 12 '25 20:09 Nicolas-knight