Release v5.0.0
Features
API versioning
This updated release of the Pinecone Python SDK depends on API version 2024-07
. This v5 SDK release line should continue to receive fixes as long as the 2024-07
API version is in support.
Inference API
Try out Pinecone's new Inference API, currently in public preview.
from pinecone import Pinecone
pc = Pinecone(api_key="YOUR_API_KEY")
model = "multilingual-e5-large"
# Embed documents
text = [
"Turkey is a classic meat to eat at American Thanksgiving.",
"Many people enjoy the beautiful mosques in Turkey.",
]
text_embeddings = pc.inference.embed(
model=model,
inputs=text,
parameters={"input_type": "passage", "truncate": "END"},
)
If you were previously using the pinecone-plugin-inference
plugin package to gain access to this feature with the v4 SDK, you no longer need to install the plugin as it is being included by default.
Deletion Protection
Use deletion protection to prevent your most important indexes from accidentally being deleted. This feature is available for both serverless and pod indexes.
To enable this feature for existing indexes, use configure_index
from pinecone import Pinecone
pc = Pinecone(api_key='YOUR_API_KEY')
# Enable deletion protection
pc.configure_index(name='example-index', deletion_protection='enabled')
When deletion protection is enabled, calls to delete_index
will fail until you first disable the deletion protection.
# To disable deletion protection
pc.configure_index(name='example-index', deletion_protection='disabled')
If you want to enable this feature at the time of index creation, create_index
now accepts an optional keyword argument. The feature is disabled by default.
from pinecone import Pinecone, ServerlessSpec
pc = Pinecone(api_key='YOUR_API_KEY')
pc.create_index(
name='example-index',
dimension=1024,
metric='cosine',
deletion_protection='enabled',
spec=ServerlessSpec(cloud='aws', region='us-west-2')
)
Fixes
- This release resolves a problem that occurred when listing or describing a collection having dimension > 2000. Closes issue #366. Thank you to @drivard for reporting this issue.
- Several dependencies (certifi, urllib3, pdoc) received minor bumps to resolve security notices. #365
Breaking changes
As part of an overall move to stop exposing generated code in the package's public interface, an obscure configuration property (openapi_config
) was removed in favor of individual configuration options such as proxy_url
, proxy_headers
, and ssl_ca_certs
. All of these properties were available in v3 and v4 releases of the SDK, with deprecation notices shown to affected users.
Full Changelog: v4.1.2...v5.0.0