Chainlit / cookbook

Chainlit's cookbook repo
https://github.com/Chainlit/chainlit
747 stars 276 forks source link

AttributeError: init is no longer a top-level attribute of the pinecone package. #128

Closed brylie closed 3 weeks ago

brylie commented 3 months ago

When testing the Pinecone recipe, I get the following error:

AttributeError: 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'
            )
        )

I'm not sure how to refactor the recipe to use the newly created Pinecone instance. Also, there seem to be several deprecated packages in the imports, so the recipe may need a bit of additional attention 😄

ModEnter commented 3 weeks ago

This has been fixed, thanks for your feedback