Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pinecone error #1815

Open
uiaiek32 opened this issue May 1, 2024 · 8 comments
Open

Pinecone error #1815

uiaiek32 opened this issue May 1, 2024 · 8 comments
Labels
bug Something isn't working

Comments

@uiaiek32
Copy link

uiaiek32 commented May 1, 2024

I get this error when I try to connect the pinecone vector:
Error building node Pinecone(ID:Pinecone-eKDBR): init is no longer a top-level attribute of the pinecone package. Please create an instance of the Pinecone class instead. Example: import os from pinecone import Pinecone, ServerlessSpec pc = Pinecone( api_key=os.environ.get("PINECONE_API_KEY") ) # Now do stuff if 'my_index' not in pc.list_indexes().names(): pc.create_index( name='my_index', dimension=1536, metric='euclidean', spec=ServerlessSpec( cloud='aws', region='us-west-2' ) )

Steps to reproduce the behavior:
Capture1
I click run and I get this error

Copy link

dosubot bot commented May 1, 2024

To fix the error you're encountering with Pinecone, you need to adjust your code to match the updated Pinecone SDK's initialization process. The error message indicates that init is no longer used directly. Instead, you should create an instance of the Pinecone class. Here's how you can do it:

import os
from pinecone import Pinecone, ServerlessSpec

pc = Pinecone(api_key=os.environ.get("PINECONE_API_KEY"))

# Example usage
if 'my_index' not in pc.list_indexes().names():
    pc.create_index(
        name='my_index',
        dimension=1536,
        metric='euclidean',
        spec=ServerlessSpec(cloud='aws', region='us-west-2')
    )

Make sure to replace the outdated pinecone.init method with the creation of a Pinecone instance as shown above. This change aligns with the latest Pinecone SDK guidelines. For the most accurate and up-to-date information, consult the Pinecone SDK documentation directly. This will ensure you're using the correct class and method names for initializing the Pinecone client with your API key and environment settings.

Details

Sources


About Dosu
This response is meant to be useful and save you time. It is not meant to be a precise solution, but rather a starting point for your own research.

Help me be more useful! Please leave a 👍 if this is helpful and 👎 if it is irrelevant.

To continue the conversation, mention @dosu.

@dosubot dosubot bot added the bug Something isn't working label May 1, 2024
@uiaiek32
Copy link
Author

uiaiek32 commented May 2, 2024

@dosu I still get the error, could you provide me with the correct code please?

@uiaiek32
Copy link
Author

uiaiek32 commented May 2, 2024

I get this error: Error building node Pinecone(ID:Pinecone-0mjWP): init is no longer a top-level attribute of the pinecone package. Please create an instance of the Pinecone class instead. Example: import os from pinecone import Pinecone, ServerlessSpec pc = Pinecone( api_key=os.environ.get("PINECONE_API_KEY") ) # Now do stuff if 'my_index' not in pc.list_indexes().names(): pc.create_index( name='my_index', dimension=1536, metric='euclidean', spec=ServerlessSpec( cloud='aws', region='us-west-2' ) )

@ogabrielluiz
Copy link
Contributor

Hey @uiaiek32

It seems this component is outdated.

We'll get to it soon.

Feel free to update it if you got the know-how and thanks for the heads up!

@uiaiek32
Copy link
Author

uiaiek32 commented May 2, 2024 via email

@uiaiek32
Copy link
Author

uiaiek32 commented May 6, 2024 via email

@ogabrielluiz
Copy link
Contributor

#1854 fixes it in the dev branch.

@uiaiek32
Copy link
Author

uiaiek32 commented May 9, 2024

Hello I am sorry to bother you but I still get the same error.
I re-deploy langflow but I still get the same error message
This is the error message that I get.
unnamed

If you could help me that would be great!
Thanks a lot.
George

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants