Skip to content

Commit 55ea626

Browse files
averbuksBBBmau
authored andcommitted
Add logging_settings and speech_settings to dialogflow_cx_agent/flow (GoogleCloudPlatform#11940)
1 parent a6dbfba commit 55ea626

File tree

6 files changed

+177
-14
lines changed

6 files changed

+177
-14
lines changed

mmv1/products/dialogflowcx/Agent.yaml

+52
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,8 @@ examples:
4040
bucket_name: 'dialogflowcx-bucket'
4141
ignore_read_extra:
4242
- 'git_integration_settings.0.github_settings.0.access_token'
43+
- 'enable_stackdriver_logging'
44+
- 'advanced_settings.0.logging_settings'
4345
parameters:
4446
properties:
4547
- name: 'name'
@@ -113,8 +115,11 @@ properties:
113115
Name of the SecuritySettings reference for the agent. Format: projects/<Project ID>/locations/<Location ID>/securitySettings/<Security Settings ID>.
114116
- name: 'enableStackdriverLogging'
115117
type: Boolean
118+
# Ignore read, field is deprecated and conflicts with advanced_settings.logging_settings.enable_stackdriver_logging when it's set
119+
ignore_read: true
116120
description: |
117121
Determines whether this agent should log conversation queries.
122+
deprecation_message: '`enable_stackdriver_logging` is deprecated and will be removed in a future major release. Please use `advanced_settings.logging_settings.enable_stackdriver_logging`instead.'
118123
- name: 'enableSpellCorrection'
119124
type: Boolean
120125
description: |
@@ -138,6 +143,33 @@ properties:
138143
description: |
139144
The Google Cloud Storage URI for the exported objects. Whether a full object name, or just a prefix, its usage depends on the Dialogflow operation.
140145
Format: gs://bucket/object-name-or-prefix
146+
- name: 'speechSettings'
147+
type: NestedObject
148+
description: |
149+
Settings for speech to text detection. Exposed at the following levels:
150+
* Agent level
151+
* Flow level
152+
* Page level
153+
* Parameter level
154+
properties:
155+
- name: 'endpointerSensitivity'
156+
type: Integer
157+
description: |
158+
Sensitivity of the speech model that detects the end of speech. Scale from 0 to 100.
159+
- name: 'noSpeechTimeout'
160+
type: String
161+
description: |
162+
Timeout before detecting no speech.
163+
A duration in seconds with up to nine fractional digits, ending with 's'. Example: "3.5s".
164+
- name: 'useTimeoutBasedEndpointing'
165+
type: Boolean
166+
description: |
167+
Use timeout based endpointing, interpreting endpointer sensitivy as seconds of timeout value.
168+
- name: 'models'
169+
type: KeyValuePairs
170+
description: |
171+
Mapping from language to Speech-to-Text model. The mapped Speech-to-Text model will be selected for requests from its corresponding language. For more information, see [Speech models](https://cloud.google.com/dialogflow/cx/docs/concept/speech-models).
172+
An object containing a list of **"key": value** pairs. Example: **{ "name": "wrench", "mass": "1.3kg", "count": "3" }**.
141173
- name: 'dtmfSettings'
142174
type: NestedObject
143175
description: |
@@ -159,6 +191,26 @@ properties:
159191
type: String
160192
description: |
161193
The digit that terminates a DTMF digit sequence.
194+
- name: 'loggingSettings'
195+
type: NestedObject
196+
# Due to inconsistent API behaviour http://b/303056144, ignore read can be removed once fixed
197+
ignore_read: true
198+
description: |
199+
Settings for logging. Settings for Dialogflow History, Contact Center messages, StackDriver logs, and speech logging. Exposed at the following levels:
200+
* Agent level
201+
properties:
202+
- name: 'enableStackdriverLogging'
203+
type: Boolean
204+
description: |
205+
Enables Google Cloud Logging.
206+
- name: 'enableInteractionLogging'
207+
type: Boolean
208+
description: |
209+
Enables DF Interaction logging.
210+
- name: 'enableConsentBasedRedaction'
211+
type: Boolean
212+
description: |
213+
Enables consent-based end-user input redaction, if true, a pre-defined session parameter **$session.params.conversation-redaction** will be used to determine if the utterance should be redacted.
162214
- name: 'gitIntegrationSettings'
163215
type: NestedObject
164216
description: |

mmv1/products/dialogflowcx/Flow.yaml

+49
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,8 @@ examples:
4242
primary_resource_id: 'basic_flow'
4343
vars:
4444
agent_name: 'dialogflowcx-agent'
45+
ignore_read_extra:
46+
- 'advanced_settings.0.logging_settings'
4547
- name: 'dialogflowcx_flow_full'
4648
primary_resource_id: 'basic_flow'
4749
vars:
@@ -564,6 +566,33 @@ properties:
564566
description: |
565567
The Google Cloud Storage URI for the exported objects. Whether a full object name, or just a prefix, its usage depends on the Dialogflow operation.
566568
Format: gs://bucket/object-name-or-prefix
569+
- name: 'speechSettings'
570+
type: NestedObject
571+
description: |
572+
Settings for speech to text detection. Exposed at the following levels:
573+
* Agent level
574+
* Flow level
575+
* Page level
576+
* Parameter level
577+
properties:
578+
- name: 'endpointerSensitivity'
579+
type: Integer
580+
description: |
581+
Sensitivity of the speech model that detects the end of speech. Scale from 0 to 100.
582+
- name: 'noSpeechTimeout'
583+
type: String
584+
description: |
585+
Timeout before detecting no speech.
586+
A duration in seconds with up to nine fractional digits, ending with 's'. Example: "3.5s".
587+
- name: 'useTimeoutBasedEndpointing'
588+
type: Boolean
589+
description: |
590+
Use timeout based endpointing, interpreting endpointer sensitivy as seconds of timeout value.
591+
- name: 'models'
592+
type: KeyValuePairs
593+
description: |
594+
Mapping from language to Speech-to-Text model. The mapped Speech-to-Text model will be selected for requests from its corresponding language. For more information, see [Speech models](https://cloud.google.com/dialogflow/cx/docs/concept/speech-models).
595+
An object containing a list of **"key": value** pairs. Example: **{ "name": "wrench", "mass": "1.3kg", "count": "3" }**.
567596
- name: 'dtmfSettings'
568597
type: NestedObject
569598
description: |
@@ -585,3 +614,23 @@ properties:
585614
type: String
586615
description: |
587616
The digit that terminates a DTMF digit sequence.
617+
- name: 'loggingSettings'
618+
type: NestedObject
619+
ignore_read: true
620+
# Ignore read as API does not return loggingSettings back, only accepts in the /create/update API call
621+
description: |
622+
Settings for logging. Settings for Dialogflow History, Contact Center messages, StackDriver logs, and speech logging. Exposed at the following levels:
623+
* Agent level
624+
properties:
625+
- name: 'enableStackdriverLogging'
626+
type: Boolean
627+
description: |
628+
Enables Google Cloud Logging.
629+
- name: 'enableInteractionLogging'
630+
type: Boolean
631+
description: |
632+
Enables DF Interaction logging.
633+
- name: 'enableConsentBasedRedaction'
634+
type: Boolean
635+
description: |
636+
Enables consent-based end-user input redaction, if true, a pre-defined session parameter **$session.params.conversation-redaction** will be used to determine if the utterance should be redacted.

mmv1/templates/terraform/examples/dialogflowcx_agent_full.tf.tmpl

+17-2
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,26 @@ resource "google_dialogflow_cx_agent" "{{$.PrimaryResourceId}}" {
2121
audio_export_gcs_destination {
2222
uri = "${google_storage_bucket.bucket.url}/prefix-"
2323
}
24+
speech_settings {
25+
endpointer_sensitivity = 30
26+
no_speech_timeout = "3.500s"
27+
use_timeout_based_endpointing = true
28+
models = {
29+
name : "wrench"
30+
mass : "1.3kg"
31+
count : "3"
32+
}
33+
}
2434
dtmf_settings {
25-
enabled = true
26-
max_digits = 1
35+
enabled = true
36+
max_digits = 1
2737
finish_digit = "#"
2838
}
39+
logging_settings {
40+
enable_stackdriver_logging = true
41+
enable_interaction_logging = true
42+
enable_consent_based_redaction = true
43+
}
2944
}
3045
git_integration_settings {
3146
github_settings {

mmv1/templates/terraform/examples/dialogflowcx_flow_full.tf.tmpl

+16-1
Original file line numberDiff line numberDiff line change
@@ -273,10 +273,25 @@ resource "google_dialogflow_cx_flow" "{{$.PrimaryResourceId}}" {
273273
audio_export_gcs_destination {
274274
uri = "${google_storage_bucket.bucket.url}/prefix-"
275275
}
276+
speech_settings {
277+
endpointer_sensitivity = 30
278+
no_speech_timeout = "3.500s"
279+
use_timeout_based_endpointing = true
280+
models = {
281+
name : "wrench"
282+
mass : "1.3kg"
283+
count : "3"
284+
}
285+
}
276286
dtmf_settings {
277287
enabled = true
278288
max_digits = 1
279289
finish_digit = "#"
280290
}
291+
logging_settings {
292+
enable_stackdriver_logging = true
293+
enable_interaction_logging = true
294+
enable_consent_based_redaction = true
295+
}
281296
}
282-
}
297+
}

mmv1/third_party/terraform/services/dialogflowcx/resource_dialogflowcx_agent_test.go.tmpl

+20-5
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ func TestAccDialogflowCXAgent_update(t *testing.T) {
2929
ResourceName: "google_dialogflow_cx_agent.foobar",
3030
ImportState: true,
3131
ImportStateVerify: true,
32-
ImportStateVerifyIgnore: []string{"git_integration_settings.0.github_settings.0.access_token"},
32+
ImportStateVerifyIgnore: []string{"git_integration_settings.0.github_settings.0.access_token", "enable_stackdriver_logging", "advanced_settings.0.logging_settings"},
3333
},
3434
{
3535
Config: testAccDialogflowCXAgent_full(context),
@@ -38,7 +38,7 @@ func TestAccDialogflowCXAgent_update(t *testing.T) {
3838
ResourceName: "google_dialogflow_cx_agent.foobar",
3939
ImportState: true,
4040
ImportStateVerify: true,
41-
ImportStateVerifyIgnore: []string{"git_integration_settings.0.github_settings.0.access_token"},
41+
ImportStateVerifyIgnore: []string{"git_integration_settings.0.github_settings.0.access_token", "enable_stackdriver_logging", "advanced_settings.0.logging_settings"},
4242
},
4343
{
4444
Config: testAccDialogflowCXAgent_removeSettings(context),
@@ -47,7 +47,7 @@ func TestAccDialogflowCXAgent_update(t *testing.T) {
4747
ResourceName: "google_dialogflow_cx_agent.foobar",
4848
ImportState: true,
4949
ImportStateVerify: true,
50-
ImportStateVerifyIgnore: []string{"git_integration_settings.0.github_settings.0.access_token"},
50+
ImportStateVerifyIgnore: []string{"git_integration_settings.0.github_settings.0.access_token", "enable_stackdriver_logging", "advanced_settings.0.logging_settings"},
5151
},
5252
},
5353
})
@@ -92,11 +92,26 @@ func testAccDialogflowCXAgent_full(context map[string]interface{}) string {
9292
audio_export_gcs_destination {
9393
uri = "${google_storage_bucket.bucket.url}/prefix-"
9494
}
95+
speech_settings {
96+
endpointer_sensitivity = 30
97+
no_speech_timeout = "3.500s"
98+
use_timeout_based_endpointing = true
99+
models = {
100+
name : "wrench"
101+
mass : "1.3kg"
102+
count : "3"
103+
}
104+
}
95105
dtmf_settings {
96-
enabled = true
97-
max_digits = 1
106+
enabled = true
107+
max_digits = 1
98108
finish_digit = "#"
99109
}
110+
logging_settings {
111+
enable_stackdriver_logging = true
112+
enable_interaction_logging = true
113+
enable_consent_based_redaction = true
114+
}
100115
}
101116
git_integration_settings {
102117
github_settings {

mmv1/third_party/terraform/services/dialogflowcx/resource_dialogflowcx_flow_test.go

+23-6
Original file line numberDiff line numberDiff line change
@@ -25,17 +25,19 @@ func TestAccDialogflowCXFlow_update(t *testing.T) {
2525
Config: testAccDialogflowCXFlow_basic(context),
2626
},
2727
{
28-
ResourceName: "google_dialogflow_cx_flow.my_flow",
29-
ImportState: true,
30-
ImportStateVerify: true,
28+
ResourceName: "google_dialogflow_cx_flow.my_flow",
29+
ImportState: true,
30+
ImportStateVerify: true,
31+
ImportStateVerifyIgnore: []string{"advanced_settings.0.logging_settings"},
3132
},
3233
{
3334
Config: testAccDialogflowCXFlow_full(context),
3435
},
3536
{
36-
ResourceName: "google_dialogflow_cx_flow.my_flow",
37-
ImportState: true,
38-
ImportStateVerify: true,
37+
ResourceName: "google_dialogflow_cx_flow.my_flow",
38+
ImportState: true,
39+
ImportStateVerify: true,
40+
ImportStateVerifyIgnore: []string{"advanced_settings.0.logging_settings"},
3941
},
4042
},
4143
})
@@ -341,11 +343,26 @@ func testAccDialogflowCXFlow_full(context map[string]interface{}) string {
341343
audio_export_gcs_destination {
342344
uri = "${google_storage_bucket.bucket.url}/prefix-"
343345
}
346+
speech_settings {
347+
endpointer_sensitivity = 30
348+
no_speech_timeout = "3.500s"
349+
use_timeout_based_endpointing = true
350+
models = {
351+
name : "wrench"
352+
mass : "1.3kg"
353+
count : "3"
354+
}
355+
}
344356
dtmf_settings {
345357
enabled = true
346358
max_digits = 1
347359
finish_digit = "#"
348360
}
361+
logging_settings {
362+
enable_stackdriver_logging = true
363+
enable_interaction_logging = true
364+
enable_consent_based_redaction = true
365+
}
349366
}
350367
}
351368
`, context)

0 commit comments

Comments
 (0)