Snippets allow you to modularize and reuse pieces of your prompt templates, much like using building blocks to create a larger structure. This feature enables you to compose complex templates by referencing other prompt templates within a parent template.
When you run a parent template that contains snippets, the system ‘renders’ the template, replacing the snippet references with their actual content. This transpilation occurs whether you run the template from the Playground, use the Evaluation functionality, or retrieve it through the SDKs, providing you with a fully realized version of your prompt.Rendering snippets from the Playground
When editing a prompt that contains snippets, you’ll see the snippet references as strings in the format described above, depending on how you’ve chosen to reference them.When you open a prompt template from the Registry, you’ll see it as a clickable pill that will take you to the referenced version.Navigating to a snippet
By leveraging snippets, you can create a more maintainable and scalable prompt management system, allowing for greater flexibility and efficiency in your prompt template creation process.