Spaces:
Build error
Build error
| import streamlit as st | |
| import agent as ag | |
| st.markdown("<h1 style='text-align: center;'>Social Media Content Generator</h1>", unsafe_allow_html=True) | |
| with st.form("platform"): | |
| topic = st.text_input(label="Topic") | |
| platform = st.radio(label="Select a platform", options=["LinkedIn", "Instagram"]) | |
| if st.form_submit_button("Generate Content", use_container_width=True): | |
| if topic: | |
| with st.spinner(text="In progress...", show_time=True): | |
| input_data = {"topic": topic, "platform": platform} | |
| output = ag.graph.invoke(input_data) | |
| st.markdown(output['post']) | |
| markdown_links = " ".join([f"[Image {i+1}]({url})" for i, url in enumerate(output['image_url'])]) | |
| st.markdown(f"**Image URLs:** {markdown_links}") | |
| else: | |
| st.error("Please provide a topic.") |