- class ChromaContainer(image: str = 'chromadb/chroma:latest', port: int = 8000, **kwargs)ΒΆ
The example below spins up a ChromaDB container, performs a healthcheck and creates a collection. The method
get_client
can be used to create a client for the Chroma Python Client.Example
>>> import chromadb >>> from testcontainers.chroma import ChromaContainer >>> with ChromaContainer() as chroma: ... config = chroma.get_config() ... client = chromadb.HttpClient(host=config["host"], port=config["port"]) ... col = client.get_or_create_collection("test") ... col.name 'test'