Author: @Jen Hamon
create_index
method has been refactored to accept a PodSpec
or ServerlessSpec
depending on how you would like to deploy your index. Many old properties such as pod_type
, replicas
, etc are moved into PodSpec
since they do not apply to serverless indexes. Serverless indexes are currently in public preview, so make sure to review the current limitations and test thoroughly before using in production.query
and fetch
call are now returned with the response.https://api.pinecone.io
. This new API allows for a lot more flexibility in how API keys are used in comparison to the past when a rigid 1:1 relationship was enforced between projects and environments.pinecone.init
into new Pinecone
class instances that encapsulate their configuration state. This change enables users to interact with Pinecone using multiple API keys if they wish.numpy
, pyyaml
, loguru
, requests
, dnspython
urllib3
support back to 1.26.x
pinecone.grpc
, so that GRPC code is only imported when needed. For applications using REST, this will mean quicker startup and fewer dependency clashes with other packages.list_indexes
and list_collections
methods now return an array with full descriptions of each resource, not merely an array of names.DateTime
objects.urllib3
usage to stop spamming deprecation warning messages.tqdm
warning that was appearing during notebook runs.list_indexes
now returns additional data, and to continue iterating over an array of names you need to chain a call to a new helper method .names()
. See here.list_collections
has changed very similar to list_indexes. Use .names()
. See here.describe_index
takes the same arguments as before (the index name), but returns data in a different shape reflecting the move of some configurations under the spec
key and elevation of host
to the top level. See a table of changed properties here.query
method has been updated to reflect that top_k
is a required parameter. If you previously relied on passing your query vector as the first positional argument, you’ll see a strange error from the API about duplicate top_k
values being passed. We recommend adopting keyword arguments to fix and be resilient to any future changes, e.g. index.query(vector=vec, top_k=10)
query()
no longer accepts multiple queries via the queries
keyword argument.scale_index()
removed in favor of configure_index()
PINECONE_DEBUG_CURL='true'
In the old client, you had to call the init
method to setup some configuration state as global variables before invoking any data plane or control plane methods. There were a few problems with this:
init
pattern had a side effect of setting configuration into global variables, which limited flexibility to work with multiple API keys at once.init
call also fired off a network request to validate the API key and retrieve the associated projectId that was needed in order to construct data urls using a templated format; this step added significant latency every time someone wanted to interact with Pinecone.# Legacy initialization
import pinecone
pinecone.init(
api_key='XXX',
environment='us-east1-gcp'
)