Skip to content
Snippets Groups Projects
Unverified Commit 1d84e719 authored by fzowl's avatar fzowl Committed by GitHub
Browse files

Use voyage-law-2 model in VoyageAI emaple code (#13029)

parent 55f3870d
Branches
Tags
No related merge requests found
%% Cell type:markdown id: tags:
<a href="https://colab.research.google.com/github/run-llama/llama_index/blob/main/docs/docs/examples/embeddings/voyageai.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a>
%% Cell type:markdown id: tags:
# Voyage Embeddings
%% Cell type:markdown id: tags:
If you're opening this Notebook on colab, you will probably need to install LlamaIndex 🦙.
%% Cell type:code id: tags:
``` python
%pip install llama-index-embeddings-voyageai
```
%% Cell type:code id: tags:
``` python
!pip install llama-index
```
%% Cell type:code id: tags:
``` python
# imports
import os
from llama_index.embeddings.voyageai import VoyageEmbedding
```
%% Cell type:code id: tags:
``` python
# get API key and create embeddings
model_name = "voyage-large-2" # Please check https://docs.voyageai.com/docs/embeddings for the available models
model_name = "voyage-law-2" # 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?")
```
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment