import streamlit as st import pandas as pd import random import json # Set page configuration st.set_page_config(page_title="ChatGPT Prompt Generator", page_icon="đ§ ", layout="wide") # Custom CSS for styling st.markdown(""" """, unsafe_allow_html=True) # Initialize session state if 'selections' not in st.session_state: st.session_state.selections = { 'role': None, 'tone': None, 'instruction': None, 'length': None, 'content_type': None, 'audience': None, 'format': None, 'about': "", 'inclusion': "", 'exclusion': "", 'input_data': "" } # Data sets with emoji and names data = { 'roles': [ {"name": "Professional", "emoji": "đ"}, {"name": "Expert", "emoji": "đ§ "}, {"name": "Friend", "emoji": "đ¤"}, {"name": "Copywriter", "emoji": "âī¸"}, {"name": "Creative Writer", "emoji": "đī¸"}, {"name": "Sales Coach", "emoji": "đŧ"}, {"name": "Marketing Coach", "emoji": "đ"}, {"name": "Tech Consultant", "emoji": "đģ"}, {"name": "Life Coach", "emoji": "đ§"}, {"name": "Data Analyst", "emoji": "đ"}, {"name": "Influencer", "emoji": "đą"}, {"name": "Language Tutor", "emoji": "đŖī¸"}, {"name": "Fitness Trainer", "emoji": "đĒ"}, {"name": "Teacher", "emoji": "đ¨âđĢ"}, {"name": "Therapist", "emoji": "đ§"}, {"name": "Detective", "emoji": "đ"} ], 'tones': [ {"name": "Informative", "emoji": "âšī¸"}, {"name": "Inspirational", "emoji": "â¨"}, {"name": "Humorous", "emoji": "đ"}, {"name": "Friendly", "emoji": "đ"}, {"name": "Professional", "emoji": "đ"}, {"name": "Casual", "emoji": "đ"}, {"name": "Persuasive", "emoji": "đ¤"}, {"name": "Encouraging", "emoji": "đ"}, {"name": "Empathetic", "emoji": "đ¤"}, {"name": "Serious", "emoji": "đ"}, {"name": "Enthusiastic", "emoji": "đ¤Š"}, {"name": "Thoughtful", "emoji": "đ"} ], 'instructions': [ {"name": "Create", "emoji": "đ¨"}, {"name": "Suggest", "emoji": "đĄ"}, {"name": "Write", "emoji": "âī¸"}, {"name": "Compose", "emoji": "đ"}, {"name": "Analyze", "emoji": "đ"}, {"name": "Explain", "emoji": "đ"}, {"name": "Describe", "emoji": "đ"}, {"name": "Summarize", "emoji": "đ"}, {"name": "Compare", "emoji": "âī¸"}, {"name": "Outline", "emoji": "đ"}, {"name": "Evaluate", "emoji": "â"}, {"name": "List", "emoji": "đ"} ], 'lengths': [ {"name": "300 Words", "emoji": "đ"}, {"name": "500 Words", "emoji": "đ"}, {"name": "Short", "emoji": "đŠŗ"}, {"name": "Medium", "emoji": "đ"}, {"name": "Long", "emoji": "đ"}, {"name": "Brief", "emoji": "đ¨"}, {"name": "Detailed", "emoji": "đ"}, {"name": "Comprehensive", "emoji": "đ"} ], 'content_types': [ {"name": "Article", "emoji": "đ°"}, {"name": "Blog post", "emoji": "đ"}, {"name": "Guide", "emoji": "đ"}, {"name": "Email", "emoji": "đ§"}, {"name": "Summary", "emoji": "đ"}, {"name": "Story", "emoji": "đ"}, {"name": "Essay", "emoji": "đ"}, {"name": "Review", "emoji": "â"}, {"name": "Tutorial", "emoji": "đ¨âđĢ"}, {"name": "Report", "emoji": "đ"}, {"name": "Plan", "emoji": "đ"}, {"name": "Script", "emoji": "đŦ"} ], 'audiences': [ {"name": "Beginners", "emoji": "đą"}, {"name": "Experts", "emoji": "đ§ "}, {"name": "Students", "emoji": "đ"}, {"name": "Professionals", "emoji": "đ"}, {"name": "Business Owners", "emoji": "đŧ"}, {"name": "General Public", "emoji": "đĨ"}, {"name": "Developers", "emoji": "đģ"}, {"name": "Children", "emoji": "đļ"} ], 'formats': [ {"name": "Markdown", "emoji": "đ"}, {"name": "HTML", "emoji": "đ"}, {"name": "Plain Text", "emoji": "đ"}, {"name": "JSON", "emoji": "đ"}, {"name": "PDF", "emoji": "đ"}, {"name": "Python Code", "emoji": "đ"}, {"name": "JavaScript", "emoji": "đ"}, {"name": "SQL Query", "emoji": "đž"} ] } # Function to convert data to dataframe rows def create_dataframe_rows(items, cols=4): # Calculate how many rows we need based on items and columns num_rows = (len(items) + cols - 1) // cols # Create empty rows rows = [["" for _ in range(cols)] for _ in range(num_rows)] # Fill in the values for i, item in enumerate(items): row_idx = i // cols col_idx = i % cols rows[row_idx][col_idx] = f"{item['emoji']} {item['name']}" return rows # Function to handle cell click events def handle_selection(category, value): # Extract the name without emoji parts = value.split(' ', 1) if len(parts) < 2: return emoji = parts[0] name = parts[1] # Find the item in the data for item in data[f"{category}s"]: if item['name'] == name: st.session_state.selections[category] = item return # If not found (shouldn't happen) st.session_state.selections[category] = {"name": name, "emoji": emoji} # Function to create dataframe with click handler def create_dataframe_category(category, title, emoji_prefix): # Create the dataframe content df_rows = create_dataframe_rows(data[f"{category}s"], cols=4) df = pd.DataFrame(df_rows) # Display the category header st.markdown(f"
Act as a đ¨âđĢ Teacher, use đ Informative tone, Create a đ Guide for đą Beginners. It should be about Git. Include practical examples. Exclude advanced techniques. Return as đ Markdown.
Act as a đ Professional, use đ¤ Persuasive tone, Write a đ§ Email for đŠâđŧ Executives. It should be about a product launch. Include ROI metrics. Exclude technical details. Return as đ Plain Text.