Spaces:
Runtime error
Runtime error
Update app.py
Browse files
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("#
|
|
|
|
|
|
|
|
|
16 |
|
17 |
-
|
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()
|