Skip to content

Commit

Permalink
Add logging_settings and speech_settings to dialogflow_cx_agent/flow (G…
Browse files Browse the repository at this point in the history
  • Loading branch information
averbuks authored and niharika-98 committed Oct 10, 2024
1 parent 051c612 commit 76dc08d
Show file tree
Hide file tree
Showing 6 changed files with 177 additions and 14 deletions.
52 changes: 52 additions & 0 deletions mmv1/products/dialogflowcx/Agent.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,8 @@ examples:
bucket_name: 'dialogflowcx-bucket'
ignore_read_extra:
- 'git_integration_settings.0.github_settings.0.access_token'
- 'enable_stackdriver_logging'
- 'advanced_settings.0.logging_settings'
parameters:
properties:
- name: 'name'
Expand Down Expand Up @@ -113,8 +115,11 @@ properties:
Name of the SecuritySettings reference for the agent. Format: projects/<Project ID>/locations/<Location ID>/securitySettings/<Security Settings ID>.
- name: 'enableStackdriverLogging'
type: Boolean
# Ignore read, field is deprecated and conflicts with advanced_settings.logging_settings.enable_stackdriver_logging when it's set
ignore_read: true
description: |
Determines whether this agent should log conversation queries.
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.'
- name: 'enableSpellCorrection'
type: Boolean
description: |
Expand All @@ -138,6 +143,33 @@ properties:
description: |
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.
Format: gs://bucket/object-name-or-prefix
- name: 'speechSettings'
type: NestedObject
description: |
Settings for speech to text detection. Exposed at the following levels:
* Agent level
* Flow level
* Page level
* Parameter level
properties:
- name: 'endpointerSensitivity'
type: Integer
description: |
Sensitivity of the speech model that detects the end of speech. Scale from 0 to 100.
- name: 'noSpeechTimeout'
type: String
description: |
Timeout before detecting no speech.
A duration in seconds with up to nine fractional digits, ending with 's'. Example: "3.5s".
- name: 'useTimeoutBasedEndpointing'
type: Boolean
description: |
Use timeout based endpointing, interpreting endpointer sensitivy as seconds of timeout value.
- name: 'models'
type: KeyValuePairs
description: |
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).
An object containing a list of **"key": value** pairs. Example: **{ "name": "wrench", "mass": "1.3kg", "count": "3" }**.
- name: 'dtmfSettings'
type: NestedObject
description: |
Expand All @@ -159,6 +191,26 @@ properties:
type: String
description: |
The digit that terminates a DTMF digit sequence.
- name: 'loggingSettings'
type: NestedObject
# Due to inconsistent API behaviour http://b/303056144, ignore read can be removed once fixed
ignore_read: true
description: |
Settings for logging. Settings for Dialogflow History, Contact Center messages, StackDriver logs, and speech logging. Exposed at the following levels:
* Agent level
properties:
- name: 'enableStackdriverLogging'
type: Boolean
description: |
Enables Google Cloud Logging.
- name: 'enableInteractionLogging'
type: Boolean
description: |
Enables DF Interaction logging.
- name: 'enableConsentBasedRedaction'
type: Boolean
description: |
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.
- name: 'gitIntegrationSettings'
type: NestedObject
description: |
Expand Down
49 changes: 49 additions & 0 deletions mmv1/products/dialogflowcx/Flow.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,8 @@ examples:
primary_resource_id: 'basic_flow'
vars:
agent_name: 'dialogflowcx-agent'
ignore_read_extra:
- 'advanced_settings.0.logging_settings'
- name: 'dialogflowcx_flow_full'
primary_resource_id: 'basic_flow'
vars:
Expand Down Expand Up @@ -564,6 +566,33 @@ properties:
description: |
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.
Format: gs://bucket/object-name-or-prefix
- name: 'speechSettings'
type: NestedObject
description: |
Settings for speech to text detection. Exposed at the following levels:
* Agent level
* Flow level
* Page level
* Parameter level
properties:
- name: 'endpointerSensitivity'
type: Integer
description: |
Sensitivity of the speech model that detects the end of speech. Scale from 0 to 100.
- name: 'noSpeechTimeout'
type: String
description: |
Timeout before detecting no speech.
A duration in seconds with up to nine fractional digits, ending with 's'. Example: "3.5s".
- name: 'useTimeoutBasedEndpointing'
type: Boolean
description: |
Use timeout based endpointing, interpreting endpointer sensitivy as seconds of timeout value.
- name: 'models'
type: KeyValuePairs
description: |
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).
An object containing a list of **"key": value** pairs. Example: **{ "name": "wrench", "mass": "1.3kg", "count": "3" }**.
- name: 'dtmfSettings'
type: NestedObject
description: |
Expand All @@ -585,3 +614,23 @@ properties:
type: String
description: |
The digit that terminates a DTMF digit sequence.
- name: 'loggingSettings'
type: NestedObject
ignore_read: true
# Ignore read as API does not return loggingSettings back, only accepts in the /create/update API call
description: |
Settings for logging. Settings for Dialogflow History, Contact Center messages, StackDriver logs, and speech logging. Exposed at the following levels:
* Agent level
properties:
- name: 'enableStackdriverLogging'
type: Boolean
description: |
Enables Google Cloud Logging.
- name: 'enableInteractionLogging'
type: Boolean
description: |
Enables DF Interaction logging.
- name: 'enableConsentBasedRedaction'
type: Boolean
description: |
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.
19 changes: 17 additions & 2 deletions mmv1/templates/terraform/examples/dialogflowcx_agent_full.tf.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,26 @@ resource "google_dialogflow_cx_agent" "{{$.PrimaryResourceId}}" {
audio_export_gcs_destination {
uri = "${google_storage_bucket.bucket.url}/prefix-"
}
speech_settings {
endpointer_sensitivity = 30
no_speech_timeout = "3.500s"
use_timeout_based_endpointing = true
models = {
name : "wrench"
mass : "1.3kg"
count : "3"
}
}
dtmf_settings {
enabled = true
max_digits = 1
enabled = true
max_digits = 1
finish_digit = "#"
}
logging_settings {
enable_stackdriver_logging = true
enable_interaction_logging = true
enable_consent_based_redaction = true
}
}
git_integration_settings {
github_settings {
Expand Down
17 changes: 16 additions & 1 deletion mmv1/templates/terraform/examples/dialogflowcx_flow_full.tf.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -273,10 +273,25 @@ resource "google_dialogflow_cx_flow" "{{$.PrimaryResourceId}}" {
audio_export_gcs_destination {
uri = "${google_storage_bucket.bucket.url}/prefix-"
}
speech_settings {
endpointer_sensitivity = 30
no_speech_timeout = "3.500s"
use_timeout_based_endpointing = true
models = {
name : "wrench"
mass : "1.3kg"
count : "3"
}
}
dtmf_settings {
enabled = true
max_digits = 1
finish_digit = "#"
}
logging_settings {
enable_stackdriver_logging = true
enable_interaction_logging = true
enable_consent_based_redaction = true
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ func TestAccDialogflowCXAgent_update(t *testing.T) {
ResourceName: "google_dialogflow_cx_agent.foobar",
ImportState: true,
ImportStateVerify: true,
ImportStateVerifyIgnore: []string{"git_integration_settings.0.github_settings.0.access_token"},
ImportStateVerifyIgnore: []string{"git_integration_settings.0.github_settings.0.access_token", "enable_stackdriver_logging", "advanced_settings.0.logging_settings"},
},
{
Config: testAccDialogflowCXAgent_full(context),
Expand All @@ -38,7 +38,7 @@ func TestAccDialogflowCXAgent_update(t *testing.T) {
ResourceName: "google_dialogflow_cx_agent.foobar",
ImportState: true,
ImportStateVerify: true,
ImportStateVerifyIgnore: []string{"git_integration_settings.0.github_settings.0.access_token"},
ImportStateVerifyIgnore: []string{"git_integration_settings.0.github_settings.0.access_token", "enable_stackdriver_logging", "advanced_settings.0.logging_settings"},
},
{
Config: testAccDialogflowCXAgent_removeSettings(context),
Expand All @@ -47,7 +47,7 @@ func TestAccDialogflowCXAgent_update(t *testing.T) {
ResourceName: "google_dialogflow_cx_agent.foobar",
ImportState: true,
ImportStateVerify: true,
ImportStateVerifyIgnore: []string{"git_integration_settings.0.github_settings.0.access_token"},
ImportStateVerifyIgnore: []string{"git_integration_settings.0.github_settings.0.access_token", "enable_stackdriver_logging", "advanced_settings.0.logging_settings"},
},
},
})
Expand Down Expand Up @@ -92,11 +92,26 @@ func testAccDialogflowCXAgent_full(context map[string]interface{}) string {
audio_export_gcs_destination {
uri = "${google_storage_bucket.bucket.url}/prefix-"
}
speech_settings {
endpointer_sensitivity = 30
no_speech_timeout = "3.500s"
use_timeout_based_endpointing = true
models = {
name : "wrench"
mass : "1.3kg"
count : "3"
}
}
dtmf_settings {
enabled = true
max_digits = 1
enabled = true
max_digits = 1
finish_digit = "#"
}
logging_settings {
enable_stackdriver_logging = true
enable_interaction_logging = true
enable_consent_based_redaction = true
}
}
git_integration_settings {
github_settings {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,17 +25,19 @@ func TestAccDialogflowCXFlow_update(t *testing.T) {
Config: testAccDialogflowCXFlow_basic(context),
},
{
ResourceName: "google_dialogflow_cx_flow.my_flow",
ImportState: true,
ImportStateVerify: true,
ResourceName: "google_dialogflow_cx_flow.my_flow",
ImportState: true,
ImportStateVerify: true,
ImportStateVerifyIgnore: []string{"advanced_settings.0.logging_settings"},
},
{
Config: testAccDialogflowCXFlow_full(context),
},
{
ResourceName: "google_dialogflow_cx_flow.my_flow",
ImportState: true,
ImportStateVerify: true,
ResourceName: "google_dialogflow_cx_flow.my_flow",
ImportState: true,
ImportStateVerify: true,
ImportStateVerifyIgnore: []string{"advanced_settings.0.logging_settings"},
},
},
})
Expand Down Expand Up @@ -341,11 +343,26 @@ func testAccDialogflowCXFlow_full(context map[string]interface{}) string {
audio_export_gcs_destination {
uri = "${google_storage_bucket.bucket.url}/prefix-"
}
speech_settings {
endpointer_sensitivity = 30
no_speech_timeout = "3.500s"
use_timeout_based_endpointing = true
models = {
name : "wrench"
mass : "1.3kg"
count : "3"
}
}
dtmf_settings {
enabled = true
max_digits = 1
finish_digit = "#"
}
logging_settings {
enable_stackdriver_logging = true
enable_interaction_logging = true
enable_consent_based_redaction = true
}
}
}
`, context)
Expand Down

0 comments on commit 76dc08d

Please sign in to comment.