Ingesting vectors with metadata
It's ingesting time! You'll be ingesting vectors
, which is a list of dictionaries containing the vector values, IDs, and associated metadata. They're already been provided in a format that can be directly inserted into the index without further manipulation.
Here's another reminder about the structure of vectors
.
vectors = [
{
"id": "0",
"values": [0.025525547564029694, ..., 0.0188823901116848]
"metadata": {"genre": "action", "year": 2024}
},
...,
]
Cet exercice fait partie du cours
Vector Databases for Embeddings with Pinecone
Instructions
- Initialize the Pinecone connection with your API key.
- Connect to your index called
"datacamp-index"
. - Upsert
vectors
to the index. - Print the index's descriptive statistics.
Exercice interactif pratique
Essayez cet exercice en complétant cet exemple de code.
# Initialize the Pinecone client with your API key
pc = Pinecone(api_key="____")
# Connect to your index
index = pc.____("datacamp-index")
# Ingest the vectors and metadata
____
# Print the index statistics
print(____)