-
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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/multiple brains files #361
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
6251719
to
54de119
Compare
54de119
to
032df18
Compare
🗃️ use old user_id as default_brain_id
from supabase import Client | ||
|
||
|
||
class CustomSupabaseVectorStore(SupabaseVectorStore): | ||
"""A custom vector store that uses the match_vectors table instead of the vectors table.""" | ||
|
||
user_id: str | ||
brain_id: str = "none" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why at none by default ?
--- Create a new primary key with user_id and date | ||
ALTER TABLE users ADD PRIMARY KEY (user_id, date); | ||
|
||
-- Delete duplicate rows from the 'users' table |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Make it idempotent
-- Migration script | ||
BEGIN; | ||
|
||
-- Drop the old function if exists |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Make it idempotent
DROP FUNCTION IF EXISTS match_vectors(VECTOR(1536), INT, TEXT); | ||
|
||
-- Create the new function | ||
CREATE OR REPLACE FUNCTION match_vectors(query_embedding VECTOR(1536), match_count INT, p_brain_id UUID) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Merge all migrations into one
Ask GPT ;)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If works on mamadou's computer let me know when we merge so i can run the migrations in prod
032df18
to
c6b1ab7
Compare
@@ -24,8 +24,8 @@ export const NavItems = ({ | |||
}: NavItemsProps): JSX.Element => { | |||
const { session } = useSupabase(); | |||
const isUserLoggedIn = session?.user !== undefined; | |||
const shouldUseMultipleBrains = useFeature('multiple-brains').on; | |||
|
|||
const shouldUseMultipleBrains = useFeature("multiple-brains").on; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should may be now remove this ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Very nice job !
Will soon be able to share my brain 🤏🏽 with others 😍
Let's rerun the migration in a dev environment one last time.
c6b1ab7
to
c0955d5
Compare
c0955d5
to
de9e241
Compare
de9e241
to
aa63c3d
Compare
aa63c3d
to
c5df9c2
Compare
Description
Please include a summary of the changes and the related issue. Please also include relevant motivation and context.
Checklist before requesting a review
Please delete options that are not relevant.
Screenshots (if appropriate):