atakan Claude Opus 5 commited on
Commit
d554d58
·
1 Parent(s): c5194c9

fix: Drop ChatInterface(type=...), removed in Gradio 6

Browse files

The Space failed to start with "ChatInterface.__init__() got an unexpected
keyword argument 'type'". The platform installs gradio 6.25.0, which dropped the
argument: messages is the only history format now, which is what respond()
already expects and what ControlAgent.stream takes.

Also verified the rest of the file properly this time rather than shipping it
blind. gradio 6.24 is installed locally, close enough to the Space's 6.25, so
app_space.py now imports end-to-end behind a stub engine: the Blocks construct,
respond() streams three updates for a tool-calling turn, and the footer renders
plots, tool names and sources.

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

Files changed (1) hide show
  1. app_space.py +3 -1
app_space.py CHANGED
@@ -129,9 +129,11 @@ with gr.Blocks(title="ControlAI", fill_height=True) as demo:
129
  "local install does not apply here — don't enter anything confidential. The full "
130
  "app, with its own console, runs on Apple Silicon: see the repository.*"
131
  )
 
 
 
132
  gr.ChatInterface(
133
  fn=respond,
134
- type="messages",
135
  examples=[
136
  "Design an LQR for A=[[0,1],[-2,-3]], B=[[0],[1]], Q=eye(2), R=1.",
137
  "What is the phase margin of G(s) = 10/(s(s+1)(s+5))?",
 
129
  "local install does not apply here — don't enter anything confidential. The full "
130
  "app, with its own console, runs on Apple Silicon: see the repository.*"
131
  )
132
+ # No `type=` argument: Gradio 6 dropped it, messages is the only format now.
133
+ # History therefore arrives as [{"role":..., "content":...}], which is what
134
+ # `respond` expects and what ControlAgent.stream takes.
135
  gr.ChatInterface(
136
  fn=respond,
 
137
  examples=[
138
  "Design an LQR for A=[[0,1],[-2,-3]], B=[[0],[1]], Q=eye(2), R=1.",
139
  "What is the phase margin of G(s) = 10/(s(s+1)(s+5))?",