import * as Tp from 'thingpedia'; import { Ast, Type, SchemaRetriever } from 'thingtalk'; import { EntityMap } from '../utils/entity-utils'; interface DialoguePolicyOptions { thingpedia: Tp.BaseClient; schemas: SchemaRetriever; locale: string; timezone: string | undefined; extraFlags: Record; anonymous: boolean; policyModule?: string; rng: () => number; debug: number; } interface PolicyResult { state: Ast.DialogueState; end: boolean; expect: Type | null; raw: boolean; utterance: string; entities: EntityMap; numResults: number; } export default class DialoguePolicy { private _thingpedia; private _schemas; private _locale; private _timezone; private _langPack; private _rng; private _debug; private _anonymous; private _extraFlags; private _sentenceGenerator; private _generatorDevices; private _generatorOptions; private _entityAllocator; private _policyModuleName; private _policyModule; constructor(options: DialoguePolicyOptions); initialize(): Promise; private _initializeGenerator; private _extractDevices; private _ensureGeneratorForState; handleAnswer(state: Ast.DialogueState | null, value: Ast.Value): Promise; private _generateDerivation; chooseAction(state: Ast.DialogueState | null): Promise; getFollowUp(state: Ast.DialogueState): Promise; getNotificationState(appName: string | null, program: Ast.Program, result: Ast.DialogueHistoryResultItem): Promise; getAsyncErrorState(appName: string | null, program: Ast.Program, error: Ast.Value): Promise; getInitialState(): Promise; } export {};