Create a free pod index in Pinecone using Python

Pinecone documentation is quite good, but when I wanted to create a free pod index in Pinecone using Python I didn’t know what parameters I should supply.

Specifically, I couldn’t understand what values would be the values for environment and pod_type

After a bit of digging (looking at the WebUI) here is how to do it

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
from pinecone import Pinecone, PodSpec
pc = Pinecone(api_key='<<PINECONE_API_KEY>>')
pc.create_index(
name="example-index",
dimension=1536,
metric="cosine",
spec=PodSpec(
environment='gcp-starter',
pod_type='s1.x1'
)
)
from pinecone import Pinecone, PodSpec pc = Pinecone(api_key='<<PINECONE_API_KEY>>') pc.create_index( name="example-index", dimension=1536, metric="cosine", spec=PodSpec( environment='gcp-starter', pod_type='s1.x1' ) )
from pinecone import Pinecone, PodSpec

pc = Pinecone(api_key='<<PINECONE_API_KEY>>')
pc.create_index(
    name="example-index", 
    dimension=1536, 
    metric="cosine", 
    spec=PodSpec(
        environment='gcp-starter', 
        pod_type='s1.x1'
    )
)

More posts related to my AI journey:

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.