I’ve been using Gemini to extract data from payment receipt images into a JSON format. The model was working as expected for a few days, but now it’s flagging the content as unsafe and failing to complete the conversion. I’m unable to pinpoint the exact cause of this issue.
endpoint: https://generativelanguage.googleapis.com/v1beta/models/gemini-1.5-flash:generateContent
response:
"candidates": [
{
"finishReason": "SAFETY",
"index": 0,
"safetyRatings": [
{
"category": "HARM_CATEGORY_SEXUALLY_EXPLICIT",
"probability": "NEGLIGIBLE"
},
{
"category": "HARM_CATEGORY_HATE_SPEECH",
"probability": "NEGLIGIBLE"
},
{
"category": "HARM_CATEGORY_HARASSMENT",
"probability": "NEGLIGIBLE"
},
{
"category": "HARM_CATEGORY_DANGEROUS_CONTENT",
"probability": "HIGH"
}
]
}
]
input example: