Back to Llama Index

MistralAI Embeddings

docs/examples/embeddings/mistralai.ipynb

0.14.21895 B
Original Source

<a href="https://colab.research.google.com/github/run-llama/llama_index/blob/main/docs/examples/embeddings/mistralai.ipynb" target="_parent"></a>

MistralAI Embeddings

If you're opening this Notebook on colab, you will probably need to install LlamaIndex 🦙.

python
%pip install llama-index-embeddings-mistralai
python
!pip install llama-index
python
# imports
from llama_index.embeddings.mistralai import MistralAIEmbedding
python
# get API key and create embeddings
api_key = "YOUR API KEY"
model_name = "mistral-embed"
embed_model = MistralAIEmbedding(model_name=model_name, api_key=api_key)

embeddings = embed_model.get_text_embedding("La Plateforme - The Platform")
python
print(f"Dimension of embeddings: {len(embeddings)}")
python
embeddings[:5]