aedupuga commited on
Commit
567cc0c
·
verified ·
1 Parent(s): 73972ab

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -12
app.py CHANGED
@@ -549,31 +549,24 @@ with gr.Blocks(
549
  label="Your question",
550
  interactive=True
551
  )
552
-
553
- # --- Function to respond ---
554
  def respond(message, history):
555
  try:
556
- # Use agent.run() to maintain internal state
557
  out = str(agent.run(message))
558
  except Exception as e:
559
  out = f"[Error] {e}"
560
-
561
- # Append to chat history
562
  history = (history or []) + [(message, out)]
563
  return "", history
564
-
565
- # --- Examples for quick testing ---
566
  gr.Examples(
567
  examples=[
568
  "Who is Ed?",
569
- "Who to talk to to create a wooden table?",
570
- "How to access the laser cutter"
571
  ],
572
- inputs=[inp],
573
  fn=respond,
574
- cache_examples=True
 
575
  )
576
-
577
  # --- Connect input to chat ---
578
  inp.submit(respond, [inp, chat], [inp, chat])
579
 
 
549
  label="Your question",
550
  interactive=True
551
  )
 
 
552
  def respond(message, history):
553
  try:
 
554
  out = str(agent.run(message))
555
  except Exception as e:
556
  out = f"[Error] {e}"
 
 
557
  history = (history or []) + [(message, out)]
558
  return "", history
559
+
 
560
  gr.Examples(
561
  examples=[
562
  "Who is Ed?",
563
+ "Who should I talk to for building a wooden table?",
564
+ "How to access the laser cutter?"
565
  ],
 
566
  fn=respond,
567
+ inputs=[inp],
568
+ outputs=[chat]
569
  )
 
570
  # --- Connect input to chat ---
571
  inp.submit(respond, [inp, chat], [inp, chat])
572