@microsoft/teams-ai
Version:
SDK focused on building AI based applications for Microsoft Teams.
67 lines • 2.4 kB
TypeScript
/**
* @module teams-ai
*/
/**
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License.
*/
import { TurnContext } from 'botbuilder';
import { InputFile, InputFileDownloader } from './InputFileDownloader';
import { TeamsAdapter } from './TeamsAdapter';
import { TurnState } from './TurnState';
/**
* Options for the `TeamsAttachmentDownloader` class.
*/
export interface TeamsAttachmentDownloaderOptions {
/**
* The Microsoft App ID of the bot.
*/
botAppId: string;
/**
* ServiceClientCredentialsFactory
*/
adapter: TeamsAdapter;
}
export interface AuthenticatorResult {
/**
* The value of the access token resulting from an authentication process.
*/
accessToken: string;
/**
* The date and time of expiration relative to Coordinated Universal Time (UTC).
*/
expiresOn: Date;
}
/**
* Downloads attachments from Teams using the bots access token.
*/
export declare class TeamsAttachmentDownloader<TState extends TurnState = TurnState> implements InputFileDownloader<TState> {
private readonly _options;
private _httpClient;
/**
* Creates a new instance of the `TeamsAttachmentDownloader` class.
* @param {TeamsAttachmentDownloader} options - Options for the `TeamsAttachmentDownloader` class.
*/
constructor(options: TeamsAttachmentDownloaderOptions);
/**
* Download any files relative to the current user's input.
* @template TState - Type of the state object passed to the `TurnContext.turnState` method.
* @param {TurnContext} context Context for the current turn of conversation.
* @param {TState} state Application state for the current turn of conversation.
* @returns {Promise<InputFile[]>} Promise that resolves to an array of downloaded input files.
*/
downloadFiles(context: TurnContext, state: TState): Promise<InputFile[]>;
/**
* @private
* @param {Attachment} attachment - Attachment to download.
* @param {string} accessToken - Access token to use for downloading.
* @returns {Promise<InputFile>} - Promise that resolves to the downloaded input file.
*/
private downloadFile;
/**
* @private
* @returns {Promise<string>} - Promise that resolves to the access token.
*/
private getAccessToken;
}
//# sourceMappingURL=TeamsAttachmentDownloader.d.ts.map