### Managing Chroma Collections (Elixir) Source: https://github.com/0xalighieri/chroma/blob/main/README.md Examples demonstrating how to use the `Chroma.Collection` module for basic collection operations: creating a new collection, getting or creating a collection, retrieving an existing collection, and deleting a collection. Metadata types can be specified during creation. ```Elixir {: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") ``` -------------------------------- ### Adding Chroma Dependency in mix.exs (Elixir) Source: https://github.com/0xalighieri/chroma/blob/main/README.md To install the Chroma client, add the `chroma` package as a dependency to your Elixir project's `mix.exs` file. Specify the desired version. ```Elixir def deps do [ {:chroma, "~> 0.1.2"} ] end ``` -------------------------------- ### Configuring Chroma Client (Elixir) Source: https://github.com/0xalighieri/chroma/blob/main/README.md Configure the Chroma client's connection details, such as the host, API base path, and API version, in your Elixir application's configuration file. ```Elixir config :chroma, host: "http://localhost:8000", api_base: "api", api_version: "v1" ``` -------------------------------- ### Checking Chroma Database Version (Elixir) Source: https://github.com/0xalighieri/chroma/blob/main/README.md Verify the client's connection to the ChromaDB server by calling the `version` function from the `Chroma.Database` module. ```Elixir Chroma.Database.version ``` -------------------------------- ### Querying Chroma Collection (Elixir) Source: https://github.com/0xalighieri/chroma/blob/main/README.md Query a Chroma collection using the `query` function. Provide a list of query embeddings and optionally include `where` and `where_document` clauses to filter results based on metadata or document content. ```Elixir Chroma.Collection.query(collection, %{ embeddings: query_embeddings, query_embeddings: query_embeddings, where: %{"metadata_field": "is_equal_to_this"}, where_document: %{"\$contains" => "search_string"} } ) ``` -------------------------------- ### Adding Data to Chroma Collection (Elixir) Source: https://github.com/0xalighieri/chroma/blob/main/README.md Add documents, their corresponding embeddings, metadata, and unique IDs to a specified Chroma collection using the `add` function. Embeddings are assumed to be generated externally. ```Elixir {:ok, collection} = Chroma.Collection.get_or_create("my_collection", %{type: "Text"}) Chroma.Collection.add(collection, %{ embeddings: embeddings, documents: documents, metadata: metadata, ids: ids } ) ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.