stevafernandes commited on
Commit
3124adf
·
verified ·
1 Parent(s): d97ee23

Upload app.py

Browse files
Files changed (1) hide show
  1. app.py +7 -1
app.py CHANGED
@@ -277,7 +277,13 @@ def gemini_reply(client, convo, n_followups):
277
  cfg = types.GenerateContentConfig(
278
  system_instruction=sys,
279
  temperature=0.3, # lower temp -> stays closer to the sources
280
- max_output_tokens=2048,
 
 
 
 
 
 
281
  )
282
  resp = client.models.generate_content(model=MODEL, contents=contents, config=cfg)
283
  return (resp.text or "").strip()
 
277
  cfg = types.GenerateContentConfig(
278
  system_instruction=sys,
279
  temperature=0.3, # lower temp -> stays closer to the sources
280
+ # gemini-2.5-flash has "thinking" on by default, and those thinking
281
+ # tokens are drawn from max_output_tokens. That could exhaust the budget
282
+ # and truncate the visible answer mid-sentence (e.g. the long treatment-
283
+ # options response). Disable thinking (budget=0) so the whole budget goes
284
+ # to the answer, and raise the ceiling for extra headroom.
285
+ max_output_tokens=8192,
286
+ thinking_config=types.ThinkingConfig(thinking_budget=0),
287
  )
288
  resp = client.models.generate_content(model=MODEL, contents=contents, config=cfg)
289
  return (resp.text or "").strip()