finish_reason length Meaning: 4 Causes of Cut-Off Replies + Fix
A reply that stops mid-sentence usually means finish_reason is length (max_tokens on Anthropic). See the values, 4 causes, and Python continuation code.
Blog
与「max_tokens」相关的文章。
A reply that stops mid-sentence usually means finish_reason is length (max_tokens on Anthropic). See the values, 4 causes, and Python continuation code.
max_tokens caps how long one reply can be, so bigger isn't better. Learn how it relates to the context window, which APIs require it, and how to pick a value.