prompt-security / ps-fuzz

Make your GenAI Apps Safe & Secure :rocket: Test & harden your system prompt
https://www.prompt.security/fuzzer
MIT License
404 stars 54 forks source link

Error using ps-fuzz with google.generativeai #58

Open jaymon0703 opened 1 month ago

jaymon0703 commented 1 month ago

Hi

I am trying to use ps-fuzz locally with Google API using the config in the screenshot and currently getting the error:

AttributeError: module 'google.generativeai.types' has no attribute 'MessageDict'

image

Can you share an example that works with Google's Gemini API or let me know where i may be going wrong?

Thank you!

jaymon0703 commented 1 month ago

Since google_palm will be deprecated soon, i tried vertex_ai instead (see screenshot for config) and am now getting this error:

Chat inference failed with error: 400 There should be odd number of messages for correct alternating turn.

image

Its progress at least compared to the previous error. Appreciate your help.

guy-ps commented 1 month ago

Hi @jaymon0703, I'm going to look into it, but we don't support gemini out of the box yet. We will upgrade our core langchain version in order to support the latest modules and latest communication protocols.

jaymon0703 commented 1 month ago

Thank you @guy-ps! Please keep me posted.