Skip to content
This repository was archived by the owner on May 10, 2024. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion docs/api-reference.md
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,12 @@ Run `chroma run --path /db_path` to run the Chroma backend as a standalone serve
## Initialize client - JS

```javascript
import { ChromaClient } from "chromadb";
// CJS
const { ChromaClient } = require("chromadb");

// ESM
import { ChromaClient } from 'chromadb'

const client = new ChromaClient();
```

Expand Down
16 changes: 16 additions & 0 deletions docs/embeddings.md
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,13 @@ openai_ef = embedding_functions.OpenAIEmbeddingFunction(
<TabItem value="js" label="JavaScript">

```javascript
//CJS
const {OpenAIEmbeddingFunction} = require('chromadb');

//ESM
import {OpenAIEmbeddingFunction} from 'chromadb'


const embedder = new OpenAIEmbeddingFunction({openai_api_key: "apiKey"})

// use directly
Expand Down Expand Up @@ -172,7 +178,12 @@ cohere_ef(texts=["document1","document2"])
<TabItem value="js" label="JavaScript">

```javascript
//CJS
const {CohereEmbeddingFunction} = require('chromadb');

//ESM
import {CohereEmbeddingFunction} from 'chromadb'

const embedder = new CohereEmbeddingFunction("apiKey")

// use directly
Expand Down Expand Up @@ -215,7 +226,12 @@ cohere_ef(texts=multilingual_texts)
<TabItem value="js" label="JavaScript">

```javascript
//CJS
const {CohereEmbeddingFunction} = require('chromadb');

//ESM
import {CohereEmbeddingFunction} from 'chromadb'

const embedder = new CohereEmbeddingFunction("apiKey")

multilingual_texts = [ 'Hello from Cohere!', 'مرحبًا من كوهير!',
Expand Down
10 changes: 10 additions & 0 deletions docs/getting-started.md
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,12 @@ chroma run --path /db_path
Then create a client which connects to it:

```js
// CJS
const { ChromaClient } = require("chromadb");

// ESM
import { ChromaClient } from 'chromadb'

const client = new ChromaClient();
```

Expand Down Expand Up @@ -98,7 +103,12 @@ Please take steps to secure your API when interacting with frontend systems.
:::

```js
// CJS
const { OpenAIEmbeddingFunction } = require("chromadb");

// ESM
import { OpenAIEmbeddingFunction } from 'chromadb'

const embedder = new OpenAIEmbeddingFunction({
openai_api_key: "your_api_key",
});
Expand Down
19 changes: 16 additions & 3 deletions docs/usage-guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,11 @@ Having many clients that are loading and saving to the same path can cause stran
<TabItem value="js" label="JavaScript">

```js
import { ChromaClient } from "chromadb";
// CJS
const { ChromaClient } = require("chromadb");

// ESM
import { ChromaClient } from 'chromadb'
```

:::note Connecting to the backend
Expand Down Expand Up @@ -153,7 +157,12 @@ chroma run --path /db_path
The JS client then talks to the chroma server backend.

```js
import { ChromaClient } from "chromadb";
// CJS
const { ChromaClient } = require("chromadb");

// ESM
import { ChromaClient } from 'chromadb'

const client = new ChromaClient();
```

Expand Down Expand Up @@ -196,7 +205,11 @@ The embedding function takes text as input, and performs tokenization and embedd
<TabItem value="js" label="JavaScript">

```js
import { ChromaClient } from "chromadb";
// CJS
const { ChromaClient } = require("chromadb");

// ESM
import { ChromaClient } from 'chromadb'
```

The JS client talks to a chroma server backend. This can run on your local computer or be easily deployed to AWS.
Expand Down