compileResponse
Stentor API Reference / stentor-response/src / compileResponse
Function: compileResponse()
compileResponse(
response,request,context,additionalContext?,macros?):Response
Defined in: packages/stentor-response/src/compileResponse.ts:36
Compiles a templated response with provided request and context.
In order for the template to compile, it must contain ${} with json paths within the mustaches. For example, a string such as:
"Hello ${ $.request.slots.NAME.value }"
will be transformed to "Hello Bob" when passed an intent request with a slot "NAME" and value "Bob"
Parametersβ
responseβ
Response to be compiled
requestβ
Request to pull information from for compilation
contextβ
Context to pull information from for compilation
additionalContext?β
Record\<string, unknown>
Additional, optional, context to pull information from for compilation
macros?β
MacroMap