diff --git a/docs/docs.trychroma.com/markdoc/content/docs/overview/getting-started.md b/docs/docs.trychroma.com/markdoc/content/docs/overview/getting-started.md index 1885977df38..81848b3f029 100644 --- a/docs/docs.trychroma.com/markdoc/content/docs/overview/getting-started.md +++ b/docs/docs.trychroma.com/markdoc/content/docs/overview/getting-started.md @@ -278,12 +278,25 @@ print(results) {% Tab label="typescript" %} ```typescript -import { ChromaClient } from "chromadb"; +import { ChromaClient, OpenAIEmbeddingFunction, OllamaEmbeddingFunction } from "chromadb"; + +// using OpenAI mmbedding +const embedder = new OpenAIEmbeddingFunction({ + openai_api_key: "your_api_key", +}); + +// using ollama embedding +const embedder = new OllamaEmbeddingFunction({ + url: "http://127.0.0.1:11434/api/embeddings", + model: "llama2" +}) + const client = new ChromaClient(); // switch `createCollection` to `getOrCreateCollection` to avoid creating a new collection every time const collection = await client.getOrCreateCollection({ name: "my_collection", + embeddingFunction: embedder, }); // switch `addRecords` to `upsertRecords` to avoid adding the same documents every time