Typing indicators

  • 릴리스 버전: Australia
  • 업데이트 날짜 2026년 03월 12일
  • 소요 시간: 1분
  • Display a typing indicator when a bot or live agent is preparing a response to a requester.

    When Virtual Agent processes a request, the Start typing indicator action is called. When Virtual Agent completes the request processing, the End typing indicator action is called before Virtual Agent processes any output or input controls.

    These actions call the defaultText control outbound transformation. The following example shows how the typing indicator is handled in the defaultText control outbound transformation.

    Example: Typing indicator script
    (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;
        }
    })