You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Prompts, particularly system prompts, are often composed of multiple sections, each with a different purpose.
For example, a system prompt for a data analysis task could include sections about the format of the input data, the kind of data analysis to be performed, and the format of the output data. Each of these sections could be reusable for other tasks. For YouTube video transcript analysis, I often include a snippet about providing references and bookmark URLs using timecode so that I can go to the referenced section of video. I'd love to be able to reuse that snippet in different projects.
The simplest way to implement this functionality is to allow multiple prompts to be provided on the command line. However, that approach doesn't really support reusability.
Reusability is more practical using prompt templates. The simplest template-based approach would be to provide a list of templates on command line and concatenate the prompt in order. There's a challenge with prompt parameters, but that could be addressed by optionally using the template name as a prefix (e.g., $template.param). The exact syntax would depend on the implementation of variable substitution.
In addition to allowing specifying multiple templates on command line, the ideal approach would allow templates to reference other templates, allowing for template composition much like the kind used in documents in Django and Jinja2. That would allow (possibly composite) templates to be used in the same way "primitive" templates are used today.
I can't see a straightforward application of an existing template implementation to this task, unfortunately. There would need to be a way to support the features already in the YAML template implementation (like setting the llm model, for example). Maybe that could be done in frontmatter. Then there's template parameters, don't know how those would work if templates can reference subtemplates. Perhaps parameters could be passed to subtemplates as key value pairs in a template expression?
The text was updated successfully, but these errors were encountered:
Prompts, particularly system prompts, are often composed of multiple sections, each with a different purpose.
For example, a system prompt for a data analysis task could include sections about the format of the input data, the kind of data analysis to be performed, and the format of the output data. Each of these sections could be reusable for other tasks. For YouTube video transcript analysis, I often include a snippet about providing references and bookmark URLs using timecode so that I can go to the referenced section of video. I'd love to be able to reuse that snippet in different projects.
The simplest way to implement this functionality is to allow multiple prompts to be provided on the command line. However, that approach doesn't really support reusability.
Reusability is more practical using prompt templates. The simplest template-based approach would be to provide a list of templates on command line and concatenate the prompt in order. There's a challenge with prompt parameters, but that could be addressed by optionally using the template name as a prefix (e.g., $template.param). The exact syntax would depend on the implementation of variable substitution.
In addition to allowing specifying multiple templates on command line, the ideal approach would allow templates to reference other templates, allowing for template composition much like the kind used in documents in Django and Jinja2. That would allow (possibly composite) templates to be used in the same way "primitive" templates are used today.
I can't see a straightforward application of an existing template implementation to this task, unfortunately. There would need to be a way to support the features already in the YAML template implementation (like setting the llm model, for example). Maybe that could be done in frontmatter. Then there's template parameters, don't know how those would work if templates can reference subtemplates. Perhaps parameters could be passed to subtemplates as key value pairs in a template expression?
The text was updated successfully, but these errors were encountered: