Gemini 2.5 Flash sometimes keeps generating the same text repeatedly and wouldn’t stop, until it reaches the max tokens limit.
I have a response id here if you need: Lk02aYrvEIKw4-EP0sDVmQs
Gemini 2.5 Flash sometimes keeps generating the same text repeatedly and wouldn’t stop, until it reaches the max tokens limit.
I have a response id here if you need: Lk02aYrvEIKw4-EP0sDVmQs
Hi @angusma, Thanks for reaching out to us.
Could you please provide an example of the prompt you are using with Gemini 2.5 Flash, along with a screenshot? This will help us investigate the issue and assist you more effectively.
Thank you!
Thanks for replying. I just tried the original request again and the model worked correctly.
Here is the original request I made, including responseSchema, a text file, an image and a text part:
{
"contents": [
{
"parts": [
{
"fileData": {
"fileUri": "https://generativelanguage.googleapis.com/v1beta/files/1447437411968745633",
"mimeType": "image/webp"
}
},
{
"fileData": {
"fileUri": "https://generativelanguage.googleapis.com/v1beta/files/1447437410844807168",
"mimeType": "text/plain"
}
},
{
"text": "\n請閱讀附件的故事內容和角色的圖片,產生一份檔案,內容包含「瑞希」這個角色的的詳細描述,生成的人格設定必須包含以下部分:\n基本設定:姓名、年齡或外貌印象(若有)、背景與出身、世界觀。\n性格與情感:主要性格特質、情緒反應模式、語氣與表達風格、價值觀。\n互動風格:對話主動性、幽默感或禮貌程度、情感表達範圍,這些項目可能會因為對方和角色的關係而有所不同,這部分請務必載明。\n避免事項:明確說明不應出現的語氣或行為。\n"
}
]
}
],
"generationConfig": {
"responseMimeType": "application/json",
"responseSchema": {
"description": "Data model for creating a new character from a story.",
"properties": {
"memories": {
"description": "這個角色應該具備的完整記憶",
"items": {
"description": "Data model for a character's memory.",
"properties": {
"name": {
"description": "這段記憶的簡短描述,不得使用換行符號。",
"title": "Name",
"type": "STRING"
},
"detail": {
"description": "這段記憶的完整內容。",
"title": "Detail",
"type": "STRING"
}
},
"property_ordering": [
"name",
"detail"
],
"required": [
"name",
"detail"
],
"title": "CharacterMemory",
"type": "OBJECT"
},
"title": "Memories",
"type": "ARRAY"
},
"character": {
"description": "這個角色的詳細描述",
"title": "Character",
"type": "STRING"
}
},
"propertyOrdering": [
"memories",
"character"
],
"required": [
"character"
],
"title": "NewCharacterData",
"type": "OBJECT"
}
}
}
This gist includes the text file I used(1447437410844807168.txt), the webp image in base64 format(1447437411968745633.webp) and the original response, everything is written in Traditional Chinese.