入力インジケーター
ボットまたはライブエージェントが要求者への応答を準備しているときに、入力インジケーターを表示します。
仮想エージェントが要求を処理すると、[入力開始インジケーター] アクションが呼び出されます。仮想エージェントが要求の処理を完了すると、仮想エージェント が出力または入力コントロールを処理する前に、入力終了インジケーターアクションが呼び出されます。
これらのアクションは、defaultText コントロールの送信変換を呼び出します。次の例は、defaultText コントロールの送信変換で入力インジケーターがどのように処理されるかを示しています。
例:入力インジケータースクリプト
(function execute(inputs, outputs) {
try {
var richControl = inputs.rich_control;
var actionType = richControl.type;
if(actionType == 'StartTypingIndicatorActionMsg'){
outputs.result = '{activity:{type: "typing" }}'
}else if(actionType == 'EndTypingIndicatorActionMsg'){
outputs.result = '{activity:{type: "message" , text: "Finished typing"}}'
}
/* Handle other type of control */
} catch (e) {
gs.error("Error in default action outbound transformer : " + e.message);
throw e;
}
})