[GH-ISSUE #1348] [BUG]: [GoogleGenerativeAI Error]: Candidate was blocked due to SAFETY #854

Closed
opened 2026-02-22 18:21:47 -05:00 by yindo · 5 comments
Owner

Originally created by @chalitbkb on GitHub (May 10, 2024).
Original GitHub issue: https://github.com/Mintplex-Labs/anything-llm/issues/1348

How are you running AnythingLLM?

All versions

What happened?

gemini 1.5 pro
image

Are there known steps to reproduce?

No response

Originally created by @chalitbkb on GitHub (May 10, 2024). Original GitHub issue: https://github.com/Mintplex-Labs/anything-llm/issues/1348 ### How are you running AnythingLLM? All versions ### What happened? gemini 1.5 pro ![image](https://github.com/Mintplex-Labs/anything-llm/assets/32437546/f6b45f7f-fb2d-4521-bb4a-9f853aab74ee) ### Are there known steps to reproduce? _No response_
yindo added the possible bug label 2026-02-22 18:21:47 -05:00
yindo closed this issue 2026-02-22 18:21:47 -05:00
Author
Owner

@timothycarambat commented on GitHub (May 10, 2024):

Yeah, this is because Google found it a violation of their content policy. We can only set it to LOW, but cannot disable it. You need special permission to do so

@timothycarambat commented on GitHub (May 10, 2024): Yeah, this is because Google found it a violation of their content policy. We can only set it to LOW, but cannot disable it. You need special permission to do so
Author
Owner

@timothycarambat commented on GitHub (May 10, 2024):

https://ai.google.dev/gemini-api/docs/safety-settings

@timothycarambat commented on GitHub (May 10, 2024): https://ai.google.dev/gemini-api/docs/safety-settings
Author
Owner

@RahSwe commented on GitHub (May 12, 2024):

@timothycarambat

Is this the current setting for all content categories with Gemini?

image
@RahSwe commented on GitHub (May 12, 2024): @timothycarambat Is this the current setting for all content categories with Gemini? <img width="785" alt="image" src="https://github.com/Mintplex-Labs/anything-llm/assets/163884933/ebb30447-9c6d-4811-a8b2-f57e1b365ba6">
Author
Owner

@RahSwe commented on GitHub (May 12, 2024):

@timothycarambat

Not knowing what I am doing, but this seems to be the settings to use in the Gemini javascript file:

safety_settings: [
{
category: HarmCategory.HARM_CATEGORY_HARASSMENT,
threshold: HarmBlockThreshold.BLOCK_ONLY_HIGH,

  category: HarmCategory.HARM_CATEGORY_HATE_SPEECH,
  threshold: HarmBlockThreshold.BLOCK_ONLY_HIGH,

  category: HarmCategory.HARM_CATEGORY_SEXUALLY_EXPLICIT,
  threshold: HarmBlockThreshold.BLOCK_ONLY_HIGH,

  category: HarmCategory.HARM_CATEGORY_DANGEROUS_CONTENT,
  threshold: HarmBlockThreshold.BLOCK_ONLY_HIGH,
},
@RahSwe commented on GitHub (May 12, 2024): @timothycarambat Not knowing what I am doing, but this seems to be the settings to use in the Gemini javascript file: safety_settings: [ { category: HarmCategory.HARM_CATEGORY_HARASSMENT, threshold: HarmBlockThreshold.BLOCK_ONLY_HIGH, category: HarmCategory.HARM_CATEGORY_HATE_SPEECH, threshold: HarmBlockThreshold.BLOCK_ONLY_HIGH, category: HarmCategory.HARM_CATEGORY_SEXUALLY_EXPLICIT, threshold: HarmBlockThreshold.BLOCK_ONLY_HIGH, category: HarmCategory.HARM_CATEGORY_DANGEROUS_CONTENT, threshold: HarmBlockThreshold.BLOCK_ONLY_HIGH, },
Author
Owner

@timothycarambat commented on GitHub (May 12, 2024):

That is the default, so yes

@timothycarambat commented on GitHub (May 12, 2024): That is the default, so yes
yindo changed title from [BUG]: [GoogleGenerativeAI Error]: Candidate was blocked due to SAFETY to [GH-ISSUE #1348] [BUG]: [GoogleGenerativeAI Error]: Candidate was blocked due to SAFETY 2026-06-05 14:37:34 -04:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: Mintplex-Labs/anything-llm#854