# Dict format (shorthand)
result = await generate_text(
model=google("gemini-2.0-flash"),
prompt="Write a thriller story.",
provider_options={
"google": {
"safety_settings": {
"HARM_CATEGORY_VIOLENCE": "BLOCK_ONLY_HIGH",
"HARM_CATEGORY_HATE_SPEECH": "BLOCK_MEDIUM_AND_ABOVE"
}
}
}
)
# List format (official API format)
result = await generate_text(
model=google("gemini-2.0-flash"),
prompt="Write a thriller story.",
provider_options={
"google": {
"safety_settings": [
{"category": "HARM_CATEGORY_HARASSMENT", "threshold": "BLOCK_LOW_AND_ABOVE"},
{"category": "HARM_CATEGORY_HATE_SPEECH", "threshold": "BLOCK_MEDIUM_AND_ABOVE"},
{"category": "HARM_CATEGORY_SEXUALLY_EXPLICIT", "threshold": "BLOCK_ONLY_HIGH"},
{"category": "HARM_CATEGORY_DANGEROUS_CONTENT", "threshold": "BLOCK_NONE"}
]
}
}
)