Cascade Bot commited on
Commit
d2d63a6
Β·
1 Parent(s): 677ea96

fix: update Gradio interface to resolve warnings

Browse files

- Set chatbot type to 'messages' to use OpenAI-style format
- Remove unnecessary styling parameters
- Simplify component configuration
- Improve visual consistency

Files changed (1) hide show
  1. app.py +10 -20
app.py CHANGED
@@ -194,8 +194,7 @@ class ChatInterface:
194
  def create_interface(self) -> gr.Blocks:
195
  """Create the Gradio interface."""
196
  with gr.Blocks(
197
- title="Advanced Agentic System",
198
- theme=gr.themes.Default()
199
  ) as interface:
200
  gr.Markdown("""
201
  # πŸ€– Advanced Agentic System Chat Interface
@@ -217,32 +216,23 @@ class ChatInterface:
217
  """)
218
 
219
  chatbot = gr.Chatbot(
220
- label="Chat History",
221
- height=600,
222
- show_copy_button=True,
223
- render_markdown=True
224
  )
225
 
226
  with gr.Row():
227
  msg = gr.Textbox(
228
- label="Message",
229
  placeholder="Chat with the Agentic System...",
230
- lines=2
231
- )
232
- submit = gr.Button(
233
- "Send πŸš€",
234
- variant="primary"
235
  )
 
236
 
237
  with gr.Row():
238
- clear = gr.ClearButton(
239
- [msg, chatbot],
240
- value="Clear Chat πŸ—‘οΈ"
241
- )
242
- retry = gr.Button(
243
- "Retry Last πŸ”„"
244
- )
245
-
246
  async def respond(message, history):
247
  """Handle chat responses with proper formatting."""
248
  try:
 
194
  def create_interface(self) -> gr.Blocks:
195
  """Create the Gradio interface."""
196
  with gr.Blocks(
197
+ title="Advanced Agentic System"
 
198
  ) as interface:
199
  gr.Markdown("""
200
  # πŸ€– Advanced Agentic System Chat Interface
 
216
  """)
217
 
218
  chatbot = gr.Chatbot(
219
+ show_label=False,
220
+ height=500,
221
+ type="messages" # Use OpenAI-style message format
 
222
  )
223
 
224
  with gr.Row():
225
  msg = gr.Textbox(
226
+ show_label=False,
227
  placeholder="Chat with the Agentic System...",
228
+ container=False
 
 
 
 
229
  )
230
+ submit = gr.Button("Send πŸš€")
231
 
232
  with gr.Row():
233
+ clear = gr.ClearButton([msg, chatbot], value="Clear")
234
+ retry = gr.Button("Retry")
235
+
 
 
 
 
 
236
  async def respond(message, history):
237
  """Handle chat responses with proper formatting."""
238
  try: