UNPKG

@microsoft/teams-ai

Version:

SDK focused on building AI based applications for Microsoft Teams.

59 lines 2.16 kB
"use strict"; /** * @module teams-ai */ /** * Copyright (c) Microsoft Corporation. All rights reserved. * Licensed under the MIT License. */ Object.defineProperty(exports, "__esModule", { value: true }); exports.DefaultAugmentation = void 0; /** * The default 'none' augmentation. * @remarks * This augmentation does not add any additional functionality to the prompt. It always * returns a `Plan` with a single `SAY` command containing the models response. */ class DefaultAugmentation { /** * @returns {PromptSection|undefined} Returns an optional prompt section for the augmentation. */ createPromptSection() { return undefined; } /** * Validates a response to a prompt. * @param {TurnContext} context - Context for the current turn of conversation with the user. * @param {Memory} memory - An interface for accessing state values. * @param {Tokenizer} tokenizer - Tokenizer to use for encoding and decoding text. * @param {PromptResponse<string>} response - Response to validate. * @param {number} remaining_attempts Number of remaining attempts to validate the response. * @returns {Validation} A `Validation` object. */ validateResponse(context, memory, tokenizer, response, remaining_attempts) { return Promise.resolve({ type: 'Validation', valid: true }); } /** * Creates a plan given validated response value. * @param {TurnContext} context Context for the current turn of conversation. * @param {Memory} memory An interface for accessing state variables. * @param {PromptResponse<string>} response The validated and transformed response for the prompt. * @returns {Promise<Plan>} The created plan. */ createPlanFromResponse(context, memory, response) { return Promise.resolve({ type: 'plan', commands: [ { type: 'SAY', response: response.message } ] }); } } exports.DefaultAugmentation = DefaultAugmentation; //# sourceMappingURL=DefaultAugmentation.js.map