File size: 1,367 Bytes
5f440a4 073c4fc 5f440a4 073c4fc 6b85c76 073c4fc |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 |
import streamlit as st
from utils.run_pipeline_and_save import run_pipeline_and_save
from utils.zip_output import zip_output
st.write("App started — enter prompt and click Generate UI")
import os
os.environ["STREAMLIT_BROWSER_GATHER_USAGE_STATS"] = "false"
def main():
st.set_page_config(page_title="Multi-Agent UI Generator")
st.title("🛠️ Multi-Agent Collaboration System")
prompt = st.text_area("Enter your product idea prompt", height=200)
if st.button("Generate UI"):
if not prompt.strip():
st.warning("Please enter a prompt.")
else:
with st.spinner("Running agents..."):
conversation, final_output = run_pipeline_and_save(prompt)
st.subheader("Agent Conversation")
for step in conversation:
for role, msg in step.items():
st.markdown(f"**{role}:**")
st.code(msg.strip(), language="markdown")
zip_path = zip_output()
with open(zip_path, "rb") as f:
st.download_button("Download UI Files (ZIP)", f, file_name="output_bundle.zip")
with open("output/agent_log.json", "rb") as f:
st.download_button("Download Agent Log", f, file_name="agent_log.json")
if __name__ == "__main__":
main() |