-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Basic tests for default flow + intents
- Loading branch information
1 parent
ed9503c
commit 9913498
Showing
6 changed files
with
139 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
75 changes: 75 additions & 0 deletions
75
mmv1/templates/terraform/examples/dialogflowcx_flow_default_start_flow.tf.erb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,75 @@ | ||
resource "google_dialogflow_cx_agent" "agent" { | ||
display_name = "<%= ctx[:vars]["agent_name"] %>" | ||
location = "global" | ||
default_language_code = "en" | ||
time_zone = "America/New_York" | ||
} | ||
|
||
resource "google_dialogflow_cx_intent" "default_welcome_intent" { | ||
parent = google_dialogflow_cx_agent.agent.id | ||
is_default_welcome_intent = true | ||
display_name = "Default Welcome Intent" | ||
priority = 1 | ||
training_phrases { | ||
parts { | ||
text = "Hello" | ||
} | ||
repeat_count = 1 | ||
} | ||
} | ||
|
||
|
||
resource "google_dialogflow_cx_flow" "<%= ctx[:primary_resource_id] %>" { | ||
parent = google_dialogflow_cx_agent.agent.id | ||
is_default_start_flow = true | ||
display_name = "Default Start Flow" | ||
|
||
nlu_settings { | ||
classification_threshold = 0.3 | ||
model_type = "MODEL_TYPE_STANDARD" | ||
} | ||
|
||
transition_routes { | ||
intent = google_dialogflow_cx_intent.default_welcome_intent.id | ||
trigger_fulfillment { | ||
messages { | ||
text { | ||
text = ["Response to default welcome intent."] | ||
} | ||
} | ||
} | ||
} | ||
|
||
event_handlers { | ||
event = "custom-event" | ||
trigger_fulfillment { | ||
messages { | ||
text { | ||
text = ["This is a default flow."] | ||
} | ||
} | ||
} | ||
} | ||
|
||
event_handlers { | ||
event = "sys.no-match-default" | ||
trigger_fulfillment { | ||
messages { | ||
text { | ||
text = ["We've updated the default flow no-match response!"] | ||
} | ||
} | ||
} | ||
} | ||
|
||
event_handlers { | ||
event = "sys.no-input-default" | ||
trigger_fulfillment { | ||
messages { | ||
text { | ||
text = ["We've updated the default flow no-input response!"] | ||
} | ||
} | ||
} | ||
} | ||
} |
20 changes: 20 additions & 0 deletions
20
mmv1/templates/terraform/examples/dialogflowcx_intent_default_negative_intent.tf.erb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
resource "google_dialogflow_cx_agent" "agent" { | ||
display_name = "<%= ctx[:vars]["agent_name"] %>" | ||
location = "global" | ||
default_language_code = "en" | ||
time_zone = "America/New_York" | ||
} | ||
|
||
|
||
resource "google_dialogflow_cx_intent" "<%= ctx[:primary_resource_id] %>" { | ||
parent = google_dialogflow_cx_agent.agent.id | ||
is_default_negative_intent = true | ||
display_name = "Default Negative Intent" | ||
priority = 1 | ||
training_phrases { | ||
parts { | ||
text = "Never match this phrase" | ||
} | ||
repeat_count = 1 | ||
} | ||
} |
20 changes: 20 additions & 0 deletions
20
mmv1/templates/terraform/examples/dialogflowcx_intent_default_welcome_intent.tf.erb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
resource "google_dialogflow_cx_agent" "agent" { | ||
display_name = "<%= ctx[:vars]["agent_name"] %>" | ||
location = "global" | ||
default_language_code = "en" | ||
time_zone = "America/New_York" | ||
} | ||
|
||
|
||
resource "google_dialogflow_cx_intent" "<%= ctx[:primary_resource_id] %>" { | ||
parent = google_dialogflow_cx_agent.agent.id | ||
is_default_welcome_intent = true | ||
display_name = "Default Welcome Intent" | ||
priority = 1 | ||
training_phrases { | ||
parts { | ||
text = "Hello" | ||
} | ||
repeat_count = 1 | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters