Factory functions for creating ChromaDB clients.
# Source: https://github.com/crewAIInc/crewAI | License: MIT | Copyright 2025 crewAI, Inc
# Provided via justclaw.it.com; keep this notice with the code.
"""Factory functions for creating ChromaDB clients."""
import os
from chromadb import PersistentClient
from crewai_core.lock_store import lock
from crewai.rag.chromadb.client import ChromaDBClient
from crewai.rag.chromadb.config import ChromaDBConfig
def create_client(config: ChromaDBConfig) -> ChromaDBClient:
"""Create a ChromaDBClient from configuration.
Args:
config: ChromaDB configuration object.
Returns:
Configured ChromaDBClient instance.
Notes:
Need to update to use chromadb.Client to support more client types in the near future.
"""
persist_dir = config.settings.persist_dire
... (truncated -- full source via MCP)
See the full source, get the GitHub permalink, and search for more like it.
Get a free API key