pinecone-io / pinecone-python-client

The Pinecone Python client
https://www.pinecone.io/docs
Apache License 2.0
306 stars 80 forks source link

[spruce] Add additional_headers config #245

Closed jhamon closed 11 months ago

jhamon commented 11 months ago

Problem

To support API development and testing, we would like a way to pass additional headers with every request.

Solution

Add a new additional_headers config option and wire up the api client internals to use them.

Usage:

from pinecone import Pinecone

p = Pinecone(api_key='asdf', additional_headers={'X-SECRET-EXTRAS': 'secret secret'})

Type of Change

Test Plan

Added a unit test and also verified manually running with PINECONE_DEBUG_CURL=true

Screenshot 2023-11-18 at 5 53 56 PM