diff --git a/.github/.OwlBot.lock.yaml b/.github/.OwlBot.lock.yaml index 64f82d6b..757c9dca 100644 --- a/.github/.OwlBot.lock.yaml +++ b/.github/.OwlBot.lock.yaml @@ -13,5 +13,5 @@ # limitations under the License. docker: image: gcr.io/cloud-devrel-public-resources/owlbot-python:latest - digest: sha256:bc5eed3804aec2f05fad42aacf973821d9500c174015341f721a984a0825b6fd -# created: 2022-04-21T15:43:16.246106921Z + digest: sha256:81ed5ecdfc7cac5b699ba4537376f3563f6f04122c4ec9e735d3b3dc1d43dd32 +# created: 2022-05-05T22:08:23.383410683Z diff --git a/.github/auto-approve.yml b/.github/auto-approve.yml new file mode 100644 index 00000000..311ebbb8 --- /dev/null +++ b/.github/auto-approve.yml @@ -0,0 +1,3 @@ +# https://github.com/googleapis/repo-automation-bots/tree/main/packages/auto-approve +processes: + - "OwlBotTemplateChanges" diff --git a/CHANGELOG.md b/CHANGELOG.md index 0a86bce1..a77d3aa0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,17 @@ # Changelog +## [1.12.0](https://github.com/googleapis/python-dialogflow-cx/compare/v1.11.0...v1.12.0) (2022-05-09) + + +### Features + +* **v3beta1:** added audio_export_settings ([#311](https://github.com/googleapis/python-dialogflow-cx/issues/311)) ([228ae83](https://github.com/googleapis/python-dialogflow-cx/commit/228ae8310b71412c1636a5ef214f62dad6473e40)) + + +### Documentation + +* **v3:** update the doc on diagnostic info ([#314](https://github.com/googleapis/python-dialogflow-cx/issues/314)) ([6109b64](https://github.com/googleapis/python-dialogflow-cx/commit/6109b64efb85480fdd9793476db14e65c40a0333)) + ## [1.11.0](https://github.com/googleapis/python-dialogflow-cx/compare/v1.10.0...v1.11.0) (2022-05-03) diff --git a/dialogflow-cx-v3-py.tar.gz b/dialogflow-cx-v3-py.tar.gz index e69de29b..7eef5dbd 100644 Binary files a/dialogflow-cx-v3-py.tar.gz and b/dialogflow-cx-v3-py.tar.gz differ diff --git a/google/cloud/dialogflowcx_v3/types/session.py b/google/cloud/dialogflowcx_v3/types/session.py index c13f5bc1..3d1e2f1f 100644 --- a/google/cloud/dialogflowcx_v3/types/session.py +++ b/google/cloud/dialogflowcx_v3/types/session.py @@ -800,10 +800,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_v3.types.SentimentAnalysisResult): The sentiment analyss result, which depends on [``analyze_query_text_sentiment``] diff --git a/google/cloud/dialogflowcx_v3beta1/types/security_settings.py b/google/cloud/dialogflowcx_v3beta1/types/security_settings.py index 9c2774e1..df3208b8 100644 --- a/google/cloud/dialogflowcx_v3beta1/types/security_settings.py +++ b/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/google/cloud/dialogflowcx_v3beta1/types/session.py b/google/cloud/dialogflowcx_v3beta1/types/session.py index b8ce2ef3..199ae9ac 100644 --- a/google/cloud/dialogflowcx_v3beta1/types/session.py +++ b/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``] diff --git a/samples/snippets/requirements.txt b/samples/snippets/requirements.txt index ee7debd1..062ed1c6 100644 --- a/samples/snippets/requirements.txt +++ b/samples/snippets/requirements.txt @@ -1,2 +1,2 @@ -google-cloud-dialogflow-cx==1.10.0 +google-cloud-dialogflow-cx==1.11.0 Flask==2.1.2 diff --git a/scripts/readme-gen/readme_gen.py b/scripts/readme-gen/readme_gen.py index d309d6e9..91b59676 100644 --- a/scripts/readme-gen/readme_gen.py +++ b/scripts/readme-gen/readme_gen.py @@ -28,7 +28,10 @@ jinja_env = jinja2.Environment( trim_blocks=True, loader=jinja2.FileSystemLoader( - os.path.abspath(os.path.join(os.path.dirname(__file__), 'templates')))) + os.path.abspath(os.path.join(os.path.dirname(__file__), "templates")) + ), + autoescape=True, +) README_TMPL = jinja_env.get_template('README.tmpl.rst') diff --git a/setup.py b/setup.py index 5af06827..8614e50c 100644 --- a/setup.py +++ b/setup.py @@ -19,7 +19,7 @@ import os import setuptools # type: ignore -version = "1.11.0" +version = "1.12.0" package_root = os.path.abspath(os.path.dirname(__file__))