@microsoft/teams-ai
Version:
SDK focused on building AI based applications for Microsoft Teams.
39 lines • 1.87 kB
TypeScript
/**
* @module teams-ai
*/
/**
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License.
*/
import { TaskModuleTaskInfo, TurnContext } from 'botbuilder';
import { Application } from './Application';
import { TurnState } from './TurnState';
export declare enum MessageInvokeNames {
FETCH_INVOKE_NAME = "message/fetchTask"
}
/**
* TaskModules class to enable fluent style registration of handlers related to Task Modules.
* @template TState Type of the turn state object being persisted.
*/
export declare class Messages<TState extends TurnState> {
private readonly _app;
/**
* Creates a new instance of the TaskModules class.
* @param {Application} app Top level application class to register handlers with.
*/
constructor(app: Application<TState>);
/**
* Registers a handler to process the initial fetch of the task module.
* @remarks
* Handlers should respond with either an initial TaskInfo object or a string containing
* a message to display to the user.
* @template TData Optional. Type of the data object being passed to the handler.
* @param {(context: TurnContext, state: TState, data: TData) => Promise<TaskModuleTaskInfo | string>} handler - Function to call when the handler is triggered.
* @param {TurnContext} handler.context - Context for the current turn of conversation with the user.
* @param {TState} handler.state - Current state of the turn.
* @param {TData} handler.data - Data object passed to the handler.
* @returns {Application<TState>} The application for chaining purposes.
*/
fetch<TData extends Record<string, any> = Record<string, any>>(handler: (context: TurnContext, state: TState, data: TData) => Promise<TaskModuleTaskInfo | string>): Application<TState>;
}
//# sourceMappingURL=Messages.d.ts.map