import { MessageData , NlpResult , IncomingSlotData } from '../types' ; import { setMessageData , setDefaultAbility , fillSlot , startIntakeStage } from '../actions' ; import { Store , Dispatch , Action } from 'redux' ; const logState = require ( 'debug' ) ( 'wolf:s1:enterState' ) ; const log = require ( 'debug' ) ( 'wolf:s1' ) ; param nlpResult returns export default function intake ( { dispatch , getState } , nlpResult , incomingSlotData , defaultAbility = null ) { logState ( getState ( ) ) ; dispatch ( startIntakeStage ( ) ) ; const messageData = { rawText : nlpResult . message , intent : nlpResult . intent , entities : nlpResult . entities } ; dispatch ( setDefaultAbility ( defaultAbility ) ) ; dispatch ( setMessageData ( messageData ) ) ; log ( 'incomingSlotData:' , incomingSlotData ) ; }