Files
AI/참고/neo4j-graphrag-python-main/examples/customize/embeddings/mistalai_embeddings.py

13 lines
354 B
Python
Raw Normal View History

2026-05-12 19:40:31 +09:00
"""This example demonstrate how to embed a text into a vector
using MistralAI models and API.
"""
from neo4j_graphrag.embeddings import MistralAIEmbeddings
# set api key here on in the MISTRAL_API_KEY env var
api_key = None
embeder = MistralAIEmbeddings(model="mistral-embed", api_key=api_key)
res = embeder.embed_query("my question")
print(res[:10])