Skip to content

Feature request: safety settings for Gemini API #1393

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

Open
aristid opened this issue Mar 18, 2025 · 0 comments
Open

Feature request: safety settings for Gemini API #1393

aristid opened this issue Mar 18, 2025 · 0 comments

Comments

@aristid
Copy link

aristid commented Mar 18, 2025

Do you plan to support this in config?

response = client.models.generate_content(
    model="gemini-2.0-flash",
    contents=['Do these look store-bought or homemade?', img],
    config=types.GenerateContentConfig(
      safety_settings=[
        types.SafetySetting(
            category=types.HarmCategory.HARM_CATEGORY_HATE_SPEECH,
            threshold=types.HarmBlockThreshold.BLOCK_LOW_AND_ABOVE,
        ),
      ]
    )
)

https://ai.google.dev/api/generate-content
https://cloud.google.com/vertex-ai/generative-ai/docs/reference/python/1.60.0/services

Thank you.

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

No branches or pull requests

1 participant