File size: 2,574 Bytes
436b73f 4c5dda7 436b73f 4c5dda7 4cbe440 4c5dda7 436b73f 3b45609 4c5dda7 3b45609 4c5dda7 3b45609 436b73f 4c5dda7 3b45609 4c5dda7 38392db 4cbe440 436b73f 4cbe440 4c5dda7 38392db 436b73f 4c5dda7 4cbe440 38392db 3b45609 38392db 4c5dda7 4cbe440 38392db 4c5dda7 4cbe440 4c5dda7 4cbe440 38392db 4c5dda7 4cbe440 4c5dda7 4cbe440 38392db |
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 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 |
import streamlit as st
from app import generate_response
# Title and Description
st.title("UI/UX Design Assistant Chatbot")
st.markdown(
"""
Welcome to the **UI/UX Design Assistant**! π¨
This AI chatbot helps you:
- Create actionable design suggestions
- Generate visual templates
- Provide Figma-ready designs
Fill in the details below to get started!
"""
)
# User Inputs
task = st.text_input("Describe your design task (e.g., 'landing page design')", key="task_input")
style = st.selectbox(
"Select a design style:",
["modern minimalist", "vintage", "playful", "corporate", "futuristic"],
key="style_select"
)
requirements = st.text_area("Enter specific functional requirements (optional):", key="requirements_input")
# Generate Button
if st.button("Generate Design", key="generate_button"):
# Check if required fields are filled
if not task.strip():
st.error("β οΈ Please provide a design task before generating.")
else:
with st.spinner("Generating your design... π"):
try:
# Generate response
response = generate_response(task.strip(), style, requirements.strip())
# Display Textual Suggestions
st.subheader("π‘ Textual Suggestions:")
if response.get("text"):
st.write(response["text"])
else:
st.warning("β οΈ No textual suggestions generated. Please refine your input and try again.")
# Display Visual Template
st.subheader("πΌοΈ Visual Template:")
if response.get("visual_template") and "Error" not in response["visual_template"]:
st.image(response["visual_template"], caption="Generated Visual Template")
else:
st.warning("β οΈ No visual template available or an error occurred.")
# Display Figma Template Link
st.subheader("π Figma Template:")
if response.get("figma_template") and "Error" not in response["figma_template"]:
st.write(f"[View Template in Figma]({response['figma_template']})")
else:
st.warning("β οΈ No Figma template available or an error occurred.")
except Exception as e:
st.error(f"β An error occurred while generating the design: {e}")
# Footer
st.markdown("---")
st.markdown("π‘ **Tip**: Ensure your inputs are clear and concise for the best results.")
|