UNPKG

@xapp/chat-widget

Version:
21 lines (20 loc) 937 B
import 'rollup-plugin-inject-process-env'; import { RequestSlotMap, ResponseOutput } from "./models"; /** * Compiles a templated response with slot values from the * provided slot map. * * For example, when passed "What date do you want your ${flowers}?" * and the slot map contains a slot with name `flowers` it will replace * it with the value. * * It will handle the different potential value types for slots such as * strings, numbers, dates and durations. * * By default, if the slot value does not exist, the template value is left untouched. * * @param responseOutput * @param slots * @param replaceWhenUndefined - When set to true, it will replace the value with 'undefined' if it doesn't exist, default behavior is to leave the template as is. */ export declare function compileSlotValues(responseOutput: string | ResponseOutput, slots: RequestSlotMap, replaceWhenUndefined?: boolean): string | ResponseOutput;