Learn how to reference other prompts in PromptL
<prompt path="..." />
tag. The path
attribute specifies the relative or absolute path to the referenced prompt.
<prompt>
tag.
policies.promptl
and passes the assistant_name
variable.assistant_name
variable is interpolated in the referenced prompt.referenceFn
function to define how PromptL should locate and load referenced prompts.
You can structure your prompts in any way you like, as long as your referenceFn
can find and load them. Some examples include:
referenceFn
referenceFn
referenceFn
to the render
function:
referenceFn
to fit your storage solution.prompts/policies.promptl
).path
in the <prompt>
tag matches the actual file structure.console.log()
in referenceFn
to verify the correct prompt is being loaded.referenceFn
to handle missing or unreadable prompts gracefully: