import { Ast } from 'thingtalk'; /** * Normalize the #[confirm] annotation. * * #[confirm] is a three-state enum annotation with values: * - #[confirm=enum(confirm)]: must confirm explicitly with all parameters before the * function is called (using a statement with #[confirm=enum(confirmed)] annotation) * - #[confirm=enum(display_result)]: the result of any query that feeds into the parameters * of this function should be displayed before the function is executed; this is encoded * by splitting any compound statement into two statements, executed sequentially * - #[confirm=enum(auto)]: the function can be called without explicit confirmation, even * if some of the parameters are coming from other functions; this is the only #[confirm] * that allows the function to be called multiple times in a single statement * * For legacy/ease of development reasons, if unspecified #[confirm] defaults to "confirm" * for actions (full confirmation before executing side effects) and "display_result" for * queries (splitting table joins into two statements). * * Also, #[confirm] can be specified as a boolean: "true" means "confirm" and "false" means * "display_result". */ export declare function normalizeConfirmAnnotation(fndef: Ast.FunctionDef): 'confirm' | 'display_result' | 'auto'; export declare function shouldAutoConfirmStatement(stmt: Ast.ExpressionStatement): boolean; /** * Compute the information that the neural network must predict to compute the new state * in a turn. * * This applies to either the network interpreting the user input, the one controlling the * dialogue policy. * * This should return a new state, roughly corresponding to the * delta between `oldState` and `newState`. * Neither `oldState` nor `newState` must be modified in-place. * * @param {ThingTalk.Ast.DialogueState|null} oldState - the previous dialogue state, before the turn * @param {ThingTalk.Ast.DialogueState} newState - the new state of the dialogue, after the turn * @param {string} forTarget - who is speaking now: either `user` or `agent` */ export declare function computePrediction(oldState: Ast.DialogueState | null, newState: Ast.DialogueState, forTarget: 'user' | 'agent'): Ast.DialogueState; export declare function computeNewState(state: Ast.DialogueState | null, prediction: Ast.DialogueState, forTarget: 'user' | 'agent'): Ast.DialogueState; export declare function prepareContextForPrediction(context: Ast.DialogueState | null, forTarget: 'user' | 'agent'): Ast.DialogueState | null;