@@ -400,16 +400,18 @@ function createIntents(projectId) {
400
400
] ;
401
401
402
402
// The intent to be created.
403
- const pizzaIntent = {
404
- displayName : 'Pizza' ,
405
- events : [ 'order_pizza' ] ,
406
- // Webhook is disabled because we are not ready to call the webhook yet.
407
- webhookState : 'WEBHOOK_STATE_DISABLED' ,
408
- trainingPhrases : pizzaPhrases ,
409
- mlEnabled : true ,
410
- priority : 500000 ,
411
- result : pizzaResult ,
412
- } ;
403
+ const pizzaIntent = Object . assign (
404
+ {
405
+ displayName : 'Pizza' ,
406
+ events : [ 'order_pizza' ] ,
407
+ // Webhook is disabled because we are not ready to call the webhook yet.
408
+ webhookState : 'WEBHOOK_STATE_DISABLED' ,
409
+ trainingPhrases : pizzaPhrases ,
410
+ mlEnabled : true ,
411
+ priority : 500000 ,
412
+ } ,
413
+ pizzaResult
414
+ ) ;
413
415
414
416
const pizzaRequest = {
415
417
parent : agentPath ,
@@ -520,15 +522,17 @@ function createIntents(projectId) {
520
522
} ,
521
523
] ;
522
524
523
- const changeDeliveryAddressIntent = {
524
- displayName : 'ChangeDeliveryAddress' ,
525
- webhookState : 'WEBHOOK_STATE_DISABLED' ,
526
- trainingPhrases : changeDeliveryAddressPhrases ,
527
- inputContexts : changeDeliveryAddressInputContexts ,
528
- mlEnabled : true ,
529
- priority : 500000 ,
530
- result : changeDeliveryAddressResult ,
531
- } ;
525
+ const changeDeliveryAddressIntent = Object . assign (
526
+ {
527
+ displayName : 'ChangeDeliveryAddress' ,
528
+ webhookState : 'WEBHOOK_STATE_DISABLED' ,
529
+ trainingPhrases : changeDeliveryAddressPhrases ,
530
+ inputContexts : changeDeliveryAddressInputContexts ,
531
+ mlEnabled : true ,
532
+ priority : 500000 ,
533
+ } ,
534
+ changeDeliveryAddressResult
535
+ ) ;
532
536
533
537
const changeDeliveryAddressRequest = {
534
538
parent : agentPath ,
@@ -598,15 +602,17 @@ function createIntents(projectId) {
598
602
{ type : 'EXAMPLE' , parts : [ { text : 'place order' } ] } ,
599
603
] ;
600
604
601
- const placeOrderIntent = {
602
- displayName : 'PlaceOrder' ,
603
- webhookState : 'WEBHOOK_STATE_ENABLED' ,
604
- trainingPhrases : placeOrderPhrases ,
605
- inputContexts : placeOrderInputContexts ,
606
- mlEnabled : true ,
607
- priority : 500000 ,
608
- result : placeOrderResult ,
609
- } ;
605
+ const placeOrderIntent = Object . assign (
606
+ {
607
+ displayName : 'PlaceOrder' ,
608
+ webhookState : 'WEBHOOK_STATE_ENABLED' ,
609
+ trainingPhrases : placeOrderPhrases ,
610
+ inputContexts : placeOrderInputContexts ,
611
+ mlEnabled : true ,
612
+ priority : 500000 ,
613
+ } ,
614
+ placeOrderResult
615
+ ) ;
610
616
611
617
const placeOrderRequest = {
612
618
parent : agentPath ,
@@ -642,15 +648,17 @@ function createIntents(projectId) {
642
648
{ type : 'EXAMPLE' , parts : [ { text : "I don't want it any more" } ] } ,
643
649
] ;
644
650
645
- const cancelOrderIntent = {
646
- displayName : 'CancelOrder' ,
647
- webhookState : 'WEBHOOK_STATE_DISABLED' ,
648
- trainingPhrases : cancelOrderPhrases ,
649
- inputContexts : cancelOrderInputContexts ,
650
- mlEnabled : true ,
651
- priority : 500000 ,
652
- result : cancelOrderResult ,
653
- } ;
651
+ const cancelOrderIntent = Object . assign (
652
+ {
653
+ displayName : 'CancelOrder' ,
654
+ webhookState : 'WEBHOOK_STATE_DISABLED' ,
655
+ trainingPhrases : cancelOrderPhrases ,
656
+ inputContexts : cancelOrderInputContexts ,
657
+ mlEnabled : true ,
658
+ priority : 500000 ,
659
+ } ,
660
+ cancelOrderResult
661
+ ) ;
654
662
655
663
const cancelOrderRequest = {
656
664
parent : agentPath ,
0 commit comments