Skip to content

Commit

Permalink
feature: Introducing VoyageAI (#1871)
Browse files Browse the repository at this point in the history
* Introducing VoyageAI's embedding models

* Adding back the whitespaces

* Adding the whitespaces back
  • Loading branch information
fzowl authored Jan 16, 2025
1 parent cc129a0 commit 3fecde4
Show file tree
Hide file tree
Showing 4 changed files with 34 additions and 0 deletions.
1 change: 1 addition & 0 deletions docs/concepts/knowledge.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -288,6 +288,7 @@ The `embedder` parameter supports various embedding model providers that include
- `ollama`: Local embeddings with Ollama
- `vertexai`: Google Cloud VertexAI embeddings
- `cohere`: Cohere's embedding models
- `voyageai`: VoyageAI's embedding models
- `bedrock`: AWS Bedrock embeddings
- `huggingface`: Hugging Face models
- `watson`: IBM Watson embeddings
Expand Down
20 changes: 20 additions & 0 deletions docs/concepts/memory.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -293,6 +293,26 @@ my_crew = Crew(
}
)
```
### Using VoyageAI embeddings

```python Code
from crewai import Crew, Agent, Task, Process

my_crew = Crew(
agents=[...],
tasks=[...],
process=Process.sequential,
memory=True,
verbose=True,
embedder={
"provider": "voyageai",
"config": {
"api_key": "YOUR_API_KEY",
"model_name": "<model_name>"
}
}
)
```
### Using HuggingFace embeddings

```python Code
Expand Down
1 change: 1 addition & 0 deletions docs/how-to/llm-connections.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ LiteLLM supports a wide range of providers, including but not limited to:
- Azure OpenAI
- AWS (Bedrock, SageMaker)
- Cohere
- VoyageAI
- Hugging Face
- Ollama
- Mistral AI
Expand Down
12 changes: 12 additions & 0 deletions src/crewai/utilities/embedding_configurator.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ def __init__(self):
"vertexai": self._configure_vertexai,
"google": self._configure_google,
"cohere": self._configure_cohere,
"voyageai": self._configure_voyageai,
"bedrock": self._configure_bedrock,
"huggingface": self._configure_huggingface,
"watson": self._configure_watson,
Expand Down Expand Up @@ -124,6 +125,17 @@ def _configure_cohere(config, model_name):
api_key=config.get("api_key"),
)

@staticmethod
def _configure_voyageai(config, model_name):
from chromadb.utils.embedding_functions.voyageai_embedding_function import (
VoyageAIEmbeddingFunction,
)

return VoyageAIEmbeddingFunction(
model_name=model_name,
api_key=config.get("api_key"),
)

@staticmethod
def _configure_bedrock(config, model_name):
from chromadb.utils.embedding_functions.amazon_bedrock_embedding_function import (
Expand Down

0 comments on commit 3fecde4

Please sign in to comment.