Voyage Embeddings¶
If you're opening this Notebook on colab, you will probably need to install LlamaIndex 🦙.
In [ ]:
Copied!
%pip install llama-index-embeddings-voyageai
%pip install llama-index-embeddings-voyageai
In [ ]:
Copied!
!pip install llama-index
!pip install llama-index
In [ ]:
Copied!
# imports
import os
from llama_index.embeddings.voyageai import VoyageEmbedding
# imports
import os
from llama_index.embeddings.voyageai import VoyageEmbedding
In [ ]:
Copied!
# get API key and create embeddings
model_name = "voyage-3" # Please check https://docs.voyageai.com/docs/embeddings for the available models
voyage_api_key = os.environ.get("VOYAGE_API_KEY", "your-api-key")
embed_model = VoyageEmbedding(
model_name=model_name, voyage_api_key=voyage_api_key
)
embeddings = embed_model.get_query_embedding("What is llamaindex?")
# get API key and create embeddings
model_name = "voyage-3" # Please check https://docs.voyageai.com/docs/embeddings for the available models
voyage_api_key = os.environ.get("VOYAGE_API_KEY", "your-api-key")
embed_model = VoyageEmbedding(
model_name=model_name, voyage_api_key=voyage_api_key
)
embeddings = embed_model.get_query_embedding("What is llamaindex?")