UNPKG

claire-agent

Version:

A Dialogflow agent for Claire Global

20 lines (18 loc) 5.72 kB
// Compiled by ClojureScript 1.10.520 {:target :nodejs} goog.provide('claire_agent.intents.purchase_correct'); goog.require('cljs.core'); goog.require('claire_agent.intents.purchase_product'); goog.require('claire_common.utils'); goog.require('claire_common.dialogflow'); claire_agent.intents.purchase_correct.purchase_review = (function claire_agent$intents$purchase_correct$purchase_review(intent,query,env,pars){ return claire_common.utils.make_reply.call(null,env,new cljs.core.Keyword(null,"state","state",-1988618099),new cljs.core.PersistentArrayMap(null, 1, ["parameterName",cljs.core.get.call(null,pars,"parameterName")], null),new cljs.core.Keyword(null,"say","say",504378016),"Specify value to correct"); }); claire_agent.intents.purchase_correct.purchase_correct_parameter = (function claire_agent$intents$purchase_correct$purchase_correct_parameter(intent,query,env,pars){ var parameterName = cljs.core.get.call(null,new cljs.core.Keyword(null,"state","state",-1988618099).cljs$core$IFn$_invoke$arity$1(env),"parameterName"); return claire_common.utils.make_reply.call(null,env,new cljs.core.Keyword(null,"state","state",-1988618099),cljs.core.PersistentArrayMap.createAsIfByAssoc([parameterName,query,[cljs.core.str.cljs$core$IFn$_invoke$arity$1(parameterName),".original"].join(''),query]),new cljs.core.Keyword(null,"say","say",504378016),"Correct another parameter?"); }); claire_agent.intents.purchase_correct.purchase_corrected = (function claire_agent$intents$purchase_correct$purchase_corrected(intent,query,env,pars){ return claire_common.utils.make_reply.call(null,claire_common.utils.clear_env.call(null,env,new cljs.core.Keyword(null,"state","state",-1988618099),new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, ["parameterName","parameterName.original"], null))); }); claire_agent.intents.purchase_correct.intent = claire_common.dialogflow.intent.call(null,"purchase-review",new cljs.core.PersistentVector(null, 3, 5, cljs.core.PersistentVector.EMPTY_NODE, ["Correct $parameterName","Correct order","I would like to correct an order"], null),new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, ["Please give new value for item"], 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-review"], null),new cljs.core.Keyword(null,"parameters","parameters",-1229919748),new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [claire_common.dialogflow.parm.call(null,"parameterName","claire_orderParameter",new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, ["Which order item would you like to change?"], null))], 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-review-purchase-corrected",new cljs.core.PersistentVector(null, 4, 5, cljs.core.PersistentVector.EMPTY_NODE, ["none, look up","look up","done, look up","I am done"], null),new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, ["Ok, your order is final now"], null),new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"webhook","webhook",-860093016),claire_agent.intents.purchase_correct.purchase_corrected], null)),claire_common.dialogflow.intent.call(null,"purchase-review-purchase-correct-parameter",cljs.core.PersistentVector.EMPTY,new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, ["I got your corrected order item. More changes?"], null),new cljs.core.PersistentArrayMap(null, 2, [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-correct-parameter-purchase-review-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-review",null)], null)),claire_common.dialogflow.intent.call(null,"purchase-correct-parameter-purchase-lookup-redirect",new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, ["look up","no"], null),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","purchase-correct-parameter-purchase-lookup")], null))], null),new cljs.core.Keyword(null,"webhook","webhook",-860093016),claire_agent.intents.purchase_correct.purchase_correct_parameter], null))], null),new cljs.core.Keyword(null,"webhook","webhook",-860093016),claire_agent.intents.purchase_correct.purchase_review], null)); //# sourceMappingURL=purchase_correct.js.map?rel=1571758970000