Rahul-8799 commited on
Commit
745fd96
·
verified ·
1 Parent(s): 64648bf

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +7 -21
app.py CHANGED
@@ -1,31 +1,17 @@
1
  import gradio as gr
2
  from utils.langgraph_pipeline import run_pipeline_and_save
3
- from utils.zip_output import zip_output
4
 
5
  def handle_run(prompt):
6
  chat_log, final_output = run_pipeline_and_save(prompt)
7
- return (
8
- [(f"{agent}", msg) for step in chat_log for agent, msg in step.items()],
9
- "output/index.html",
10
- "output/agent_log.json",
11
- zip_output()
12
- )
13
 
14
  with gr.Blocks() as demo:
15
- gr.Markdown("# 🔗 Multi-Agent Collaboration with LangGraph")
 
 
 
 
16
 
17
- prompt_input = gr.Textbox(label="Enter your prompt", lines=4, placeholder="Describe your product idea...")
18
- submit_btn = gr.Button("Run Agents")
19
-
20
- chatbox = gr.Chatbot(label="Agent Conversation Log")
21
- html_out = gr.File(label="index.html")
22
- log_out = gr.File(label="Agent Log")
23
- zip_out = gr.File(label="ZIP Output")
24
-
25
- submit_btn.click(
26
- fn=handle_run,
27
- inputs=prompt_input,
28
- outputs=[chatbox, html_out, log_out, zip_out]
29
- )
30
 
31
  demo.launch()
 
1
  import gradio as gr
2
  from utils.langgraph_pipeline import run_pipeline_and_save
 
3
 
4
  def handle_run(prompt):
5
  chat_log, final_output = run_pipeline_and_save(prompt)
6
+ return chat_log, final_output
 
 
 
 
 
7
 
8
  with gr.Blocks() as demo:
9
+ gr.Markdown("# 🔧 Multi-Agent UI Generator")
10
+ input_box = gr.Textbox(lines=6, label="Enter your product idea prompt")
11
+ run_btn = gr.Button("Generate")
12
+ chatbox = gr.Chatbot(label="Agent Conversation Log", type="messages")
13
+ file_output = gr.File(label="Download UI ZIP")
14
 
15
+ run_btn.click(fn=handle_run, inputs=input_box, outputs=[chatbox, file_output])
 
 
 
 
 
 
 
 
 
 
 
 
16
 
17
  demo.launch()