Yes, we can pass a proxy via pinecone.init()
. Since our REST client is based on an OpenAPI spec, you can pass your own OpenAPI configuration and modify defaults, including proxies. Here is an example to use an insecure local proxy running on my system:
from pinecone.core.client.configuration import Configuration as OpenApiConfiguration
openapi_config = OpenApiConfiguration.get_default_copy()
# Here I am trying to connect to an insecure local proxy at 0.0.0.0:8081,
#however you can keep the verify_ssl=True if you are using a secure connection
openapi_config.verify_ssl = False
openapi_config.proxy = "http://0.0.0.0:8081"
pinecone.init(api_key="API_KEY",openapi_config=openapi_config)
index = pinecone.Index("test")
print(index.describe_index_stats())
Note: This is only configurable for the REST client as of now, we will add similar support for gRPC soon.