-
Notifications
You must be signed in to change notification settings - Fork 623
Closed
Labels
featureNew feature or requestNew feature or request
Description
Handlebars partials make composition easy, and we should support it in Dotprompt. Proposed implementation:
- Partials are stored in the prompt directory and prefixed with a
_. - Partials do not have YAML frontmatter.
- Partials are available to all prompts by name (omitting the
_). - Partials follow standard Handlebars conventions for passing arguments etc.
Let's say I have information about the user that I want to include in many prompts. I create _userMeta.prompt in my prompts directory with the following content:
== User Information
Name: {{name}}
Email: {{email}}
Birthday: {{birthday}}I can then use this in any other prompt by passing in appropriate context data:
---
model: vertexai/gemini-1.5-flash-preview
input:
schema:
user:
name: string
email: string
birthday: string
---
{{> userMeta user}}
== Instructions
This is specific to the current prompt but I didn't have to copy/paste the user meta stuff.gspencergoog
Metadata
Metadata
Assignees
Labels
featureNew feature or requestNew feature or request