Skip to content

Releases: pinecone-io/pinecone-python-client

Release v5.3.1

19 Sep 20:49
Compare
Choose a tag to compare

What's Changed

  • [Fix] Add missing python-dateutil dependency by @jhamon in #391

Release v5.3.0

18 Sep 06:11
Compare
Choose a tag to compare

Public Preview: Imports

To learn more about working with imports and details about expected data formats, please see these documentation guides:

This release adds methods for interacting with several new endpoints in Public Preview from the Python SDK. Before you can use these, you will need to follow the above docs to prepare your data and configure any storage integrations.

import os
import random
from pinecone import Pinecone, ServerlessSpec, ImportErrorMode

# 0. Instantiate your client instance
pc = Pinecone(api_key=os.environ['PINECONE_API_KEY'])

# 1. You must have an index whose dimension matches the size of your data
#    You may already have such an index, but for this demo we will create one.
index_name = f"import-{random.randint(0, 10000)}"

if not pc.has_index(index_name):
  pc.create_index(
      name=index_name,
      dimension=10,
      metric="cosine",
      spec=ServerlessSpec(cloud="aws", region="eu-west-1")
  )

# 2. Get a reference to the index client
index = pc.Index(name=index_name)

# 3. Start the import operation, passing a uri that describes the path to your
#    AWS S3 bucket. Each subfolder within this path will correspond to a namespace
#    where imported data will be stored.
root = 's3://dev-bulk-import-datasets-pub/10-records-dim-10/'
op = index.start_import(
    uri=root,
    error_mode=ImportErrorMode.CONTINUE, # or ABORT
    # integration_id='' # Add this if you want to use a storage integration
  )

# 4. Check the operation status
index.describe_import(id=op.id)

# 5. Cancel an import operation
index.cancel_import(id=op.id)

# 6. List all recent operations using a generator that handles pagination on your behalf
for i in index.list_imports():
  print(f"id: {i.id} status: {i.status}")

# ...or turn the generator into a simple list, fetching all results at once
operations = list(index.list_imports())
print(operations)

Release v5.2.0

17 Sep 20:18
Compare
Choose a tag to compare

Public Preview: Rerank

This release adds a method for interacting with our Rerank endpoint, now in Public Preview. Rerank is used to order results by relevance to a query.

Currently rerank supports the bge-reranker-v2-m3 model. See the rerank guide for more information on using this feature.

from pinecone import Pinecone

pc = Pinecone(api_key="your api key")

query = "Tell me about Apple's products"

results = pc.inference.rerank(
    model="bge-reranker-v2-m3",
    query=query,
    documents=[
      "Apple is a popular fruit known for its sweetness and crisp texture.",
      "Apple is known for its innovative products like the iPhone.",
      "Many people enjoy eating apples as a healthy snack.",
      "Apple Inc. has revolutionized the tech industry with its sleek designs and user-friendly interfaces.",
      "An apple a day keeps the doctor away, as the saying goes.",
    ],
    top_n=3,
    return_documents=True,
)

print(query)
for r in results.data:
  print(r.score, r.document.text)

Gives output along these lines

Tell me about Apple's products
0.8401279 Apple is known for its innovative products like the iPhone.
0.23318209 Apple Inc. has revolutionized the tech industry with its sleek designs and user-friendly interfaces.
0.17384852 Apple is a popular fruit known for its sweetness and crisp texture.

Release v5.1.0

29 Aug 19:16
Compare
Choose a tag to compare

Package renamed from pinecone-client to pinecone

In this release, we have renamed the package from pinecone-client to pinecone. From now on you should install it using the pinecone name.

There is a plan to continue publishing code under the pinecone-client package as well so that anyone using the old name will still find out about available upgrades via their dependency management tool of choice, but we haven't automated that as part of our release process yet so there will be a slight delay in new work being released under that name.

New has_index() helper and improved output

We've added a small helper function to simplify a common need in notebooks and examples, which is checking if an index exists.

from pinecone import Pinecone, ServerlessSpec

pc = Pinecone(api_key='YOUR_API_KEY')

index_name = "movie-recommendations"

if not pc.has_index(index_name):
    pc.create_index(
        name=index_name,
        dimension=384,
        metric="cosine",
        spec=ServerlessSpec(cloud="aws", region="us-west-2")
    )

index = pc.Index(name=index_name)

# Now upsert vectors, run queries, etc

If you are frequently working in notebooks, you will also benefit from a nicer presentation of control plane responses.

>>> pc.describe_index(name="test-embed2")
{
    "name": "test-embed2",
    "dimension": 10,
    "metric": "cosine",
    "host": "test-embed2-dojoi3u.svc.apw5-4e34-81fa.pinecone.io",
    "spec": {
        "serverless": {
            "cloud": "aws",
            "region": "us-west-2"
        }
    },
    "status": {
        "ready": true,
        "state": "Ready"
    },
    "deletion_protection": "disabled"
}

What's Changed

  • [Docs] Fix dataframe column name in doc strings by @jseldess in #381
  • [Docs] Change "client" to "SDK" in README by @jseldess in #382
  • [Chore] Adding new issue templates by @anawishnoff in #380
  • [Chore] Reduce dimension in testing to simplify output by @jhamon in #384
  • [Chore] Rename package from pinecone-client to pinecone by @jhamon in #383
  • [Feature] Add has_index() by @rohanshah18 in #385
  • [Feature] Improve output from list/describe actions on indexes and collections by @jhamon in #387

New Contributors

Full Changelog: v5.0.1...v5.1.0

Release v5.0.1

01 Aug 20:58
Compare
Choose a tag to compare

What's Changed

  • [CI] Publish doc updates after each release by @jhamon in #373
  • [Fix] Fetch when vector id string contains spaces by @jhamon in #372
  • [Fix] Adjusting inference plugin dependency to resolve circular dependency by @jhamon @ssmith-pc in #379 #377

Full Changelog: v5.0.0...v5.0.1

Release v5.0.0

19 Jul 18:03
Compare
Choose a tag to compare

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

Release v4.1.2

03 Jul 19:42
Compare
Choose a tag to compare

Fixes

  • do not override port if defined in host by @haruska in #362

Chores

New Contributors

Full Changelog: v4.1.1...v4.1.2

Release v4.1.1

06 Jun 08:11
701f6b6
Compare
Choose a tag to compare

Fixes

Dependabot security updates

  • Bump requests (dev-only dependency) from 2.31.0 to 2.32.3 by @jhamon in #352

Chores

Full Changelog: v4.1.0...v4.1.1

Release v4.1.0

13 May 22:40
Compare
Choose a tag to compare

Features

  • Support proxy_url and ssl_ca_certs options for gRPC by @daverigby in #341
  • Add better error messages for mistaken from_texts and from_documents invocations by @jhamon in #342

Dependabot security fixes

Full Changelog: v4.0.0...v4.1.0

Release v4.0.0

01 May 06:34
Compare
Choose a tag to compare

3x boost to upsert throughput via grpc

In this release, we are upgrading theprotobuf dependency in our optional grpc extras from 3.20.3 to 4.25.3.

This is a breaking change for users of the optional GRPC addon (installed with pinecone-client[grpc]). Detailed performance profiling by @daverigby showed this dependency upgrade unlocked a 3x improvement to vector upsert performance in the Python SDK, bringing it much closer to the performance observed in our grpc-based Java SDK.

As a reminder, to use use the optional grpc extras for improved performance, you need to install pinecone-client[grpc] and make a small modification to how you import and use the client. See the instructions for doing this here.

What's Changed