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

Disable safety checking for Gemini #1782

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

xl0
Copy link

@xl0 xl0 commented Jun 9, 2024

Gemini is quite over-zealous with the default safety settings, triggering on completely benign tasks.
Ideally, we should make this configurable, but until someone implements it, let's just set the safety thresholds to the max.


🚀 This description was created by Ellipsis for commit e993889

Summary:

This PR updates the POST function in app/api/chat/google/route.ts to disable safety checks by setting all harm block thresholds to BLOCK_NONE for the Google Generative AI model.

Key points:

  • Updated POST function in app/api/chat/google/route.ts
  • Imported HarmBlockThreshold, HarmCategory, SafetySetting from @google/generative-ai
  • Set all safety thresholds to BLOCK_NONE for various categories
  • Configured GoogleGenerativeAI model with new safety settings

Generated with ❤️ by ellipsis.dev

Copy link

@ellipsis-dev ellipsis-dev bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

❌ Changes requested. Reviewed everything up to e993889 in 29 seconds

More details
  • Looked at 50 lines of code in 1 files
  • Skipped 0 files when reviewing.
  • Skipped posting 0 drafted comments based on config settings.

Workflow ID: wflow_JbqOXGi0VZt4uCVW


Want Ellipsis to fix these issues? Tag @ellipsis-dev in a comment. You can customize Ellipsis with 👍 / 👎 feedback, review rules, user-specific overrides, quiet mode, and more.

app/api/chat/google/route.ts Show resolved Hide resolved
@xl0
Copy link
Author

xl0 commented Jul 9, 2024

@mckaywrigley ping

@samrahimi
Copy link

Yes, this and the addition of the gemini-pro-1.5-exp-0801 update should both be merged... I should have checked the PRs before I implemented both myself last night. Together they make gemini into an uncensored frontier model, which is a big deal (the 0801 update actually loses its guardrails near completely when you turn off the safety checked and provide an appropriate system message... plus its performance is currently topping the leaderboards, a huge improvement over the status quo)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants