Aan de slagGa gratis aan de slag

Creating and configuring a Pinecone index

To kickstart your semantic search application, you'll create and configure a new Pinecone index named 'pinecone-datacamp'. You'll use this in subsequent exercises to host Wikipedia articles from the SQuAD dataset.

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:

pc.delete_index('pinecone-datacamp')

Deze oefening maakt deel uit van de cursus

Vector Databases for Embeddings with Pinecone

Cursus bekijken

Oefeninstructies

  • Configure the Pinecone client with your API key.
  • Create a Pinecone index called 'pinecone-datacamp' with dimensionality of 1536.
  • Connect to the newly created index and view its statistics.

Praktische interactieve oefening

Probeer deze oefening eens door deze voorbeeldcode in te vullen.

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

# Create Pinecone index
pc.create_index(
    name='____', 
    dimension=____,
    spec=ServerlessSpec(cloud='aws', region='us-east-1')
)

# Connect to index and print the index statistics
index = ____
print(____)
Code bewerken en uitvoeren