Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

community: #2

Draft
wants to merge 2 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions libs/community/langchain_community/embeddings/voyageai.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,12 +69,12 @@ class VoyageEmbeddings(BaseModel, Embeddings):

from langchain_community.embeddings import VoyageEmbeddings

voyage = VoyageEmbeddings(voyage_api_key="your-api-key")
voyage = VoyageEmbeddings(voyage_api_key="your-api-key", model="voyage-2")
text = "This is a test query."
query_result = voyage.embed_query(text)
"""

model: str = "voyage-01"
model: str
voyage_api_base: str = "https://api.voyageai.com/v1/embeddings"
voyage_api_key: Optional[SecretStr] = None
batch_size: int = 8
Expand Down Expand Up @@ -121,7 +121,7 @@ def _get_embeddings(
embeddings: List[List[float]] = []

if batch_size is None:
batch_size = self.batch_size
batch_size = 72 if self.model in ["voyage-2", "voyage-02"] else 7

if self.show_progress_bar:
try:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
from langchain_community.embeddings.voyageai import VoyageEmbeddings

# Please set VOYAGE_API_KEY in the environment variables
MODEL = "voyage-01"
MODEL = "voyage-2"


def test_voyagi_embedding_documents() -> None:
Expand Down