dotprompt  by google

Executable GenAI prompt templates

Created 1 year ago
314 stars

Top 85.7% on SourcePulse

GitHubView on GitHub
1 Expert Loves This Project
Project Summary

Dotprompt provides an executable prompt template file format for Generative AI, designed for language and model provider agnosticism. It extends Handlebars with GenAI-specific features, allowing prompts to include metadata for model configuration, input requirements, and output formatting, making them self-contained and directly runnable units. This streamlines AI interactions, ensuring consistency and simplifying prompt management for developers.

How It Works

Dotprompt files combine prompt text with YAML frontmatter containing metadata. This metadata specifies the AI model to use, its configuration (like temperature and max tokens), the expected input schema, and the desired output format. The prompt text itself uses Handlebars syntax for dynamic content insertion. This approach treats each .prompt file as an executable entity, encapsulating all necessary information to run a prompt without requiring extensive in-code configuration.

Quick Start & Requirements

  • Installation: npm i genkit @genkit-ai/googleai
  • Prerequisites: Node.js, Google AI API key (set as GOOGLE_API_KEY environment variable or passed to googleAI()).
  • Setup: Initialize Genkit with the GoogleAI provider and Dotprompt plugin.
  • Docs: Firebase Genkit

Highlighted Details

  • Extends Handlebars for dynamic prompt content.
  • Supports structured input and output schemas for validation.
  • Enables model configuration directly within the prompt file.
  • Treats prompts as self-contained, executable units.

Maintenance & Community

The project is part of the Firebase Genkit SDK. Further implementation details and community resources can be found via the Genkit documentation.

Licensing & Compatibility

The specific license for Dotprompt itself is not detailed in the provided README, but its integration with Genkit suggests it aligns with Genkit's licensing. Genkit is typically Apache 2.0 licensed, allowing for commercial use.

Limitations & Caveats

The README focuses on a Node.js/TypeScript implementation using GoogleAI. While designed for model-agnosticism, the primary example and installation instructions are tied to specific Google services, and support for other model providers or language implementations would require consulting the separate "List of Implementations."

Health Check
Last Commit

2 days ago

Responsiveness

Inactive

Pull Requests (30d)
11
Issues (30d)
4
Star History
22 stars in the last 30 days

Explore Similar Projects

Feedback? Help us improve.