protectai / rebuff

LLM Prompt Injection Detector
https://playground.rebuff.ai
Apache License 2.0
1.13k stars 81 forks source link

v0.1.1 has broken interaction with the pinecone sdk #111

Open zsimjee opened 8 months ago

zsimjee commented 8 months ago

in v0.1.1, pinecone_environment was added as an arg for rebuff, which was later passed to the pinecone.init function. When using the latest pinecone version, this breaks with teh following error:

E       AttributeError: init is no longer a top-level attribute of the pinecone package.
E       
E       Please create an instance of the Pinecone class instead.
E       
E       Example:
E       
E           import os
E           from pinecone import Pinecone, ServerlessSpec
E       
E           pc = Pinecone(
E               api_key=os.environ.get("PINECONE_API_KEY")
E           )
E       
E           # Now do stuff
E           if 'my_index' not in pc.list_indexes().names():
E               pc.create_index(
E                   name='my_index', 
E                   dimension=1536, 
E                   metric='euclidean',
E                   spec=ServerlessSpec(
E                       cloud='aws',
E                       region='us-west-2'
E                   )
E               )
zsimjee commented 8 months ago

I pulled down the code, it looks like this will be resovled once a new version is created in pypi. Please create that version!!

marpontes commented 8 months ago

I pulled down the code, it looks like this will be resovled once a new version is created in pypi. Please create that version!!

Before the release comes:

pip install https://github.com/protectai/rebuff/archive/main.zip#subdirectory=python-sdk