A prompt generator that takes a description of inputs and output and generates a prompt out of those
To upload files, please first save the app
import streamlit as st
st.title("AI Prompt Generator")
st.write("This tool helps you generate structured prompts for AI models based on your inputs and desired outputs.")
# Input section
st.header("Input Description")
input_desc = st.text_area(
"Describe the inputs you want to provide to the AI",
placeholder="Example: A list of customer reviews in CSV format containing ratings and comments"
)
# Output section
st.header("Output Description")
output_desc = st.text_area(
"Describe the desired output format or result",
placeholder="Example: A summary of common themes in the reviews and overall sentiment analysis"
)
# Additional context
st.header("Additional Context (Optional)")
context = st.text_area(
"Any additional context or requirements",
placeholder="Example: The analysis should focus on product features and customer service aspects"
)
# Generate prompt
if st.button("Generate Prompt"):
if input_desc and output_desc:
prompt = f"""Given the following input:
{input_desc}
Please provide output in the following format:
{output_desc}"""
if context:
prompt += f"\n\nAdditional context and requirements:\n{context}"
st.header("Generated Prompt")
st.text_area("Your prompt is ready:", value=prompt, height=300)
# Add copy button
st.code(prompt, language="text")
else:
st.error("Please provide both input and output descriptions to generate a prompt.")
Hi! I can help you with any questions about Streamlit and Python. What would you like to know?