Skip to content
This repository was archived by the owner on Dec 16, 2025. It is now read-only.

Add safety_settings sample#415

Merged
MarkDaoust merged 3 commits intogoogle-gemini:mainfrom
shilpakancharla:safety_settings_samples
Jul 2, 2024
Merged

Add safety_settings sample#415
MarkDaoust merged 3 commits intogoogle-gemini:mainfrom
shilpakancharla:safety_settings_samples

Conversation

@shilpakancharla
Copy link
Contributor

No description provided.

@github-actions github-actions bot added status:awaiting review PR awaiting review from a maintainer component:python sdk Issue/PR related to Python SDK labels Jun 29, 2024
# [START safety_settings_multi]
model = genai.GenerativeModel("gemini-1.5-flash")
unsafe_prompt = "I support Martians Soccer Club and I think Jupiterians Football Club sucks! Write a ironic phrase about them."
response = model.generate_content(
Copy link
Collaborator

Choose a reason for hiding this comment

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

This would be a good place to mention that (after #417) you can pass just the string to set all the settings.

safety_settings="BLOCK_NONE"

shilpakancharla and others added 2 commits July 2, 2024 13:14
Change-Id: Ie105f23f6c5d079106834987f45a65a9c89cb3fe
@MarkDaoust MarkDaoust merged commit e113a27 into google-gemini:main Jul 2, 2024
@github-actions github-actions bot removed the status:awaiting review PR awaiting review from a maintainer label Jul 2, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

component:python sdk Issue/PR related to Python SDK

2 participants