mirror of
https://github.com/crewAIInc/crewAI.git
synced 2026-01-10 00:28:31 +00:00
feature: Introducing VoyageAI (#1871)
* Introducing VoyageAI's embedding models * Adding back the whitespaces * Adding the whitespaces back
This commit is contained in:
@@ -288,6 +288,7 @@ The `embedder` parameter supports various embedding model providers that include
|
|||||||
- `ollama`: Local embeddings with Ollama
|
- `ollama`: Local embeddings with Ollama
|
||||||
- `vertexai`: Google Cloud VertexAI embeddings
|
- `vertexai`: Google Cloud VertexAI embeddings
|
||||||
- `cohere`: Cohere's embedding models
|
- `cohere`: Cohere's embedding models
|
||||||
|
- `voyageai`: VoyageAI's embedding models
|
||||||
- `bedrock`: AWS Bedrock embeddings
|
- `bedrock`: AWS Bedrock embeddings
|
||||||
- `huggingface`: Hugging Face models
|
- `huggingface`: Hugging Face models
|
||||||
- `watson`: IBM Watson embeddings
|
- `watson`: IBM Watson embeddings
|
||||||
|
|||||||
@@ -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
|
### Using HuggingFace embeddings
|
||||||
|
|
||||||
```python Code
|
```python Code
|
||||||
|
|||||||
@@ -23,6 +23,7 @@ LiteLLM supports a wide range of providers, including but not limited to:
|
|||||||
- Azure OpenAI
|
- Azure OpenAI
|
||||||
- AWS (Bedrock, SageMaker)
|
- AWS (Bedrock, SageMaker)
|
||||||
- Cohere
|
- Cohere
|
||||||
|
- VoyageAI
|
||||||
- Hugging Face
|
- Hugging Face
|
||||||
- Ollama
|
- Ollama
|
||||||
- Mistral AI
|
- Mistral AI
|
||||||
|
|||||||
@@ -14,6 +14,7 @@ class EmbeddingConfigurator:
|
|||||||
"vertexai": self._configure_vertexai,
|
"vertexai": self._configure_vertexai,
|
||||||
"google": self._configure_google,
|
"google": self._configure_google,
|
||||||
"cohere": self._configure_cohere,
|
"cohere": self._configure_cohere,
|
||||||
|
"voyageai": self._configure_voyageai,
|
||||||
"bedrock": self._configure_bedrock,
|
"bedrock": self._configure_bedrock,
|
||||||
"huggingface": self._configure_huggingface,
|
"huggingface": self._configure_huggingface,
|
||||||
"watson": self._configure_watson,
|
"watson": self._configure_watson,
|
||||||
@@ -124,6 +125,17 @@ class EmbeddingConfigurator:
|
|||||||
api_key=config.get("api_key"),
|
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
|
@staticmethod
|
||||||
def _configure_bedrock(config, model_name):
|
def _configure_bedrock(config, model_name):
|
||||||
from chromadb.utils.embedding_functions.amazon_bedrock_embedding_function import (
|
from chromadb.utils.embedding_functions.amazon_bedrock_embedding_function import (
|
||||||
|
|||||||
Reference in New Issue
Block a user