Skip to content

Commit 85622b1

Browse files
authored
[DOC] Fix mistakes in examples (#5839)
## Description of changes _Summarize the changes made by this PR._ - Improvements & Bug fixes - #5828 - New functionality - N/A ## Test plan _How are these changes tested?_ - [ ] Tests pass locally with `pytest` for python, `yarn test` for js, `cargo test` for rust ## Migration plan _Are there any migrations, or any forwards/backwards compatibility changes needed in order to make sure this change deploys reliably?_ ## Observability plan _What is the plan to instrument and monitor this change?_ ## Documentation Changes _Are all docstrings for user-facing APIs updated if required? Do we need to make documentation changes in the [docs section](https://github.com/chroma-core/chroma/tree/main/docs/docs.trychroma.com)?_
1 parent d4ef15c commit 85622b1

File tree

4 files changed

+8
-6
lines changed

4 files changed

+8
-6
lines changed

docs/docs.trychroma.com/markdoc/content/cloud/schema/schema-basics.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -207,7 +207,8 @@ schema.create_index(
207207

208208
{% Tab label="typescript" %}
209209
```typescript
210-
import { Schema, SparseVectorIndexConfig, ChromaCloudSpladeEmbeddingFunction, K } from 'chromadb';
210+
import { Schema, SparseVectorIndexConfig, K } from 'chromadb';
211+
import { ChromaCloudSpladeEmbeddingFunction } from '@chroma-core/chroma-cloud-splade';
211212

212213
const schema = new Schema();
213214

docs/docs.trychroma.com/markdoc/content/cloud/schema/sparse-vector-search.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,8 @@ schema.create_index(
4545

4646
{% Tab label="typescript" %}
4747
```typescript
48-
import { Schema, SparseVectorIndexConfig, ChromaCloudSpladeEmbeddingFunction, K } from 'chromadb';
48+
import { Schema, SparseVectorIndexConfig, K } from 'chromadb';
49+
import { ChromaCloudSpladeEmbeddingFunction } from '@chroma-core/chroma-cloud-splade';
4950

5051
const schema = new Schema();
5152

docs/docs.trychroma.com/markdoc/content/cloud/search-api/overview.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ const result = await collection.search(search.rank(Knn({ query: queryEmbedding }
6565

6666
// Option 2: Pass text query (embedding created using collection's schema configuration)
6767
const queryText = "What are the latest advances in quantum computing?";
68-
result = await collection.search(search.rank(Knn({ query: queryText })));
68+
const result2 = await collection.search(search.rank(Knn({ query: queryText })));
6969
```
7070
{% /Tab %}
7171

docs/docs.trychroma.com/markdoc/content/cloud/search-api/search-basics.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -191,14 +191,14 @@ search = Search(rank=Knn(query="artificial intelligence"))
191191

192192
{% Tab label="typescript" %}
193193
```typescript
194-
import { Search, K, Knn, Limit, Select } from 'chromadb';
194+
import { Search, K, Knn } from 'chromadb';
195195

196196
// With expression objects
197197
const search1 = new Search({
198198
where: K("status").eq("active"),
199199
rank: Knn({ query: "latest research papers" }),
200-
limit: new Limit({ limit: 10, offset: 0 }),
201-
select: new Select([K.DOCUMENT, K.SCORE])
200+
limit: { limit: 10, offset: 0 },
201+
select: [K.DOCUMENT, K.SCORE]
202202
});
203203

204204
// With dictionaries (MongoDB-style)

0 commit comments

Comments
 (0)