Skip to content
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

Add WP-CLI command to bulk process OpenAI Embeddings #521

Merged
merged 6 commits into from
Jun 30, 2023

Conversation

phpbits
Copy link
Contributor

@phpbits phpbits commented Jun 30, 2023

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:

  • A comma-delimited list of post IDs to process
  • A 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 reasons
  • A post_type argument that defaults to post. Will only process items that belong to the defined value.
    • A post_status argument that defaults to publish. Will only process items that belong to the defined value.
  • A dry-run argument that defaults to true. You must pass false to actually run the command

Changelog Entry

Added - Custom WP-CLI command that can be used to run Embeddings processing

Credits

Props @phpbits

Checklist:

  • I agree to follow this project's Code of Conduct.
  • I have updated the documentation accordingly.
  • I have added tests to cover my change.
  • All new and existing tests pass.

@phpbits phpbits requested review from a team, dkotter and jeffpaul as code owners June 30, 2023 13:36
@phpbits
Copy link
Contributor Author

phpbits commented Jun 30, 2023

@jeffpaul @dkotter This functionality is now ready for code review. Thanks!

@dkotter dkotter merged commit 81b6f9b into develop Jun 30, 2023
@dkotter dkotter deleted the feature/open-embeddings-cli-command branch June 30, 2023 19:33
@dkotter dkotter added this to the 2.2.3 milestone Jun 30, 2023
@dkotter dkotter linked an issue Jun 30, 2023 that may be closed by this pull request
1 task
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add WP-CLI command to bulk classify items using the OpenAI Embeddings feature
2 participants