Spaces:
Running
Running
File size: 1,413 Bytes
cb069fa 16e0909 d39daa5 cb069fa 16e0909 35f1887 16e0909 8416685 16e0909 90c5595 16e0909 d39daa5 16e0909 |
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 |
import streamlit as st
import google.generativeai as genai
# Configure API Key
GOOGLE_API_KEY = st.secrets["GEMINI_API_KEY"]
genai.configure(api_key=GOOGLE_API_KEY)
# Streamlit App Layout
st.title('PromptLab')
# Mode Selection (Shinobi & Raikage)
mode = st.radio("Select a mode:", ["π Shinobi", "β‘ Raikage"], horizontal=True)
# User Input
user_prompt = st.text_area('Enter your prompt:')
# Function to Generate Enhanced Prompt
def generate_enhanced_prompt(user_prompt, mode):
if mode == "π Shinobi":
system_prompt = "You are an expert in structured prompt design. Refine the following prompt for clarity, conciseness, and structured output."
elif mode == "β‘ Raikage":
system_prompt = "You are a world-class AI strategist specializing in execution-focused prompts. Transform the following prompt for high-impact, expert-level results."
# Generate response using Gemini API
response = gemini_model.generate_content(system_prompt + "\n\n" + user_prompt)
return response
# Process User Input
if st.button("Generate Enhanced Prompt"):
if user_prompt.strip():
with st.spinner("Enhancing prompt..."):
enhanced_prompt = generate_enhanced_prompt(user_prompt, mode)
st.subheader("Enhanced Prompt:")
st.code(enhanced_prompt, language='markdown')
else:
st.warning("Please enter a prompt before generating.")
|