Skip to content

PromptScript API


Function: interpolateText()

interpolateText(text, ctx): string

Defined in: core/src/template.ts:210

Interpolate template variables in a text string.

Parameters

text

string

Text containing {{variable}} placeholders

ctx

TemplateContext

Template context with bound parameters

Returns

string

Interpolated text

Throws

UndefinedVariableError if a variable is used but not defined