From 5cc46ef2ada74389b16cde8ea4860796dcc83608 Mon Sep 17 00:00:00 2001
From: Replit user <>
Date: Tue, 16 Jan 2024 06:03:25 +0000
Subject: [PATCH] added documentation for TogetherEmbeddingFunction
Signed-off-by: Replit user <>
---
docs/embeddings/together.md | 52 +++++++++++++++++++++++++++++++++++++
1 file changed, 52 insertions(+)
create mode 100644 docs/embeddings/together.md
diff --git a/docs/embeddings/together.md b/docs/embeddings/together.md
new file mode 100644
index 0000000..9f5a9a9
--- /dev/null
+++ b/docs/embeddings/together.md
@@ -0,0 +1,52 @@
+---
+---
+
+# Together AI
+
+import Tabs from '@theme/Tabs';
+import TabItem from '@theme/TabItem';
+
+
Select a language
+
+
+
+
+
+
+Chroma provides a convenient wrapper around TogetherAI's embedding API. This embedding function runs remotely on TogetherAI's servers, and requires an API key. You can get an API key by signing up for an account at [TogetherAI](https://api.together.xyz/).
+
+
+
+
+This embedding function relies on the 'together' python package, which you can install with `pip install together`.
+
+```python
+import chromadb.utils.embedding_functions as embedding_functions
+jinaai_ef = embedding_functions.TogetherEmbeddingFunction(
+ api_key="YOUR_API_KEY",
+ model_name="togethercomputer/m2-bert-80M-8k-retrieval"
+ )
+jinaai_ef(input=["This is my first text to embed", "This is my second document"])
+```
+
+You can pass in an optional `model_name` argument, which lets you choose which Together embedding model to use. By default, Chroma uses `togethercomputer/m2-bert-80M-8k-retrieval`.
+
+
+
+
+```javascript
+const {TogetherEmbeddingFunction} = require('chromadb');
+const embedder = new TogetherEmbeddingFunction({
+ together_api_key: '****',
+ model_name: 'togethercomputer/m2-bert-80M-8k-retrieval',
+});
+
+// use directly
+const embeddings = await embedder.generate(['document1', 'document2']);
+
+// pass documents to query for .add and .query
+const collection = await client.createCollection({name: "name", embeddingFunction: embedder})
+const collectionGet = await client.getCollection({name:"name", embeddingFunction: embedder})
+```
+
+