입력 표시기
봇 또는 라이브 에이전트가 요청자에 대한 응답을 준비할 때 입력 표시기를 표시합니다.
요청을 처리할 때 가상 에이전트 입력 시작 표시기 작업이 호출됩니다. 가상 에이전트 요청 처리가 완료되면 출력 또는 입력 제어를 처리하기 전에 가상 에이전트 입력 종료 표시기 조치가 호출됩니다.
이러한 작업은 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;
}
})