-
Notifications
You must be signed in to change notification settings - Fork 63
WIP: Start work on integrating the PHP AI Client package #994
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: develop
Are you sure you want to change the base?
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
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. |
@dkotter thanks for the PR! Could you please rebase your PR on top of the latest changes in the base branch? |
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
APIRequest
class 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: