WIP: Start work on integrating the PHP AI Client package#994
Open
WIP: Start work on integrating the PHP AI Client package#994
Conversation
…sts using the AI SDK
… title generation feature
…y before we use them
…or changing existing structure. Get the Key Takeaways Feature to work with new API request
…tagging over to new API approach
Member
My hope is we can push those upstream, though if the core team decides not to include additional providers or features then we might consider releasing those as their own extensions of the core PHP/WP clients versus keeping hardcoded within ClassifAI. |
6 tasks
|
@dkotter thanks for the PR! Could you please rebase your PR on top of the latest changes in the base branch? |
4 tasks
7 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description of the Change
Note
This is an early test of the new PHP AI Client package and things will likely change as that matures. Opening this PR both for discussion and as an example of how that package can be implemented, but this PR may never ship or may change to use the WordPress AI Client package.
This PR brings in the PHP AI Client package as a new composer dependency and starts to use that where possible. At the moment, only implemented for OpenAI and only for these Features:
We introduce a new base
APIRequestclass that Providers can extend for authentication purposes. This class has handling for existing API requests (GET, POST, POST FORM) so any existing functionality still works as expected but then introduces new handling for the PHP AI Client package, which allows Providers to opt-in to using that where it makes sense.Potential next steps:
Note
E2E tests are failing here because our test plugin that hooks in and captures HTTP requests and mocks those no longer works with this PHP AI Client package, as it doesn't use the WordPress HTTP API and thus there aren't any hooks firing there. If we continue with this approach, we'll need to figure out a different way to capture and mock those requests. I think if we end up using the WordPress AI Client package though, that will be solved for us.
How to test the Change
Coming soon...
Changelog Entry
Credits
Props @dkotter
Checklist: