Prompt Partials
Last updated
Was this helpful?
Last updated
Was this helpful?
This feature is available on all Portkey .
With Prompt Partials, you can save your commonly used templates (which could be your instruction set, data structure explanation, examples etc.) separately from your prompts and flexibly incorporate them wherever required.
Partials can also serve as a global variable store. You can define common variables that are used across multiple of your prompt template and can reference or update them easily.
Partials are directly accessible from the Prompts Page:
You can create a new Partial and use it for any purpose in any of your prompt templates. For example, here's a prompt partial where we are separately storing the instructions:
Upon saving, each Partial generates a unique ID that you can use inside prompt templates.
Portkey supports {{variable}}
, {{#block}} <string> {{/block}}
, {{^block}}
and other tags.
Portkey follow the same Update
& Publish
flow as prompt templates. You can keep updating the partial and save new versions, and choose to send any version to prod using the Publish
feature.
All the version history for any partial is available on the right column and any previous version can be restored to be latest
or published
to prod easily.
You can call Partials by their ID inside any prompt template by just starting to type {{>
Portkey lists all of the available prompt partials with their names to help you easily pick.
When a partial is incorporated in a template, all the variables/blocks defined are also rendered on the Prompt variables section:
When a new Partial version is Published, your partial that is in use in any of the prompt templates also gets automatically updated.
All the variables/tags defined inside the partial can now be directly called at the time of making a prompts.completion
request:
Partials also follow the and let you easily handle data input at runtime by using tags.
.