import * as Tp from 'thingpedia'; import * as ThingTalk from 'thingtalk'; import { Ast } from 'thingtalk'; import type Engine from '../../engine'; import * as ParserClient from '../../prediction/parserclient'; import { UserInput } from '../user-input'; import AppExecutor from '../../engine/apps/app_executor'; import ExecutionDialogueAgent from '../execution_dialogue_agent'; import { DialogueLoop, DialogueHandler, CommandAnalysisType, ReplyResult } from '../dialogue-loop'; interface ThingTalkCommandAnalysisType { type: CommandAnalysisType; utterance: string; user_target: string; answer: Ast.Value | number | null; parsed: Ast.Input; } export default class ThingTalkDialogueHandler implements DialogueHandler { priority: Tp.DialogueHandler.Priority; uniqueId: string; icon: string | null; private _; private _engine; private _loop; private _prefs; private _langPack; private _nlu; private _nlg; private _cardFormatter; private _agent; private _policy; private _dialogueState; private _executorState; private _debug; private _useConfidence; private _rng; constructor(engine: Engine, loop: DialogueLoop, agent: ExecutionDialogueAgent, nlu: ParserClient.ParserClient, nlg: ParserClient.ParserClient, options: { debug: boolean; useConfidence: boolean; rng: () => number; }); getState(): string; reset(): void; private _checkPolicy; private _getSpecialThingTalkType; private _prepareContextForPrediction; prepareContextForPrediction(): [string[], ThingTalk.Syntax.EntityMap]; private _maybeGetThingTalkAnswer; analyzeCommand(command: UserInput): Promise; _parseCommand(command: UserInput): Promise; getReply(analyzed: ThingTalkCommandAnalysisType): Promise; private _handleNormalDialogueCommand; getFollowUp(): Promise; private _makeClarificationQuestion; private _executeCurrentState; private _useNeuralNLG; private _doAgentReply; private _showWelcome; initialize(initialState: string | undefined, showWelcome: boolean): Promise; showNotification(app: AppExecutor, outputType: string, outputValue: Record): Promise; showAsyncError(app: AppExecutor, error: Error): Promise; } export {};