Chroma

A ChromaDB client for Elixir.

Installation

If available in Hex, the package can be installed by adding chroma to your list of dependencies in mix.exs:

def deps do
  [
    {:chroma, "~> 0.1.0"}
  ]
end

Configuration

In your config file you can setup the following:

config :chroma, 
  host: "http://localhost:8000",
  api_base: "api",
  api_version: "v1"

By default the config is set to api/v1

Usage

To verify that the client is connected to the server, you can use the version function from the Chroma.Database module:

Chroma.Database.version

To handle all collection actions, you can use the Chroma.Collection module:

  {:ok, collection } = Chroma.Collection.create("my_collection", %{name: "string", age: "int"})
  {:ok, collection } = Chroma.Collection.get_or_create("my_collection", %{name: "string", age: "int"})
  {:ok, collection } = Chroma.Collection.get("my_collection")
  Chroma.Collection.delete("my_collection")

Documentation can be generated with ExDoc and published on HexDocs. Once published, the docs can be found at https://hexdocs.pm/chroma.