-
Notifications
You must be signed in to change notification settings - Fork 50
Open
Labels
Description
To allow prompts to annotate themselves with metadata, I propose two additions:
1. A metadata hash argument for the role and media helpers
{{role "system" metadata.foo="bar"}}
{{media url="..." metadata.foo="bar"}}Note: I believe the metadata.foo syntax style is necessary because Handlebars doesn't support object literals. The algorithm should be to iterate through hash arguments for anything beginning with metadata.* and add each of those as metadata keys. Metadata should be merged with existing metadata (if any).
2. A newPart helper.
This helper creates a new text part with optional metadata:
{{newPart metadata.foo="bar"}}This allows the user to create custom "sections" within their prompt for better observability and understanding.
Fox32