-
Notifications
You must be signed in to change notification settings - Fork 15
Add the Title Generation execute functionality #67
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
Draft
dkotter
wants to merge
46
commits into
WordPress:trunk
Choose a base branch
from
dkotter:feature/title-generation-execute
base: trunk
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Add the Title Generation execute functionality #67
dkotter
wants to merge
46
commits into
WordPress:trunk
from
dkotter:feature/title-generation-execute
Conversation
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
… an ability. Make a few updates to our base REST endpoint
…for the same purpose
…ty for the title generation ability into the new ability class
…st we will use the content from that. And a number from 1 to 10 to control how many titles we generate
…ategory for each ability
…he AI Client to actually make the requests
… easily set credentials. Initialize the settings screen
… this into our request method
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## trunk #67 +/- ##
=============================================
+ Coverage 48.48% 65.43% +16.94%
- Complexity 45 115 +70
=============================================
Files 6 11 +5
Lines 198 460 +262
=============================================
+ Hits 96 301 +205
- Misses 102 159 +57
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:
|
…ge. Load this file as our prompt if it exists
…ert that to a string when sending it in a request
…using newer models that may not be fully supported
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.
Important
This PR is branched off of #61. That PR should be merged before
this PR is reviewed. Once merged, I can rebase this PR so the same
code doesn't have to be reviewed again.
What?
Partially closes #10
Builds off of the Title Generation feature base work done in #61 to wire up the actual execution of title generation.
Why?
In PR #61, we introduced the Title Generation Ability and Feature classes but the actual generation of titles wasn't completed there. This PR finishes that piece, though note there still isn't any UI to trigger this functionality, it all needs to be done via direct API requests.
How?
add/api-credentials-managementbranch of the WP AI Client repo (instead oftrunk) to take advantage of the new settings screen introduced there. Once that is merged and released, this can be changed to pull from an actual release insteadAPI_Requestclass that will be used to make requests to an AI Provider, using the PHP AI Clientgenerate_titlesmethod to the Title Generation Feature and uses that in the execute callback of the Title Generation AbilityTesting Instructions
There is no UI yet but can be tested by making direct API requests to the Title Generation Ability run endpoint. First you'll need to login to WordPress and go to
Settings > AI Credentialsand add in at least one API key.Make an authenticated
POSTrequest to the Title Generation run endpoint and ensure a title is generated based on the content you provideMake an authenticated
POSTrequest to the Title Generation run endpoint, passing in a valid post ID, and ensure a title is generatedMake an authenticated
POSTrequest to the Title Generation run endpoint, passing in a valid post ID and number and ensure multiple titles are generatedMake an authenticated
POSTrequest to the Title Generation run endpoint and don't pass any content or post ID and ensure an error is returnedTest using WordPress Playground
The changes in this pull request can be previewed and tested using this WordPress Playground instance:
Click here to test this pull request.