You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is your enhancement related to a problem? Please describe.
At the moment, the plugin offers services like Image Processing, Language Processing, etc. But the problem is when you add multiple Providers to a Service, accessing data for that Provider is not convenient.
...have utility outside of Watson's Language Understanding feature. In future, it we add let say, Microsoft's Text to Speech feature which is a Provider for the Language Processing Service, then the current helper get_supported_post_statuses() will not work even though it is required by the new Provider. This will force developers to add helpers for each Provider which will lead to code duplication.
Designs
No response
Describe alternatives you've considered
Identify existing helper functions that can be useful for multiple Providers.
Refactor (if possible) or deprecate in favour of functions that are generic and available to every Provider that needs it.
Code of Conduct
I agree to follow this project's Code of Conduct
The text was updated successfully, but these errors were encountered:
Sidsector9
changed the title
EPIC: Refactor ClassifAI so that it's easier to add more Providers under a Service.
Refactor ClassifAI so that it's easier to add more Providers under a Service.
Mar 6, 2023
Note that PR is now merged and I've opened up a simple first step follow up in #413. That said, I think there will still be more needed, as I've seen other areas of the code that assume we only have a single provider.
Is your enhancement related to a problem? Please describe.
At the moment, the plugin offers services like Image Processing, Language Processing, etc. But the problem is when you add multiple Providers to a Service, accessing data for that Provider is not convenient.
See this line for example:
classifai/includes/Classifai/Helpers.php
Line 47 in 1c1a180
The direct index access of
0
makes it impossible to access settings for Providers other than the one at0
.Helper functions such as:
classifai/includes/Classifai/Helpers.php
Line 264 in 1c1a180
...have utility outside of Watson's Language Understanding feature. In future, it we add let say, Microsoft's Text to Speech feature which is a Provider for the Language Processing Service, then the current helper
get_supported_post_statuses()
will not work even though it is required by the new Provider. This will force developers to add helpers for each Provider which will lead to code duplication.Designs
No response
Describe alternatives you've considered
Code of Conduct
The text was updated successfully, but these errors were encountered: