Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
BlackyDrum authored Jun 16, 2024
1 parent 42d7e67 commit 6119873
Showing 1 changed file with 73 additions and 5 deletions.
78 changes: 73 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -420,25 +420,93 @@ int main()
}
```

We currently supports `JinaEmbeddingFunction` and `OpenAIEmbeddingFunction` for this purpose.
We currently supports `JinaEmbeddingFunction`, `OpenAIEmbeddingFunction`, `CohereEmbeddingFunction`, `VoyageAIEmbeddingFunction` and `TogetherAIEmbeddingFunction` for this purpose.

**JinaEmbeddingFunction**
```cpp
#include "ChromaDB/ChromaDB.h"

int main()
{
std::shared_ptr<chromadb::OpenAIEmbeddingFunction> openaiEmbeddingFunction = std::make_shared<chromadb::OpenAIEmbeddingFunction>("openai-api-key");
std::shared_ptr<chromadb::JinaEmbeddingFunction> jinaEmbeddingFunction = std::make_shared<chromadb::JinaEmbeddingFunction>("jina-api-key");
}
```

**Parameters**
- **apiKey**: The API key to access the API.
- **model**: (Optional) The model to use for generating embeddings. Defaults to "text-embedding-3-small" or "jina-embeddings-v2-base-en".
- **baseUrl**: (Optional) The base URL of the API server. Defaults to "api.openai.com" or "api.jina.ai".
- **model**: (Optional) The model to use for generating embeddings. Defaults to "jina-embeddings-v2-base-en".
- **baseUrl**: (Optional) The base URL of the API server. Defaults to "api.jina.ai".
- **path**: (Optional) The path of the endpoint for generating embeddings. Defaults to "/v1/embeddings".

> Note: You can get started immediately by obtaining a free Jina API Key [here](https://jina.ai/embeddings/#apiform)
> Note: You can get started immediately by obtaining a free Jina API Key with 1M Tokens [here](https://jina.ai/embeddings/#apiform)
**OpenAIEmbeddingFunction**
```cpp
#include "ChromaDB/ChromaDB.h"

int main()
{
std::shared_ptr<chromadb::OpenAIEmbeddingFunction> openAIEmbeddingFunction = std::make_shared<chromadb::OpenAIEmbeddingFunction>("openai-api-key");
}
```

**Parameters**
- **apiKey**: The API key to access the API.
- **model**: (Optional) The model to use for generating embeddings. Defaults to "text-embedding-3-small".
- **dimensions**: (Optional) The number of dimensions of the embeddings. Defaults to 1536.
- **baseUrl**: (Optional) The base URL of the API server. Defaults to "api.openai.com".
- **path**: (Optional) The path of the endpoint for generating embeddings. Defaults to "/v1/embeddings".

**CohereEmbeddingFunction**
```cpp
#include "ChromaDB/ChromaDB.h"

int main()
{
std::shared_ptr<chromadb::CohereEmbeddingFunction> cohereEmbeddingFunction = std::make_shared<chromadb::CohereEmbeddingFunction>("cohere-api-key");
}
```

**Parameters**
- **apiKey**: The API key to access the API.
- **model**: (Optional) The model to use for generating embeddings. Defaults to "embed-english-v3.0".
- **inputType**: (Optional) The input type passed to the model. Defaults to "classification".
- **baseUrl**: (Optional) The base URL of the API server. Defaults to "api.cohere.com".
- **path**: (Optional) The path of the endpoint for generating embeddings. Defaults to "/v1/embed".


**VoyageAIEmbeddingFunction**
```cpp
#include "ChromaDB/ChromaDB.h"

int main()
{
std::shared_ptr<chromadb::VoyageAIEmbeddingFunction> voyageAIEmbeddingFunction = std::make_shared<chromadb::VoyageAIEmbeddingFunction>("voyageai-api-key");
}
```

**Parameters**
- **apiKey**: The API key to access the API.
- **model**: (Optional) The model to use for generating embeddings. Defaults to "voyage-2".
- **inputType**: (Optional) The input type passed to the model. Defaults to "document".
- **baseUrl**: (Optional) The base URL of the API server. Defaults to "api.voyageai.com".
- **path**: (Optional) The path of the endpoint for generating embeddings. Defaults to "/v1/embeddings".

**TogetherAIEmbeddingFunction**
```cpp
#include "ChromaDB/ChromaDB.h"

int main()
{
std::shared_ptr<chromadb::TogetherAIEmbeddingFunction> togetherAIEmbeddingFunction = std::make_shared<chromadb::TogetherAIEmbeddingFunction>("togetherai-api-key");
}
```

**Parameters**
- **apiKey**: The API key to access the API.
- **model**: (Optional) The model to use for generating embeddings. Defaults to "togethercomputer/m2-bert-80M-8k-retrieval".
- **baseUrl**: (Optional) The base URL of the API server. Defaults to "api.together.xyz".
- **path**: (Optional) The path of the endpoint for generating embeddings. Defaults to "/v1/embeddings".

### Get Embeddings from a Collection
To retrieve embeddings from an existing collection in ChromaDB, use the `GetEmbeddings` method. This method allows you to specify the collection, optional IDs of the embeddings, and optional filters and fields to include in the result.
Expand Down

0 comments on commit 6119873

Please sign in to comment.