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 API validation step for OpenAI in Settings #2265

Merged
merged 5 commits into from
Aug 1, 2024

Conversation

HardeepAsrani
Copy link
Member

@HardeepAsrani HardeepAsrani commented Jul 22, 2024

Closes https://github.com/Codeinwp/otter-internals/issues/191

Summary

The PR adds a validation step to OpenAI API insertion by making an example request, thus making sure it also has the required capabilities for making a Chat Completion request.

Screenshots


Test instructions

  • Add an invalid key and confirm it shows an error about exactly what is wrong.
  • Try using a valid key and confirm it is saved.
  • Also trying emptying the field and confirm it is removed without showing any errors.

Checklist before the final review

  • Included E2E or unit tests for the changes in this PR.
  • Visual elements are not affected by independent changes.
  • It is at least compatible with the minimum WordPress version.
  • It loads additional script in frontend only if it is required.
  • Does not impact the Core Web Vitals.
  • In case of deprecation, old blocks are safely migrated.
  • It is usable in Widgets and FSE.
  • Copy/Paste is working if the attributes are modified.
  • PR is following the best practices

@HardeepAsrani HardeepAsrani marked this pull request as ready for review July 25, 2024 04:03
@pirate-bot
Copy link
Contributor

pirate-bot commented Jul 25, 2024

Bundle Size Diff

Package Old Size New Size Diff
Animations 263.48 KB 263.48 KB 0 B (0.00%)
Blocks 1.52 MB 1.52 MB 14 B (0.00%)
CSS 92.73 KB 92.73 KB 0 B (0.00%)
Dashboard 195.5 KB 195.94 KB 451 B (0.23%)
Onboarding 153.14 KB 153.14 KB 0 B (0.00%)
Export Import 90.21 KB 90.21 KB 0 B (0.00%)
Pro 361.57 KB 361.58 KB 7 B (0.00%)

@pirate-bot
Copy link
Contributor

pirate-bot commented Jul 25, 2024

Plugin build for d2ed9e4 is ready 🛎️!

@pirate-bot
Copy link
Contributor

pirate-bot commented Jul 25, 2024

E2E Tests

Playwright Test Status:

Performance Results serverResponse: 245.8, firstPaint: 156.6, domContentLoaded: 1615.95, loaded: 1616.75, firstContentfulPaint: 3602, firstBlock: 7056.2, type: 14.13, minType: 12.21, maxType: 17.93, typeContainer: 9.14, minTypeContainer: 7.83, maxTypeContainer: 11.56, focus: 36.13, minFocus: 31.09, maxFocus: 45.26, inserterOpen: 26.15, minInserterOpen: 22.87, maxInserterOpen: 33.11, inserterSearch: 0.77, minInserterSearch: 0.63, maxInserterSearch: 1.04, inserterHover: 3.39, minInserterHover: 2.69, maxInserterHover: 4.46, listViewOpen: 154.65, minListViewOpen: 138.85, maxListViewOpen: 188.55

Copy link
Collaborator

@carlalexander carlalexander left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Everything looked really good! Just a few comments, but nothing really major. 🥳

inc/server/class-prompt-server.php Outdated Show resolved Hide resolved
inc/server/class-prompt-server.php Outdated Show resolved Hide resolved
inc/server/class-prompt-server.php Outdated Show resolved Hide resolved
inc/server/class-prompt-server.php Outdated Show resolved Hide resolved
inc/server/class-prompt-server.php Show resolved Hide resolved
inc/server/class-prompt-server.php Outdated Show resolved Hide resolved
@pirate-bot pirate-bot added the pr-checklist-complete The Pull Request checklist is complete. (automatic label) label Jul 30, 2024
Copy link
Collaborator

@carlalexander carlalexander left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just need to fix the json_decode edge case and we're good 🥳

Copy link
Collaborator

@carlalexander carlalexander left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Merge all the commits together and add the feat: in the commit message and we're good to go!

@HardeepAsrani HardeepAsrani merged commit 9584265 into development Aug 1, 2024
11 checks passed
@HardeepAsrani HardeepAsrani deleted the fix/issue-191 branch August 1, 2024 22:04
@pirate-bot
Copy link
Contributor

🎉 This PR is included in version 3.0.0 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

@pirate-bot pirate-bot added the released Indicate that an issue has been resolved and released in a particular version of the product. label Aug 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pr-checklist-complete The Pull Request checklist is complete. (automatic label) released Indicate that an issue has been resolved and released in a particular version of the product.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants