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

OpenAI service & copy suggestion endpoint #1307

Merged
merged 28 commits into from Oct 3, 2023

Conversation

bttf
Copy link
Collaborator

@bttf bttf commented May 24, 2023

New backend endpoint to generate copy suggestions for the Visual Editor. Leverages the OpenAI API.

Changes:

  • Adds openai and @dqbd/tiktoken npm packages
  • Adds /transform-copy endpoint to REST API (intentionally undocumented)
  • Adds AITokenUsageModel to track daily usage and enforce limiting
  • Adds service openai that exposes generalized API for prompt completion flow

@linear
Copy link

linear bot commented May 24, 2023

GB-230 Visual Editor - AI-powered suggestions for copy

Use GPT to allow suggesting copy for websites using the visual editor

@github-actions
Copy link

github-actions bot commented May 24, 2023

Your preview environment pr-1307-bttf has been deployed.

Preview environment endpoints are available at:

@bttf bttf changed the title Copy suggestion endpoint OpenAI service & copy suggestion endpoint May 25, 2023
@bttf bttf force-pushed the adnan/gb-230-visual-editor-ai-powered-suggestions-for branch 2 times, most recently from 6b877a4 to e10cb9c Compare June 6, 2023 21:53
@bttf bttf force-pushed the adnan/gb-230-visual-editor-ai-powered-suggestions-for branch from e10cb9c to da34ad0 Compare June 8, 2023 17:21
@bttf bttf marked this pull request as ready for review June 22, 2023 16:22
@bttf bttf requested a review from a team June 22, 2023 16:22
@bttf bttf requested review from jdorn and removed request for a team August 2, 2023 21:48
packages/back-end/src/app.ts Outdated Show resolved Hide resolved
packages/back-end/src/services/openai.ts Outdated Show resolved Hide resolved
packages/back-end/src/services/openai.ts Outdated Show resolved Hide resolved
packages/back-end/types/ai.d.ts Show resolved Hide resolved
@bttf bttf requested a review from jdorn August 3, 2023 18:01
@bttf
Copy link
Collaborator Author

bttf commented Aug 3, 2023

Added feature flag that is disabled for production
Screenshot 2023-08-03 at 3 03 15 PM

@bttf
Copy link
Collaborator Author

bttf commented Aug 3, 2023

Added feature flag and conditional appending of query param based on feature flag value

Tested with FF on and off end-to-end

@bttf
Copy link
Collaborator Author

bttf commented Oct 2, 2023

@jdorn I spent some time trying to resolve the merge conflicts this morning but couldn't make progress ... Could we pair on this when you have a moment?

@bttf bttf force-pushed the adnan/gb-230-visual-editor-ai-powered-suggestions-for branch from 1f86f55 to 0a8741e Compare October 3, 2023 13:05
@bttf
Copy link
Collaborator Author

bttf commented Oct 3, 2023

Tested

  • Disabled FF w/ Valid OpenAI key = disabled
  • Enabled FF w/ NO OpenAI key = disabled
  • Enabled FF w/ Valid OpenAI key = enabled

@bttf bttf merged commit 131d275 into main Oct 3, 2023
3 checks passed
@bttf bttf deleted the adnan/gb-230-visual-editor-ai-powered-suggestions-for branch October 3, 2023 14:00
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.

None yet

2 participants