Closed wencan closed 5 months ago
@wecan, This error is not from the python SDK side and it's from the Gemini API side. The last message of the chat_session is blocked by Gemini because of Safety reasons. Thank you!
Marking this issue as stale since it has been open for 14 days with no activity. This issue will be closed if no further activity occurs.
Any idea? I'm trying to translate a text that gemini created by itself and I also receive the same error
StopCandidateException(index: 0
finish_reason: OTHER
)
It's killing my production launch. :'(
model_name="gemini-1.5-flash"
safety_settings={
HarmCategory.HARM_CATEGORY_HARASSMENT: HarmBlockThreshold.BLOCK_NONE,
HarmCategory.HARM_CATEGORY_HATE_SPEECH: HarmBlockThreshold.BLOCK_NONE,
HarmCategory.HARM_CATEGORY_SEXUALLY_EXPLICIT: HarmBlockThreshold.BLOCK_NONE,
HarmCategory.HARM_CATEGORY_DANGEROUS_CONTENT: HarmBlockThreshold.BLOCK_NONE,
}
Library version:
google-generativeai~=0.7.2
Description of the bug:
code:
Actual vs expected behavior:
actual:
Any other information you'd like to share?
OS: Fedora Linux 40 (Workstation Edition) x86_64 Host: 21D0 ThinkBook 14 G4+ ARA Kernel: 6.8.11-300.fc40.x86_64 Uptime: 2 hours, 46 mins Packages: 2663 (rpm), 42 (flatpak) Shell: bash 5.2.26 Resolution: 2880x1800 DE: GNOME 46.2 WM: Mutter WM Theme: Adwaita Theme: Adwaita [GTK2/3] Icons: Adwaita [GTK2/3] Terminal: gnome-terminal CPU: AMD Ryzen 5 6600H with Radeon Graphics (12) @ 4.564GHz GPU: AMD ATI Radeon 680M Memory: 4608MiB / 13649MiB
Python 3.12.3 google-ai-generativelanguage 0.6.4 google-api-core 2.19.0 google-api-python-client 2.132.0 google-auth 2.30.0 google-auth-httplib2 0.2.0 google-generativeai 0.6.0 google-pasta 0.2.0 googleapis-common-protos 1.63.1