A template expression with 'a' prefixed to the prompt along with the context preword (which defaults to 'Generate')
Optional
options: TemplateExpressionOptionsconst { context, a } = ad(model)
const assistant = context('You are a helpful assistant')
const template = assistant`{
"petName": "${a('good name for a cat')}"
}`
The prompt in the expression will be "Generate a good name for a cat"
Set a common system prompt and preprompt, as well as common configuration (TemplateExpressionOptions) for child templates.
Optional
preprompt: stringOptional
config: TemplateContextOptionsA template expression with an unaltered prompt - the context preword is ignored
Optional
options: TemplateExpressionOptionsLike a but with 'the' prefixed and defaults to 'What is' for the context preword
Optional
options: TemplateExpressionOptionsconst { context, a, prompt } = ad(model)
const assistant = context('You are a helpful assistant')
const template = assistant`{
"petName": "${a('good name for a cat')}",
"hairs": ${prompt('How many hairs does this cat have?')}
}`
Generated using TypeDoc
Template context creator and template creation helpers