Reasoning-model UX: better empty-response error, higher default budget, live link
- When a model streams reasoning but no story text, return a specific, actionable error (raise Max output tokens / set a reasoning cap / use a non-reasoning model) instead of the opaque "empty response". - Bump default max_output_tokens 400 -> 800: 400 truncated scenes and left reasoning models with no room after thinking. Affects new settings rows; existing users keep their value. - README: add a "Try it live" link to the Render deployment. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01TEpWMjnfPqzZ13nPMoGhs5
This commit is contained in:
co-authored by
Claude Opus 4.8
parent
8188ed3999
commit
82fb6c8535
@@ -288,7 +288,17 @@ async def generate_turn(
|
||||
|
||||
text = "".join(chunks).strip()
|
||||
if not text:
|
||||
yield sse({"type": "error", "detail": "The AI returned an empty response."})
|
||||
# If the model streamed reasoning but no story text, it spent its whole
|
||||
# budget thinking — say so instead of a mysterious "empty response".
|
||||
if reasoning_chunks:
|
||||
detail = (
|
||||
"The model used its entire token budget on reasoning and returned no "
|
||||
'story text. Raise "Max output tokens" in Settings, set a "Reasoning '
|
||||
'max tokens" cap, or switch to a non-reasoning model.'
|
||||
)
|
||||
else:
|
||||
detail = "The AI returned an empty response."
|
||||
yield sse({"type": "error", "detail": detail})
|
||||
return
|
||||
|
||||
# onOutput
|
||||
|
||||
Reference in New Issue
Block a user