protectai / rebuff

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

Python Rebuff SDK #88

Closed mehrinkiani closed 6 months ago

mehrinkiani commented 7 months ago

This PR adds a first class support for Python SDK for Rebuff.

Please note you will need the following credentials for testing the PR: pinecone_environment pinecone_apikey pinecone_index openai_model openai_apikey

I will open new issues for creating support for Chroma and for adding tests for Python SDK.

mehrinkiani commented 6 months ago

Hi Mehrin, I don't think we've interacted yet, but I'm Risto and I've been contributing a little to this project. I think that's great that you're adding a Python SDK! I thought I'd go through and add some comments for where I think the code could be slightly improved. Let me know if you have any questions or clarifications on my review.

Hi Risto, Thank you so much for your review and valuable contributions to the project. I have tried to work on your review. The main changes include:

  1. Updated the API call to call Pinecone directly in log_leakage function.
  2. Updated type hints.
  3. Changed class name from Rebuff to RebuffPython to avoid possible conflict.
ristomcgehee commented 6 months ago

This PR looks good from my perspective. Thanks for all your work on it, Mehrin!