Tuesday, September 30, 2025
AIPROMP GENERATOR TOOL
import random
# Define a list of prompt templates
prompt_templates = [
    "Generate a story about {topic} in {style} style.",
    "Write a poem about {topic} from the perspective of {perspective}.",
    "Create a character sketch of {character} with {trait} trait.",
    "Describe a scenario where {scenario} happens and {outcome} occurs.",
    "Imagine a world where {world} exists and {phenomenon} occurs."
]
# Define a list of topics, styles, perspectives, characters, traits, scenarios, outcomes, worlds, and phenomena
topics = ["space exploration", "artificial intelligence", "climate change", "human relationships", "personal growth"]
styles = ["futuristic", "romantic", "realistic", "surrealistic", "humorous"]
perspectives = ["a robot", "a scientist", "a philosopher", "a poet", "a child"]
characters = ["a superhero", "a historical figure", "a fictional character", "a mythical creature", "a ordinary person"]
traits = ["bravery", "intelligence", "creativity", "empathy", "ambition"]
scenarios = ["a natural disaster", "a technological breakthrough", "a social movement", "a personal struggle", "a chance encounter"]
outcomes = ["a new beginning", "a great success", "a profound realization", "a difficult challenge", "a unexpected twist"]
worlds = ["a utopia", "a dystopia", "a fantasy realm", "a parallel universe", "a post-apocalyptic world"]
phenomena = ["gravity no longer exists", "time travel is possible", "AI surpasses human intelligence", "humans can fly", "the environment is perfectly balanced"]
def generate_prompt():
    template = random.choice(prompt_templates)
    
    if "{topic}" in template:
        topic = random.choice(topics)
    else:
        topic = ""
        
    if "{style}" in template:
        style = random.choice(styles)
    else:
        style = ""
        
    if "{perspective}" in template:
        perspective = random.choice(perspectives)
    else:
        perspective = ""
        
    if "{character}" in template:
        character = random.choice(characters)
    else:
        character = ""
        
    if "{trait}" in template:
        trait = random.choice(traits)
    else:
        trait = ""
        
    if "{scenario}" in template:
        scenario = random.choice(scenarios)
    else:
        scenario = ""
        
    if "{outcome}" in template:
        outcome = random.choice(outcomes)
    else:
        outcome = ""
        
    if "{world}" in template:
        world = random.choice(worlds)
    else:
        world = ""
        
    if "{phenomenon}" in template:
        phenomenon = random.choice(phenomena)
    else:
        phenomenon = ""
        
    prompt = template.format(topic=topic, style=style, perspective=perspective, character=character, trait=trait, scenario=scenario, outcome=outcome, world=world, phenomenon=phenomenon)
    
    return prompt
print(generate_prompt())
Subscribe to:
Comments (Atom)