/** * Copyright (c) Microsoft Corporation. All rights reserved. * Licensed under the MIT License. */ import * as BB from 'botbuilder'; import { CLRunner, EntityDetectionCallback, OnSessionStartCallback, OnSessionEndCallback, ICallbackInput } from './CLRunner'; import { ICLOptions } from './CLOptions'; import { CLClient } from './CLClient'; import { CLRecognizerResult } from './CLRecognizeResult'; import * as express from 'express'; export declare class ConversationLearner { static options: ICLOptions | null; static clClient: CLClient; clRunner: CLRunner; static Init(options: ICLOptions, storage?: BB.Storage | null): express.Router; constructor(modelId: string | undefined, maxTimeout?: number); recognize(turnContext: BB.TurnContext, force?: boolean): Promise; /** * OPTIONAL: Sessions are started automatically, StartSession call is only needed if bot needs * to start Conversation Learner Session with initial entity values. * Results in clearing of existing Entity values, and a call to the OnSessionStartCallback * @param turnContext BotBuilder Context */ StartSession(turnContext: BB.TurnContext): Promise; /** * Provide an callback that will be invoked whenever a Session is started * @param target Callback of the form (context: BB.TurnContext, memoryManager: ClientMemoryManager) => Promise */ OnSessionStartCallback(target: OnSessionStartCallback): void; /** * Provide a callback that will be invoked whenever a Session ends. Sessions * can end because of a timeout or the selection of an EndSession activity * @param target Callback of the form (context: BB.TurnContext, memoryManager: ClientMemoryManager, sessionEndState: CLM.SessionEndState, data: string | undefined) => Promise */ OnSessionEndCallback(target: OnSessionEndCallback): void; SendResult(result: CLRecognizerResult): Promise; /** Returns true is bot is running in the Training UI * @param turnContext BotBuilder Context */ InTrainingUI(turnContext: BB.TurnContext): Promise; /** * Define an API callback that can be used by the Model * @param callback Object with callback name, optional logic function, and optional render function. */ AddCallback(callback: ICallbackInput): void; /** Define an Callback that will be called after Entity Detection * @param target Callback of the form (text: string, memoryManager: ClientMemoryManager) => Promise */ EntityDetectionCallback(target: EntityDetectionCallback): void; }