google/dotprompt
Executable GenAI prompt templates
What it solves
Dotprompt provides a standardized, executable file format for Generative AI prompts. It solves the problem of prompts being hard-coded into application logic, which makes them difficult to maintain, version, and share across different programming languages or AI model providers.
How it works
It uses a .prompt file format that combines a YAML frontmatter section for metadata and a Handlebars-based template for the prompt text. Each file is a self-contained entity that includes:
- Model Configuration: Specifies the model to use and its settings (e.g., temperature).
- Input Schema: Defines the structure and types of data the prompt expects.
- Output Format: Specifies the expected output format (such as JSON) and its associated schema for validation.
- Dynamic Templating: Uses Handlebars syntax to insert variables into the prompt text.
Who it’s for
Developers building GenAI applications who want to decouple prompt engineering from application code, ensuring prompts are reusable, structured, and agnostic to the specific model or language used in their project.
Highlights
- Language Agnostic: Implementations available for JavaScript/TypeScript, Python, Go, Rust, and Java.
- IDE Support: Dedicated extensions for VS Code, JetBrains, Vim, and Emacs.
- Executable Units: Prompts can be "run" directly as self-contained entities with their own configuration.
- Structured I/O: Built-in support for input and output schema validation.
Related
- Project
- Project
- Project
- Project
- Project