The backbone of prompts.maux.site - Generate powerful system prompts from natural language!
This simple script transforms natural language descriptions into structured system prompts for AI assistants, saving you time and effort in prompt engineering.
The magic happens in prompt_builder.py module, which contains carefully crafted system prompts that instruct the AI how to generate new prompts. These "meta-prompts" guide the AI to:
- Analyze your natural language description
- Extract key capabilities, constraints, and requirements
- Structure this information into a formal system prompt with clear sections
it offers three detail levels (concise, medium, detailed) and supports multiple languages, allowing you to generate prompts tailored to your specific needs.
- Install dependencies:
pip install openai python-dotenv- Set your OpenAI API key in a
.envfile:
OPENAI_API_KEY=your_api_key_here
- Generate a prompt:
from services.prompt_service import PromptService
service = PromptService()
result = service.generate(
prompt="a helpful coding assistant",
prompt_length="medium" # Options: "concise", "medium", "detailed"
output_language="fa" # can be English too
)
print(service.format_output(result))You'll get a structured prompt with:
- System prompt
- Instructions
- Constraints
- Output format
- Examples
Save time creating system prompts and ensure consistent, high-quality AI interactions for your applications!