Add is_supported_* checks for better error handling#362
Add is_supported_* checks for better error handling#362dkotter merged 17 commits intoWordPress:developfrom
is_supported_* checks for better error handling#362Conversation
…ethod and within it, check if we have a model that supports that prompt. If not, return a more specific error message
…method and within it, check if we have a model that supports that prompt. If not, return a more specific error message
…der method and within it, check if we have a model that supports that prompt. If not, return a more specific error message
…der method and within it, check if we have a model that supports that prompt. If not, return a more specific error message
… and within it, check if we have a model that supports that prompt. If not, return a more specific error message
…hod and within it, check if we have a model that supports that prompt. If not, return a more specific error message
…that error properly
|
The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message. To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. |
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## develop #362 +/- ##
=============================================
- Coverage 63.81% 63.25% -0.57%
- Complexity 684 697 +13
=============================================
Files 49 49
Lines 3529 3573 +44
=============================================
+ Hits 2252 2260 +8
- Misses 1277 1313 +36
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
… those in our Abilities
…fix/is-supported-checks
There was a problem hiding this comment.
All looks good to me.
Could we apply the same ensure_text_generation_supported() approach to the Content_Classification ability? Happy to open a separate PR for that if you'd like, or apply it to this one.
Edit: Disregard the Content_Classification note. I'll apply it in #240 after this is merged in.
…t builder methods
Sorry, didn't see your edit until I had already pushed up change so this is done now in dd2f937 |
What?
Use the AI Clients built-in
is_supported_*checks to show better errors when a connected provider isn't supported. Follow up to #332Why?
Right now if you try and use a provider for something it doesn't support, this is caught and an error message is shown. But this error message isn't super helpful.
It's also best practice to utilize the AI Client's built-in
is_supported_*checks which also allows us to output more specific error messages.How?
Updates all of our AI Abilities to use the proper
is_supported_*method and return an error if the prompt isn't supported.Adds a new
get_prompt_buildermethod to all of those Abilities to handle this, making it easier to abstract out the building of the prompt builder.Fixes a bug where errors weren't showing when they occurred during generation of review notes. Also removed an extra "Error" text when an error happened during title generation.
Use of AI Tools
None
Testing Instructions