Add WP-CLI command to bulk process OpenAI Embeddings #521
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
In 437 we added a feature to classify content within your existing content structure using the OpenAI Embeddings API. This PR adds the WP CLI script to do bulk embeddings using the command below:
wp classifai embeddings
and has the following options:
per_page
argument. This controls how many items we process in each batch. Defaults to 100. As an example, if you have 1000 items to process, all of these will be processed but will be done in batches of 100 for performance reasonspost_type
argument that defaults topost
. Will only process items that belong to the defined value.post_status
argument that defaults topublish
. Will only process items that belong to the defined value.dry-run
argument that defaults totrue
. You must pass false to actually run the commandChangelog Entry
Credits
Props @phpbits
Checklist: