voice.onActionEvent - GiGAGenie-ServiceSDK/UserGuide GitHub Wiki

gigagenie.voice.onActionEvent

API 설명

  • Action 수신 API
  • 등록된 Action 에 대한 수신 Event
  • 등록된 Action 은 대화 SDK에 ActionCode(대화 SDK: Intent명)가 등록되어 있어야 함
  • 현재 실행 중인 appid 에 대한 Action 수신시 Event 를 전달

API 구조

  • function callback(extra)
    • actioncode: 발화 Intent와 동일
    • actionpath: 등록한 이동 Path
    • voicerecid: 화자 인식된 ContainerID 값(인식 안된 경우 "UNKNOWN", 화자식별등록이 안되어 있으면 "NONE" 전달)
    • uword: 발화한 문구
    • parameter: 대화 서버에서 전달하는 parameter JSON 값
  • onActionEvent 콜백이 정의되지 않으면 해당 actionpath 로 자동 이동한다.

사용 예시

gigagenie.voice.onActionEvent=function(extra){
    switch(extra.actioncode){
        case 'QueryHello':
            //QueryHello 처리
            break;
        case 'QueryWorld':
            //QUeryWorld 처리
            break;
        default:
            break;
});