generative-ai-docs icon indicating copy to clipboard operation
generative-ai-docs copied to clipboard

"finish_reason":"recitation" makes API unusable for OCR and file import

Open jamesblackwell opened this issue 7 months ago • 2 comments

The API frequently returns "finish_reason":"recitation", which prematurely ends the response and breaks workflows involving OCR or document importing. This behavior makes the API nearly unusable for these tasks.

Please either: 1. Fix this issue so full responses are returned consistently. 2. Document what causes "recitation" and how to avoid triggering it.

Current documentation offers no clarity on this, and it’s blocking reliable use in production.

jamesblackwell avatar Apr 04 '25 13:04 jamesblackwell

Hi @jamesblackwell,

Recitation as finish_reason you get when model tries to generate copyright content. You can find more info here. To fix this, try to make prompt / context as unique as possible and use a higher temperature.

gmKeshari avatar Apr 16 '25 12:04 gmKeshari

@gmKeshari that answer is absolutely bad. i am uploading pdfs to get the text, to index and make advanced search, are pdfs from an university, and gemini-2.5-pro-exp api stops for recitation. This error make unusable the api, i will go to openai, while not solved.

jamesxt94kode avatar Apr 27 '25 06:04 jamesxt94kode

Hey @jamesblackwell, Thanks for providing the more context. I will raise this with our internal team for workaround.

gmKeshari avatar May 02 '25 07:05 gmKeshari

Marking this issue as stale since it has been open for 14 days with no activity. This issue will be closed if no further activity occurs.

github-actions[bot] avatar May 17 '25 02:05 github-actions[bot]

This issue was closed because it has been inactive for 28 days. Please post a new issue if you need further assistance. Thanks!

github-actions[bot] avatar May 31 '25 02:05 github-actions[bot]