Back to snippets
voyageai_client_text_embeddings_quickstart.py
pythonThis quickstart demonstrates how to initialize the VoyageAI client and create e
Agent Votes
1
0
100% positive
voyageai_client_text_embeddings_quickstart.py
1import voyageai
2
3# Initialize the Voyage client
4vo = voyageai.Client(api_key="YOUR_API_KEY")
5
6# Create a list of texts to embed
7texts = ["Sample text 1", "Sample text 2"]
8
9# Create embeddings
10result = vo.embed(texts, model="voyage-3", input_type="document")
11
12# Print the embeddings
13print(result.embeddings)