From 20667d47d1f6c31f274c0f870a8e1870a2a354a4 Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Thu, 5 May 2022 15:41:02 -0400 Subject: [PATCH] feat(v3beta1): added audio_export_settings (#311) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * feat: add audio export settings to security settings docs: update the doc on diagnostic info PiperOrigin-RevId: 446763565 Source-Link: https://github.com/googleapis/googleapis/commit/2d07d513b2e12e8d6f1e5823dd2626bb6f0a4f16 Source-Link: https://github.com/googleapis/googleapis-gen/commit/7cf0655ec0b71a5963081fe8c5da908fcc840e3e Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiN2NmMDY1NWVjMGI3MWE1OTYzMDgxZmU4YzVkYTkwOGZjYzg0MGUzZSJ9 * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md Co-authored-by: Owl Bot --- .../types/security_settings.py | 71 +++++++++++++++++++ .../dialogflowcx_v3beta1/types/session.py | 25 +++++-- 2 files changed, 92 insertions(+), 4 deletions(-) diff --git a/packages/google-cloud-dialogflow-cx/google/cloud/dialogflowcx_v3beta1/types/security_settings.py b/packages/google-cloud-dialogflow-cx/google/cloud/dialogflowcx_v3beta1/types/security_settings.py index 9c2774e1a4ae..df3208b86fc0 100644 --- a/packages/google-cloud-dialogflow-cx/google/cloud/dialogflowcx_v3beta1/types/security_settings.py +++ b/packages/google-cloud-dialogflow-cx/google/cloud/dialogflowcx_v3beta1/types/security_settings.py @@ -255,6 +255,27 @@ class SecuritySettings(proto.Message): purge_data_types (Sequence[google.cloud.dialogflowcx_v3beta1.types.SecuritySettings.PurgeDataType]): List of types of data to remove when retention settings triggers purge. + audio_export_settings (google.cloud.dialogflowcx_v3beta1.types.SecuritySettings.AudioExportSettings): + Controls audio export settings for post-conversation + analytics when ingesting audio to conversations via + [Participants.AnalyzeContent][] or + [Participants.StreamingAnalyzeContent][]. + + If + [retention_strategy][google.cloud.dialogflow.cx.v3beta1.SecuritySettings.retention_strategy] + is set to REMOVE_AFTER_CONVERSATION or + [audio_export_settings.gcs_bucket][] is empty, audio export + is disabled. + + If audio export is enabled, audio is recorded and saved to + [audio_export_settings.gcs_bucket][], subject to retention + policy of [audio_export_settings.gcs_bucket][]. + + This setting won't effect audio input for implicit sessions + via + [Sessions.DetectIntent][google.cloud.dialogflow.cx.v3beta1.Sessions.DetectIntent] + or + [Sessions.StreamingDetectIntent][google.cloud.dialogflow.cx.v3beta1.Sessions.StreamingDetectIntent]. insights_export_settings (google.cloud.dialogflowcx_v3beta1.types.SecuritySettings.InsightsExportSettings): Controls conversation exporting settings to Insights after conversation is completed. @@ -282,6 +303,51 @@ class PurgeDataType(proto.Enum): PURGE_DATA_TYPE_UNSPECIFIED = 0 DIALOGFLOW_HISTORY = 1 + class AudioExportSettings(proto.Message): + r"""Settings for exporting audio. + + Attributes: + gcs_bucket (str): + Cloud Storage bucket to export audio record to. You need to + grant + ``service-@gcp-sa-dialogflow.iam.gserviceaccount.com`` + the ``Storage Object Admin`` role in this bucket. + audio_export_pattern (str): + Filename pattern for exported audio. + enable_audio_redaction (bool): + Enable audio redaction if it is true. + audio_format (google.cloud.dialogflowcx_v3beta1.types.SecuritySettings.AudioExportSettings.AudioFormat): + File format for exported audio file. + Currently only in telephony recordings. + """ + + class AudioFormat(proto.Enum): + r"""File format for exported audio file. Currently only in + telephony recordings. + """ + AUDIO_FORMAT_UNSPECIFIED = 0 + MULAW = 1 + MP3 = 2 + OGG = 3 + + gcs_bucket = proto.Field( + proto.STRING, + number=1, + ) + audio_export_pattern = proto.Field( + proto.STRING, + number=2, + ) + enable_audio_redaction = proto.Field( + proto.BOOL, + number=3, + ) + audio_format = proto.Field( + proto.ENUM, + number=4, + enum="SecuritySettings.AudioExportSettings.AudioFormat", + ) + class InsightsExportSettings(proto.Message): r"""Settings for exporting conversations to `Insights `__. @@ -334,6 +400,11 @@ class InsightsExportSettings(proto.Message): number=8, enum=PurgeDataType, ) + audio_export_settings = proto.Field( + proto.MESSAGE, + number=12, + message=AudioExportSettings, + ) insights_export_settings = proto.Field( proto.MESSAGE, number=13, diff --git a/packages/google-cloud-dialogflow-cx/google/cloud/dialogflowcx_v3beta1/types/session.py b/packages/google-cloud-dialogflow-cx/google/cloud/dialogflowcx_v3beta1/types/session.py index b8ce2ef3ed68..199ae9ac2c0e 100644 --- a/packages/google-cloud-dialogflow-cx/google/cloud/dialogflowcx_v3beta1/types/session.py +++ b/packages/google-cloud-dialogflow-cx/google/cloud/dialogflowcx_v3beta1/types/session.py @@ -802,10 +802,27 @@ class QueryResult(proto.Message): Intent match result, could be an intent or an event. diagnostic_info (google.protobuf.struct_pb2.Struct): - The free-form diagnostic info. For example, - this field could contain webhook call latency. - The string keys of the Struct's fields map can - change without notice. + The free-form diagnostic info. For example, this field could + contain webhook call latency. The fields of this data can + change without notice, so you should not write code that + depends on its structure. + + One of the fields is called "Alternative Matched Intents", + which may aid with debugging. The following describes these + intent results: + + - The list is empty if no intent was matched to end-user + input. + - Only intents that are referenced in the currently active + flow are included. + - The matched intent is included. + - Other intents that could have matched end-user input, but + did not match because they are referenced by intent + routes that are out of + `scope `__, + are included. + - Other intents referenced by intent routes in scope that + matched end-user input, but had a lower confidence score. sentiment_analysis_result (google.cloud.dialogflowcx_v3beta1.types.SentimentAnalysisResult): The sentiment analyss result, which depends on [``analyze_query_text_sentiment``]