-
Notifications
You must be signed in to change notification settings - Fork 17
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
Added db.py file template #10
base: main
Are you sure you want to change the base?
Conversation
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.
great work with the code, I'm trying to understand why cant we go ahead with a random ID
collection = client.get_or_create_collection(name=collection_name) | ||
|
||
# Assuming each item needs a unique ID, we're using the text as the ID here | ||
# In a real-world scenario, you might want to use a more robust ID generation method |
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.
shouldn't we just go ahead with uuid.uuid4()
to get a random id?
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 can go with random id, i will make the changes
import chromadb | ||
from chromadb.config import Settings | ||
|
||
def get_connection(): |
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.
Can we create a class instead, with all the initialisations in the init function. This will eliminate need to call get_connection for creating the function. We can then create the CRUD operations inside the class.
@UB-AICLUB Thoughts?
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.
yeah we could go with a class but i guess lets not make him do this over again this works na so lets go ahead with it
added the template db.py for chromaDB