WP 7.0: Move away from directly using the AI_Client#275
WP 7.0: Move away from directly using the AI_Client#275dkotter merged 10 commits intoWordPress:developfrom
AI_Client#275Conversation
…. Start updating our tests to account for this. Install the OpenAI Provider plugin in our test environment
…_client_prompt helper function
…trunk for now, otherwise those fail. Will change this once 7.0 is released
…e to changes with the new AI Client
…ponses API. Update E2E tests to account for the new output format
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## develop #275 +/- ##
=============================================
+ Coverage 57.68% 57.72% +0.03%
Complexity 567 567
=============================================
Files 35 36 +1
Lines 2933 2933
=============================================
+ Hits 1692 1693 +1
+ Misses 1241 1240 -1
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:
|
|
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. |
jeffpaul
left a comment
There was a problem hiding this comment.
Looks good to me, but I defer to @felixarntz for any code review concerns (though also fine to merge in to continue with work building towards 7.0 and we can always come back to iterate in another PR if needed)
Additional Fix: Resolves Fatal Error with WordPress 6.9+This PR also resolves a critical fatal error that was occurring in v0.4.1 when the plugin was activated with WordPress 6.9+: Root Cause: The bundled Resolution: By removing the bundled dependencies and moving to use WordPress core's AI Client, this PR eliminates the version conflict entirely. Issue: #285 Great work on this refactor - it solves both the architectural goal AND a blocking compatibility issue! 🎉 |
What?
Partially closes #244
Move away from using the
AI_Clientdirectly and instead use the newwp_ai_client_promptfunction. Also update to use the new Connectors screen instead of the AI Credentials screen. And finally address a few fixes that cropped up now that the OpenAI provider is using the Responses API.Why?
In the next release, WP 7.0 will be our minimum and as such, we want to rely on the AI Client that is in core instead of bundling that ourselves. This is the final step in a 3-part process to get everything working. Anywhere we were relying on the old approach (
AI_Client, AI Credentials screen, built-in providers), as now been updated.How?
wp_ai_client_promptinstead of usingAI_Clientdirectlytrunkonly for now as they'll fail on 6.9Use of AI Tools
All initial work was done by me with AI helping debug and fix failing tests
Testing Instructions
npm i && npm run build && composer i)Note
Plugin Check is still failing but that's due to an upstream issue that should be resolved in their next release.