import * as Tp from 'thingpedia'; import { Ast, SchemaRetriever } from 'thingtalk'; import AbstractDialogueAgent, { DeviceInfo, DisambiguationHints } from '../abstract_dialogue_agent'; import { EntityRecord } from '../entity-linking/entity-finder'; import ValueCategory from '../value-category'; import StatementSimulator, { ThingTalkSimulatorState } from './statement_simulator'; import { SimulationDatabase } from './types'; export interface SimulationDialogueAgentOptions { schemaRetriever?: SchemaRetriever; thingpediaClient?: Tp.BaseClient; locale: string; timezone: string | undefined; rng: () => number; database?: SimulationDatabase; overrides?: Map; interactive: boolean; } /** * The dialogue agent used at simulation time. * * This is a completely stateless class, as it handles many possible dialogues at the same * time. */ export default class SimulationDialogueAgent extends AbstractDialogueAgent { private _executor; private _rng; private _database?; private _interactive; constructor(options: SimulationDialogueAgentOptions); protected get executor(): StatementSimulator; protected configureNotifications(): Promise; protected checkForPermission(stmt: Ast.ExpressionStatement): Promise; protected getAllDevicesOfKind(kind: string): Promise; protected tryConfigureDevice(kind: string): Promise; disambiguate(type: string, name: string | null, choices: string[], hint?: string): Promise; lookupContact(category: ValueCategory, name: string): Promise; protected addDisplayToContact(contact: Ast.EntityValue): Promise; askMissingContact(category: ValueCategory, name: string): Promise; protected lookupLocation(searchKey: string, previousLocations: Ast.AbsoluteLocation[]): Promise; private _getIDs; protected resolveEntity(entityType: string, entityDisplay: string, hints: DisambiguationHints): Promise; protected resolveUserContext(variable: string): Promise; getPreferredUnit(type: string): string; }