mirror of
https://github.com/placeholder-soft/chroma.git
synced 2026-04-25 20:45:00 +08:00
## Description of changes Base PR to release sqlite refactor, which spans many stacked PRs. Remaining - [x] Merge this to main - [x] Layered Persistent Index #761 - [x] Remove old impls (In #781 ) - [x] Remove persist() API (In #787) - [x] Add telemetry to SegmentAPI, it was not included. (#788) - [x] New clients #805 - [x] locking and soak tests for thread-safety - [x] Migration tool - [x] Fix #739 - [x] Fix metadata None vs empty - [x] Fix persist directory (addressed in #761) - [x] Leave files open in #761 (merge stacked PR) Post Release - [ ] Un xfail cross version tests once we cut the release - [x] Documentation updates for new silent ADD failure. - [x] Update all documentation for new API instantiation - [x] Update all documentation for settings changes - [ ] Update terraform deployment - [ ] Update cloudformation deployment --------- Co-authored-by: Luke VanderHart <luke@vanderhart.net> Co-authored-by: Jeffrey Huber <jeff@trychroma.com> Co-authored-by: Anton Troynikov <atroyn@users.noreply.github.com> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Sebastian Sosa <37946988+CakeCrusher@users.noreply.github.com> Co-authored-by: Russell Pollari <russell@sharpestminds.com> Co-authored-by: russell-pollari <pollarir@mgail.com>
1.4 KiB
1.4 KiB
Chroma - the open-source embedding database.
This package is for the the Python HTTP client-only library for Chroma. This client connects to the Chroma Server. If that it not what you are looking for, you might want to check out the full library.
pip install chromadb-client # python http-client only library
To connect to your server and perform operations using the client only library, you can do the following:
import chromadb
# Example setup of the client to connect to your chroma server
client = chromadb.HttpClient(host="localhost", port=8000)
collection = client.create_collection("all-my-documents")
collection.add(
documents=["This is document1", "This is document2"],
metadatas=[{"source": "notion"}, {"source": "google-docs"}], # filter on these!
ids=["doc1", "doc2"], # unique for each doc
embeddings = [[1.2, 2.1, ...], [1.2, 2.1, ...]]
)
results = collection.query(
query_texts=["This is a query document"],
n_results=2,
# where={"metadata_field": "is_equal_to_this"}, # optional filter
# where_document={"$contains":"search_string"} # optional filter
)
