BaşlayınÜcretsiz Başlayın

Your first Pinecone index

With your Pinecone client initialized, you're all set to begin creating an index! Indexes are used to store records, including the vectors and associated metadata, as well as serving queries and other manipulations. As you progress through the course, you'll see how these different steps build up to a modern AI system built on a vector database.

If you accidentally create a valid index that doesn't meet the specifications detailed in the instructions, you'll need to add the following code before your .create_index() code to delete it and re-create it:

pc.delete_index('my-first-index')

The Pinecone class has already been imported for you.

Bu egzersiz

Vector Databases for Embeddings with Pinecone

kursunun bir parçasıdır
Kursu Görüntüle

Egzersiz talimatları

  • Import the ServerlessSpec class from pinecone.
  • Initialize the Pinecone connection using your API key.
  • Create a serverless index called "my-first-index" to hold vectors with 256 dimensions, and configure the index for the 'aws' cloud platform in the 'us-east-1' region.

Uygulamalı interaktif egzersiz

Bu örnek kodu tamamlayarak bu egzersizi bitirin.

# Import ServerlessSpec
from pinecone import ____

# Initialize the Pinecone client with your API key
pc = Pinecone(api_key="____")

# Create your Pinecone index
pc.____(
    name="____",
    dimension=____,
    spec=____(
        cloud='____'
        region='____'
    )
)
Kodu Düzenle ve Çalıştır