Prompt ($)
The $
is a JavaScript tagged template that expands the string into the final prompt.
$`You are a helpful assistant.`
👤 user
You are a helpful assistant.
Inline expressions
You can weave expressions in the template using ${...}
. Expression can be promises and will be awaited when rendering the final prompt.
$`Today is ${new Date().toDateString()}.`
👤 user
Today is Thu Jun 13 2024.