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

feat(ui): Utilize OpenAI for backend #553

Merged
merged 131 commits into from
May 25, 2024
Merged

feat(ui): Utilize OpenAI for backend #553

merged 131 commits into from
May 25, 2024

Conversation

andrewrisse
Copy link
Contributor

@andrewrisse andrewrisse commented May 22, 2024

closes #528
closes #414

  • Changes naming convention to use threads instead of conversations
  • Refactors to use OpenAI types for threads, messages, and assistants
  • Refactor to no longer save threads, messages, and assistants directly to Supabase, but instead uses OpenAI endpoints
  • Bug fixes for AssistantTile text, Assistant Avatar uploading
  • Adds new mocking setups for tests

Key differences with conversion to OpenAI:

  • OpenAI uses strings for ids, not uuids (ex. thread_12345), this required schema changes
  • OpenAI nests its message content into complex objects, but Vercel AI SDK does not. Required some type conversions and helper functions to ensure compatability
  • OpenAI is slower to respond and my be rate limiting us which causes Playwright test timeout issues, refactor required to improve reliability
  • Frontend is now limited to the API endpoints available with OpenAI and can no longer build it's own custom queries to pull data from Supabase. This drove several changes to basic application logic/data fetching as well as tests.
  • When viewing "files changed", several files look like they were added, but it's really just a name change (ex. conversation -> thread naming convention)
  • Migrations required for user profiles in Supabase - addition of "thread_ids" which tracks all of their threads so we can load them all when the app loads
  • Migration to delete conversations and messages from supabase. This will result in data loss, but we have accepted this for release 0.8.0. Alternative is to download all conversations and messages from Supabase, reformat into OpenAI type conventions, then re-save to Supabase once new LeapfrogAI API is ready.

This PR is currently deployed at ai.uds.dev

@andrewrisse andrewrisse marked this pull request as ready for review May 22, 2024 15:57
@andrewrisse andrewrisse requested a review from a team as a code owner May 22, 2024 15:57
@gregclark-defenseunicorns gregclark-defenseunicorns removed their request for review May 24, 2024 14:38
BillyFigueroa
BillyFigueroa previously approved these changes May 24, 2024
Copy link

@BillyFigueroa BillyFigueroa left a comment

Choose a reason for hiding this comment

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

Big PR but great work

@andrewrisse andrewrisse merged commit 5371956 into main May 25, 2024
11 checks passed
@andrewrisse andrewrisse deleted the 528-openai branch May 25, 2024 02:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
5 participants