UNPKG

claire-agent

Version:

A Dialogflow agent for Claire Global

40 lines (37 loc) 8.86 kB
// Compiled by ClojureScript 1.10.520 {:target :nodejs} goog.provide('claire_agent.intents.purchase_lookup'); goog.require('cljs.core'); goog.require('claire_common.utils'); goog.require('claire_common.dialogflow'); goog.require('claire_agent.api'); claire_agent.intents.purchase_lookup.purchase_lookup = (function claire_agent$intents$purchase_lookup$purchase_lookup(intent,query,env,pars){ var q = claire_agent.api.start_query.call(null,"000",query); return claire_common.utils.make_reply.call(null,claire_common.utils.clear_contexts.call(null,env,new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, ["purchase-lookup"], null)),new cljs.core.Keyword(null,"env","env",-1815813235),new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"query","query",-1288509510),q], null),new cljs.core.Keyword(null,"say","say",504378016),"Start looking for suppliers"); }); claire_agent.intents.purchase_lookup.purchase_lookup_wait = (function claire_agent$intents$purchase_lookup$purchase_lookup_wait(intent,query,env,pars){ var found = cljs.core._EQ_.call(null,"finished",new cljs.core.Keyword(null,"status","status",-1997798413).cljs$core$IFn$_invoke$arity$1(claire_agent.api.query.call(null,"000",query))); var jump_to_finish = ((function (found){ return (function (){ return claire_common.utils.make_reply.call(null,env,new cljs.core.Keyword(null,"export","export",214356590),true,new cljs.core.Keyword(null,"event","event",301435442),"purchase-lookup-finished"); });})(found)) ; if(found === true){ return jump_to_finish.call(null); } else { claire_common.utils.active_wait.call(null,(3500),((function (found,jump_to_finish){ return (function (){ return claire_agent.api.query.call(null,"000",query); });})(found,jump_to_finish)) ); if(claire_agent.api.query.call(null,"000",query) === true){ return jump_to_finish.call(null); } else { return claire_common.utils.make_reply.call(null,claire_common.utils.clear_contexts.call(null,env,new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, ["purchase-lookup"], null)),new cljs.core.Keyword(null,"say","say",504378016),"Still looking for suppliers"); } } }); claire_agent.intents.purchase_lookup.purchase_lookup_finished = (function claire_agent$intents$purchase_lookup$purchase_lookup_finished(intent,query,env,pars){ return claire_common.utils.make_reply.call(null,env,new cljs.core.Keyword(null,"say","say",504378016),"Found suppliers"); }); claire_agent.intents.purchase_lookup.intent = claire_common.dialogflow.intent.call(null,"purchase-lookup",cljs.core.concat.call(null,cljs.core.PersistentVector.fromArray(["yes","sure","okay","sounds correct","that works","yep that's ok","yes that's right","I think so","yes I agree","I don't mind","I agree","yes I do","for sure","ok","yes that's ok","that one works","yes you can do it","perfect","why not","of course","okay I will","exactly","sure why not","absolutely","it's okay","it's fine","go ahead","confirm","sounds good","alright","yeah","yup","yes please","do it","yes I can","it looks perfect","that's correct","right","alright why not"], true),cljs.core.PersistentVector.fromArray(["don't","nope not really","no that's be all","not right now","thanks but no","not","no we are good","nothing else","not interested","nah I'm good","definitely not","no never","never","nah","nothing","no maybe next time","I don't want that","no not really","no that's ok","no no don't","na","no way no","I can't","no thanks","not at all","not really","I don't","no I cannot","no that's okay","nope","I don't think so","no it isn't","thanks but not this time","no that's fine thank you","no don't","don't do it","I don't want","not today","I'm not","no way","no","I disagree","not this time","nothing else thanks"], true),new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, ["look up"], null)),new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, ["I am going to search for the best offer\n now. This may take a while. Shall I\n continue?"], null),new cljs.core.PersistentArrayMap(null, 4, [new cljs.core.Keyword(null,"events","events",1792552201),new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, ["purchase-lookup"], null),new cljs.core.Keyword(null,"contexts","contexts",4351546),new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, ["purchase-lookup"], null),new cljs.core.Keyword(null,"followups","followups",2057499244),new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [claire_common.dialogflow.intent.call(null,"purchase-lookup-purchase-lookup-wait",cljs.core.PersistentVector.fromArray(["yes","sure","okay","sounds correct","that works","yep that's ok","yes that's right","I think so","yes I agree","I don't mind","I agree","yes I do","for sure","ok","yes that's ok","that one works","yes you can do it","perfect","why not","of course","okay I will","exactly","sure why not","absolutely","it's okay","it's fine","go ahead","confirm","sounds good","alright","yeah","yup","yes please","do it","yes I can","it looks perfect","that's correct","right","alright why not"], true),new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, ["Looking up. Shall I continue?"], null),new cljs.core.PersistentArrayMap(null, 3, [new cljs.core.Keyword(null,"events","events",1792552201),new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, ["purchase-lookup-wait"], null),new cljs.core.Keyword(null,"followups","followups",2057499244),new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [claire_common.dialogflow.intent.call(null,"purchase-lookup-wait-purchase-lookup-wait-redirect",cljs.core.PersistentVector.fromArray(["yes","sure","okay","sounds correct","that works","yep that's ok","yes that's right","I think so","yes I agree","I don't mind","I agree","yes I do","for sure","ok","yes that's ok","that one works","yes you can do it","perfect","why not","of course","okay I will","exactly","sure why not","absolutely","it's okay","it's fine","go ahead","confirm","sounds good","alright","yeah","yup","yes please","do it","yes I can","it looks perfect","that's correct","right","alright why not"], true),new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, ["Should have been redirected"], null),new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"webhook","webhook",-860093016),claire_common.dialogflow.redirector.call(null,"purchase-lookup-wait","purchase-lookup-followup")], null)),claire_common.dialogflow.intent.call(null,"purchase-lookup-wait-purchase-lookup-send-notification",cljs.core.PersistentVector.fromArray(["don't","nope not really","no that's be all","not right now","thanks but no","not","no we are good","nothing else","not interested","nah I'm good","definitely not","no never","never","nah","nothing","no maybe next time","I don't want that","no not really","no that's ok","no no don't","na","no way no","I can't","no thanks","not at all","not really","I don't","no I cannot","no that's okay","nope","I don't think so","no it isn't","thanks but not this time","no that's fine thank you","no don't","don't do it","I don't want","not today","I'm not","no way","no","I disagree","not this time","nothing else thanks"], true),new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, ["OK. I will send you a notification when I am done."], null),new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"reset","reset",-800929946),true], null))], null),new cljs.core.Keyword(null,"webhook","webhook",-860093016),claire_agent.intents.purchase_lookup.purchase_lookup_wait], null)),claire_common.dialogflow.intent.call(null,"purchase-lookup-purchase-lookup-finished",new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, ["purchase-lookup-wait"], null),new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, ["Lookup completed"], null),new cljs.core.PersistentArrayMap(null, 4, [new cljs.core.Keyword(null,"contexts","contexts",4351546),new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, ["purchase-lookup-finished"], null),new cljs.core.Keyword(null,"reset","reset",-800929946),true,new cljs.core.Keyword(null,"events","events",1792552201),new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, ["purchase-lookup-finished"], null),new cljs.core.Keyword(null,"webhook","webhook",-860093016),claire_agent.intents.purchase_lookup.purchase_lookup_finished], null))], null),new cljs.core.Keyword(null,"webhook","webhook",-860093016),claire_agent.intents.purchase_lookup.purchase_lookup], null)); //# sourceMappingURL=purchase_lookup.js.map?rel=1571758970167