import { Ast } from 'thingtalk'; import { ContextTable } from '../sentence-generator/types'; import ThingpediaLoader from './load-thingpedia'; export * as Templates from './dialogue.genie.out'; import { $load } from './dialogue.genie.out'; export { $load as initializeTemplates }; /** * This module defines the basic logic of transaction dialogues: how * the dialogue is started, how the agent handles each state, and how * the agent follows up. */ /** * Metadata about this dialogue policy */ export declare const MANIFEST: { readonly name: "org.thingpedia.dialogue.transaction"; readonly dialogueActs: { readonly user: readonly ["greet", "reinit", "execute", "ask_recommend", "insist", "learn_more", "action_question", "cancel", "end", "notification", "init"]; readonly agent: readonly ["sys_greet", "sys_search_question", "sys_generic_search_question", "sys_slot_fill", "sys_recommend_one", "sys_recommend_two", "sys_recommend_three", "sys_recommend_four", "sys_recommend_many", "sys_display_result", "sys_propose_refined_query", "sys_learn_more_what", "sys_empty_search_question", "sys_empty_search", "sys_confirm_action", "sys_action_success", "sys_action_error_question", "sys_action_error", "sys_rule_enable_success", "sys_anything_else", "sys_end", "sys_record_command"]; readonly withParam: readonly ["action_question", "notification", "sys_search_question", "sys_slot_fill", "sys_empty_search_question", "sys_action_error_question"]; }; readonly terminalAct: "sys_end"; }; /** * Extract all the relevant context phrases for the given state. * * The context phrases will be used to generate the agent reply, * and are mapped to the context non-terminals defined in dialogue.genie. * * At a high-level, this function maps a concrete dialogue state * (produced by the simulation or the neural network) * to an abstract dialogue state defined in the state machine, and extracts * auxiliary phrases used to construct the reply. */ export declare function getContextPhrasesForState(state: Ast.DialogueState | null, tpLoader: ThingpediaLoader, contextTable: ContextTable): import("../sentence-generator/types").ContextPhrase[] | null; /** * Handle answers generated from the UI. * * This function converts the answer to the appropriate dialogue state at this turn, * if possible, or returns `null` to signal failure. */ export declare function interpretAnswer(state: Ast.DialogueState, answer: Ast.Value, tpLoader: ThingpediaLoader, contextTable: ContextTable): Ast.DialogueState | null; /** * Handle notifications. * * This function prepares a dialogue state suitable for displaying a notification. */ export declare function notification(appName: string | null, program: Ast.Program, result: Ast.DialogueHistoryResultItem): Ast.DialogueState; export declare function notifyError(appName: string | null, program: Ast.Program, error: Ast.Value): Ast.DialogueState; /** * Compute the initial state of the dialogue. */ export declare function initialState(tpLoader: ThingpediaLoader): Ast.DialogueState | null; /** * Compute a possible agent follow up to the given state. * * @deprecated This function is bad and needs to be refactored out. */ export declare function getFollowUp(state: Ast.DialogueState, tpLoader: ThingpediaLoader, contextTable: ContextTable): Ast.DialogueState | null;