A tool for generating prompt libraries for use with Large Language Models (LLMs) like Gemini, particularly designed for Open Web UI integration.
This tool uses the Gemini API to generate collections of prompts based on user-specified topics. It's designed to help create prompt libraries that can be easily accessed via slash commands in Open Web UI, reducing repetitive data entry when interacting with LLMs.
- Interactive Prompt Generation: Specify the topic and number of prompts you want to generate
- Descriptive Filenames: Automatically creates filenames based on the prompt topic
- Dedicated Output Folder: Saves all generated prompts in a "created-prompts" folder
- Multiple Output Formats: Generates both JSON and CSV formats for easy importing
- Variable Formatting: Uses double curly brackets for variables (e.g.,
{{variable_name}}) - Customizable: Easily modify the system prompt to change the style of generated prompts
- Clone this repository
- Create a virtual environment:
python -m venv .venv source .venv/bin/activate - Install the required packages:
pip install google-generativeai python-dotenv
- Create a
.envfile in the root directory with your Gemini API key:GEMINI_API_KEY="your_api_key_here"
-
Activate the virtual environment:
source .venv/bin/activate -
Run the prompt generator:
cd as-code/v2 python prompt.py -
Follow the interactive prompts:
- Enter the type of prompts you want to generate (e.g., "Python programming", "Job search")
- Specify how many prompts you want to generate
- Choose whether to view the generated prompts after creation
-
The generated prompts will be saved in the
created-promptsfolder in both JSON and CSV formats with descriptive filenames (e.g.,python-programming-prompts.json).
The tool generates prompts in this format:
[
{
"Prompt name": "Formal Tone",
"Prompt text": "Rewrite the following text in a formal tone: {{text}}",
"Slash command": "/formalize"
},
{
"Prompt name": "Simplify Text",
"Prompt text": "Simplify the following text, making it easier to understand: {{text}}",
"Slash command": "/simplify"
}
]as-code/v2/prompt.py: Main script for generating promptscreated-prompts/: Directory containing all generated prompt files.env: Environment file for storing your Gemini API key
MIT