hi,
Can some one help me when i am trying pinecone i am getting this error message "NameError: name 'PodSpec' is not defined"
for the code pc = Pinecone(api_key=PINECONE_API_KEY)
if USE_SERVERLESS:
spec = ServerlessSpec(cloud='aws', region='us-west-2')
else:
# Ensure PINECONE_ENV is set for non-serverless configurations
if not PINECONE_ENV:
raise ValueError("PINECONE_ENV must be set when not using serverless configuration.")
spec = PodSpec(environment=PINECONE_ENV)
# Define the index name
index_name = "stre"
# Check if index already exists
if index_name not in pc.list_indexes().names():
# If it does not exist, create index
pc.create_index(
name=index_name,
dimension=1536, # dimensionality of text-embedding-ada-002
metric='cosine',
spec=spec
)
# Wait for index to be initialized
time.sleep(1)
# Connect to index
index = pc.Index(index_name)
index.describe_index_stats().
Thank you