vivekchakraverty Claude Opus 4.8 commited on
Commit
69036da
·
1 Parent(s): 217a06b

Hardcode chat memory to 4 turns (lock history_turns slider)

Browse files

The history_turns control is now non-interactive and fixed at
MAX_HISTORY_TURNS (4). It stays in additional_inputs so the /respond
API signature is unchanged (message, top_k, self_correct, history_turns).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>

Files changed (1) hide show
  1. app.py +5 -2
app.py CHANGED
@@ -72,9 +72,12 @@ with gr.Blocks(title="GDScript Coding Assistant", fill_height=True) as demo:
72
  top_k = gr.Slider(2, 10, value=6, step=1, label="Retrieved snippets (k)")
73
  self_correct = gr.Checkbox(
74
  value=True, label="Auto-correct one syntax error (extra GPU call)")
 
 
 
75
  history_turns = gr.Slider(
76
- 0, 8, value=promptlib.MAX_HISTORY_TURNS, step=1,
77
- label="Chat memory: prior turns to remember (0 = single-turn)")
78
 
79
  gr.ChatInterface(
80
  fn=respond,
 
72
  top_k = gr.Slider(2, 10, value=6, step=1, label="Retrieved snippets (k)")
73
  self_correct = gr.Checkbox(
74
  value=True, label="Auto-correct one syntax error (extra GPU call)")
75
+ # Chat memory is hardcoded to 4 turns. Kept as a non-interactive input
76
+ # (rather than removed) so the /respond API signature stays
77
+ # (message, top_k, self_correct, history_turns).
78
  history_turns = gr.Slider(
79
+ 0, 8, value=promptlib.MAX_HISTORY_TURNS, step=1, interactive=False,
80
+ label=f"Chat memory: fixed at {promptlib.MAX_HISTORY_TURNS} prior turns")
81
 
82
  gr.ChatInterface(
83
  fn=respond,