LoslegenKostenlos loslegen

Querying namespaces

Now that you've created separate namespaces and embraced multitenancy, it's time to reap the rewards! In this exercise, you'll query one of these new namespaces to search through only a segment of your full index.

Diese Übung ist Teil des Kurses

Vector Databases for Embeddings with Pinecone

Kurs anzeigen

Anleitung zur Übung

  • Initialize the Pinecone connection with your API key.
  • Query "namespace1" using the vector provided, returning the top three results.

Interaktive Übung

Vervollständige den Beispielcode, um diese Übung erfolgreich abzuschließen.

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

index = pc.Index('datacamp-index')

# Query namespace1 with the vector provided
query_result = ____
print(query_result)
Code bearbeiten und ausführen