mirror of
https://github.com/ZTatman/Nadir.git
synced 2026-11-20 20:08:00 +00:00
11 lines
325 B
Python
11 lines
325 B
Python
import chromadb
|
|
|
|
|
|
def get_collection():
|
|
"""
|
|
Retrieves chromadb collection by either retrieving one that was already created or by creating a new one
|
|
"""
|
|
client = chromadb.PersistentClient("./chroma_db")
|
|
return client.get_or_create_collection(
|
|
name="diary", metadata={"hnsw:space": "cosine"}
|
|
)
|