You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat: Add support for Chroma's Database feature. (#16)
* Add support for Chroma's Database feature.
Different collections can be in different databases. Passing the
optional database argument at client creation time binds the client to
the appropriate database.
* Fix doctest example
* chore: Review updates
Signed-off-by: Anush008 <[email protected]>
* docs: nit update README.md
Signed-off-by: Anush008 <[email protected]>
---------
Co-authored-by: Anush008 <[email protected]>
@@ -62,7 +60,7 @@ let collection_uuid = collection.id();
62
60
println!("Collection UUID: {}", collection_uuid);
63
61
```
64
62
65
-
### With a collection instance, we can perform queries on the database
63
+
### With a collection instance, we can perform queries on the database
66
64
67
65
```rust
68
66
// Upsert some embeddings with documents and no metadata.
@@ -81,7 +79,7 @@ let result: bool = collection.upsert(collection_entries, None).await?;
81
79
// Create a filter object to filter by document content.
82
80
letwhere_document=json!({
83
81
"$contains":"Superman"
84
-
});
82
+
});
85
83
86
84
// Get embeddings from a collection with filters and limit set to 1.
87
85
// An empty IDs vec will return all embeddings.
@@ -97,10 +95,11 @@ let get_result: GetResult = collection.get(get_query).await?;
97
95
println!("Get result: {:?}", get_result);
98
96
99
97
```
100
-
Find more information about the available filters and options in the [get()](https://docs.rs/chromadb/latest/chromadb/v1/collection/struct.ChromaCollection.html#method.get) documentation.
101
98
99
+
Find more information about the available filters and options in the [get()](https://docs.rs/chromadb/latest/chromadb/v1/collection/struct.ChromaCollection.html#method.get) documentation.
102
100
103
101
### Performing a similarity search
102
+
104
103
```rust
105
104
//Instantiate QueryOptions to perform a similarity search on the collection
106
105
//Alternatively, an embedding_function can also be provided with query_texts to perform the search
@@ -117,7 +116,8 @@ let query_result: QueryResult = collection.query(query, None).await?;
117
116
println!("Query result: {:?}", query_result);
118
117
```
119
118
120
-
### Support for Embedding providers
119
+
### Support for Embedding providers
120
+
121
121
This crate has built-in support for OpenAI and SBERT embeddings.
122
122
123
123
To use [OpenAI](https://platform.openai.com/docs/guides/embeddings) embeddings, enable the `openai` feature in your Cargo.toml.
0 commit comments