UNPKG

@microsoft/botbuilder-m365

Version:

M365 extensions for Microsoft BotBuilder, Alpha release.

34 lines 1.58 kB
/** * @module botbuilder-m365 */ /** * Copyright (c) Microsoft Corporation. All rights reserved. * Licensed under the MIT License. */ import { TurnContext } from 'botbuilder'; import { PromptManager } from '../Prompts'; import { TurnState } from '../TurnState'; import { Block } from './Block'; /** * Given a prompt, that might contain references to variables and functions: * - Get the list of references * - Resolve each reference * - Variable references are resolved using the context variables * - Function references are resolved invoking those functions * - Functions can be invoked passing in variables * - Functions do not receive the context variables, unless specified using a special variable * - Functions can be invoked in order and in parallel so the context variables must be immutable when invoked within the template */ export declare class PromptTemplateEngine<TState extends TurnState> { private readonly _promptManager; constructor(promptManager: PromptManager<TState>); extractBlocks(templateText?: string, validate?: boolean): Block[]; render(context: TurnContext, state: TState, textOrBlocks: string | Block[]): Promise<string>; renderVariables(context: TurnContext, state: TState, blocks: Block[]): Block[]; renderCode(context: TurnContext, state: TState, blocks: Block[]): Promise<Block[]>; private readonly starter; private readonly ender; private tokenizeInternal; private validateBlocksSyntax; } //# sourceMappingURL=PromptTemplateEngine.d.ts.map