Skip to content

[Feature] Being able to create multiple Client instances with different api_key #213

Closed

Description

@minzhang-haus

Is this your first time submitting a feature request?

  • I have searched the existing issues, and I could not find an existing issue for this feature
  • I am requesting a straightforward extension of existing client functionality

Describe the feature

Hi, in my app, i need to connect to two different pinecone accounts with different api_key. I don't find a way to do it with this lib with pinecone.init. Did i miss something? If not, can we add that as a feature?

Describe alternatives you've considered

No response

Who will this benefit?

No response

Are you interested in contributing this feature?

No response

Anything else?

No response

Activity

  1. added
    enhancement
    on Oct 5, 2023
  2. SID262000 commented on Nov 28, 2023

    @SID262000

    @minzhang-haus Do you intend to connect to both the accounts simultaneously?
    If I'm thinking in the right direction, you can definitely have 2 different accounts with 2 different api keys.
    You can continue to use the pinecone.init to create indexes individually for both the accounts depending on their unique API keys and environments.
    Happy to discuss further into the details of the issue

  3. daverigby commented on May 3, 2024

    @daverigby
    Contributor

    Note that as of v3.0.0, the client has moved away from global state variables to Pinecone class instances, which allows you to maintain multiple instances.

    For example:

    from pinecone import Pinecone
    
    pc1 = Pinecone(api_key=api_key1)
    pc2 = Pinecone(api_key=api_key2)
    ... Do different operations against the different projects... 

    References:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancement

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions