google / google/generative-ai-docs
How can I remove/reduce the safety options?
- Dominant language
- Jupyter Notebook
- Stars
- 2.3k
- Forks
- 735
- PR merge metrics
- No merged PRs in 30d
Description
### Description of the bug:
My python code looks like this:
```
response = await model.generate_content_async(
prompt,
generation_config={
'temperature': 0.0, 'max_output_tokens': expectedOutputTokens
},
safety_settings={
"HARM_CATEGORY_DANGEROUS": "block_none",
"HARM_CATEGORY_HARASSMENT": "block_none",
"HARM_CATEGORY_HATE_SPEECH": "block_none",
"HARM_CATEGORY_SEXUAL": "block_none"
})
```
It produces internal errors (500) when I try to specify `safety_settings` as above. Is this not the right way? I'm trying to reduce the number of errors I get due to safety. Thanks!
### Actual vs expected behavior:
Would expect this either to fail early with a message telling me what's wrong with my arguments, or for it to work as expected, while producing fewer errors of the sort "response blocked because of safety"
### Any other information you'd like to share?
_No response_
Contributor guide
Assessment
This issue has not been assessed yet.