import chromadb
from llama_index.vector_stores.chroma import (
ChromaVectorStore
)
from llama_index.core import StorageContext
def get_storage_context(
collection_name
):
client = chromadb.PersistentClient(
path="./chroma_db"
)
collection = (
client.get_or_create_collection(
collection_name
)
)
vector_store = ChromaVectorStore(
chroma_collection=collection
)
storage_context = (
StorageContext.from_defaults(
vector_store=vector_store
)
)
return storage_context10 views