From f04a335edb39561b6d58e95d857b136b862212d7 Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Wed, 1 Mar 2023 20:42:37 +0000 Subject: [PATCH 1/8] chore(deps): update dependency google-cloud-dialogflow-cx to v1.20.0 (#509) --- samples/snippets/requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/samples/snippets/requirements.txt b/samples/snippets/requirements.txt index 97f35cfe..453fd9e5 100644 --- a/samples/snippets/requirements.txt +++ b/samples/snippets/requirements.txt @@ -1,3 +1,3 @@ -google-cloud-dialogflow-cx==1.19.0 +google-cloud-dialogflow-cx==1.20.0 Flask==2.2.3 python-dateutil==2.8.2 From 017fdb8bf02458fc12fd211fc682d4cbc07e1841 Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Fri, 3 Mar 2023 20:49:08 +0000 Subject: [PATCH 2/8] chore(deps): update dependency pytest to v7.2.2 (#510) --- samples/snippets/requirements-test.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/samples/snippets/requirements-test.txt b/samples/snippets/requirements-test.txt index 805eb2a9..c021c5b5 100644 --- a/samples/snippets/requirements-test.txt +++ b/samples/snippets/requirements-test.txt @@ -1 +1 @@ -pytest==7.2.1 +pytest==7.2.2 From fc0ecdf2f3d29f23de45e6bd44f1c1ec17ddb4ef Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Mon, 6 Mar 2023 14:35:15 -0500 Subject: [PATCH 3/8] docs: add clarification in AudioInput (#511) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * fix: change java package of Cloud Build v2 PiperOrigin-RevId: 514411662 Source-Link: https://github.com/googleapis/googleapis/commit/1e379f297bbe65828a4e21bfe8098cf2423ba9a9 Source-Link: https://github.com/googleapis/googleapis-gen/commit/a044b7fd8d7b7904e192865365dcafe55601ba85 Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiYTA0NGI3ZmQ4ZDdiNzkwNGUxOTI4NjUzNjVkY2FmZTU1NjAxYmE4NSJ9 * 🦉 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 --- .../dialogflowcx_v3beta1/services/deployments/async_client.py | 2 +- .../cloud/dialogflowcx_v3beta1/services/deployments/client.py | 2 +- .../services/deployments/transports/rest.py | 2 +- google/cloud/dialogflowcx_v3beta1/types/deployment.py | 2 +- google/cloud/dialogflowcx_v3beta1/types/session.py | 4 ++-- .../snippet_metadata_google.cloud.dialogflow.cx.v3.json | 2 +- .../snippet_metadata_google.cloud.dialogflow.cx.v3beta1.json | 2 +- 7 files changed, 8 insertions(+), 8 deletions(-) diff --git a/google/cloud/dialogflowcx_v3beta1/services/deployments/async_client.py b/google/cloud/dialogflowcx_v3beta1/services/deployments/async_client.py index 77f2071f..b040acb6 100644 --- a/google/cloud/dialogflowcx_v3beta1/services/deployments/async_client.py +++ b/google/cloud/dialogflowcx_v3beta1/services/deployments/async_client.py @@ -399,7 +399,7 @@ async def sample_get_deployment(): Returns: google.cloud.dialogflowcx_v3beta1.types.Deployment: - Represents an deployment in an + Represents a deployment in an environment. A deployment happens when a flow version configured to be active in the environment. You can configure diff --git a/google/cloud/dialogflowcx_v3beta1/services/deployments/client.py b/google/cloud/dialogflowcx_v3beta1/services/deployments/client.py index e477cd9c..1fbd5dff 100644 --- a/google/cloud/dialogflowcx_v3beta1/services/deployments/client.py +++ b/google/cloud/dialogflowcx_v3beta1/services/deployments/client.py @@ -704,7 +704,7 @@ def sample_get_deployment(): Returns: google.cloud.dialogflowcx_v3beta1.types.Deployment: - Represents an deployment in an + Represents a deployment in an environment. A deployment happens when a flow version configured to be active in the environment. You can configure diff --git a/google/cloud/dialogflowcx_v3beta1/services/deployments/transports/rest.py b/google/cloud/dialogflowcx_v3beta1/services/deployments/transports/rest.py index 7e232356..6a40b0b8 100644 --- a/google/cloud/dialogflowcx_v3beta1/services/deployments/transports/rest.py +++ b/google/cloud/dialogflowcx_v3beta1/services/deployments/transports/rest.py @@ -384,7 +384,7 @@ def __call__( Returns: ~.deployment.Deployment: - Represents an deployment in an + Represents a deployment in an environment. A deployment happens when a flow version configured to be active in the environment. You can configure diff --git a/google/cloud/dialogflowcx_v3beta1/types/deployment.py b/google/cloud/dialogflowcx_v3beta1/types/deployment.py index 734e767e..dd0358b0 100644 --- a/google/cloud/dialogflowcx_v3beta1/types/deployment.py +++ b/google/cloud/dialogflowcx_v3beta1/types/deployment.py @@ -34,7 +34,7 @@ class Deployment(proto.Message): - r"""Represents an deployment in an environment. A deployment + r"""Represents a deployment in an environment. A deployment happens when a flow version configured to be active in the environment. You can configure running pre-deployment steps, e.g. running validation test cases, experiment auto-rollout, diff --git a/google/cloud/dialogflowcx_v3beta1/types/session.py b/google/cloud/dialogflowcx_v3beta1/types/session.py index 5fed55ce..87a84e84 100644 --- a/google/cloud/dialogflowcx_v3beta1/types/session.py +++ b/google/cloud/dialogflowcx_v3beta1/types/session.py @@ -1011,8 +1011,8 @@ class AudioInput(proto.Message): to process the speech audio. audio (bytes): The natural language speech audio to be processed. A single - request can contain up to 1 minute of speech audio data. The - [transcribed + request can contain up to 2 minutes of speech audio data. + The [transcribed text][google.cloud.dialogflow.cx.v3beta1.QueryResult.transcript] cannot contain more than 256 bytes. diff --git a/samples/generated_samples/snippet_metadata_google.cloud.dialogflow.cx.v3.json b/samples/generated_samples/snippet_metadata_google.cloud.dialogflow.cx.v3.json index 23a8c2b1..4fe8e9ba 100644 --- a/samples/generated_samples/snippet_metadata_google.cloud.dialogflow.cx.v3.json +++ b/samples/generated_samples/snippet_metadata_google.cloud.dialogflow.cx.v3.json @@ -8,7 +8,7 @@ ], "language": "PYTHON", "name": "google-cloud-dialogflow-cx", - "version": "1.20.0" + "version": "0.1.0" }, "snippets": [ { diff --git a/samples/generated_samples/snippet_metadata_google.cloud.dialogflow.cx.v3beta1.json b/samples/generated_samples/snippet_metadata_google.cloud.dialogflow.cx.v3beta1.json index a5689da3..bddeff21 100644 --- a/samples/generated_samples/snippet_metadata_google.cloud.dialogflow.cx.v3beta1.json +++ b/samples/generated_samples/snippet_metadata_google.cloud.dialogflow.cx.v3beta1.json @@ -8,7 +8,7 @@ ], "language": "PYTHON", "name": "google-cloud-dialogflow-cx", - "version": "1.20.0" + "version": "0.1.0" }, "snippets": [ { From b659679f63525d736afe682331f5579132c5d091 Mon Sep 17 00:00:00 2001 From: Yvonne Li Date: Wed, 8 Mar 2023 18:58:00 -0800 Subject: [PATCH 4/8] chore(sample): Monorepo Migration Completed and Deprecate (#514) * migrate and delete * change folder * typo --- samples/AUTHORING_GUIDE.md | 1 - samples/CONTRIBUTING.md | 1 - samples/snippets/README.rst | 222 +------------ samples/snippets/README.rst.in | 25 -- samples/snippets/create_agent.py | 40 --- samples/snippets/create_agent_test.py | 41 --- samples/snippets/detect_intent_audio.py | 116 ------- samples/snippets/detect_intent_audio_test.py | 48 --- .../detect_intent_disabled_webhook.py | 94 ------ .../detect_intent_disabled_webhook_test.py | 42 --- samples/snippets/detect_intent_event.py | 90 ----- samples/snippets/detect_intent_event_test.py | 48 --- samples/snippets/detect_intent_stream.py | 157 --------- samples/snippets/detect_intent_stream_test.py | 50 --- .../detect_intent_synthesize_tts_response.py | 104 ------ ...ect_intent_synthesize_tts_response_test.py | 41 --- samples/snippets/detect_intent_texts.py | 110 ------- samples/snippets/detect_intent_texts_test.py | 46 --- .../detect_intent_with_intent_input.py | 94 ------ .../detect_intent_with_intent_input_test.py | 38 --- .../detect_intent_with_sentiment_analysis.py | 89 ----- ...ect_intent_with_sentiment_analysis_test.py | 42 --- samples/snippets/list_testcase_results.py | 35 -- .../snippets/list_testcase_results_test.py | 29 -- samples/snippets/list_training_phrases.py | 41 --- .../snippets/list_training_phrases_test.py | 34 -- samples/snippets/long_running_operation.py | 43 --- .../snippets/long_running_operation_test.py | 66 ---- samples/snippets/noxfile.py | 293 ----------------- samples/snippets/noxfile_config.py | 40 --- samples/snippets/page_management.py | 79 ----- samples/snippets/page_management_test.py | 114 ------- samples/snippets/requirements-test.txt | 1 - samples/snippets/requirements.txt | 3 - samples/snippets/resources/hello.wav | Bin 29564 -> 0 bytes ...treaming_detect_intent_partial_response.py | 125 ------- ...ing_detect_intent_partial_response_test.py | 49 --- samples/snippets/update_intent.py | 33 -- samples/snippets/update_intent_test.py | 82 ----- samples/snippets/webhook.py | 42 --- .../webhook_configure_session_parameters.py | 38 --- ...bhook_configure_session_parameters_test.py | 35 -- samples/snippets/webhook_log_session_info.py | 45 --- .../snippets/webhook_log_session_info_test.py | 64 ---- samples/snippets/webhook_prebuilt_telecom.py | 299 ----------------- .../snippets/webhook_prebuilt_telecom_test.py | 311 ------------------ samples/snippets/webhook_test.py | 34 -- .../webhook_validate_form_parameter.py | 45 --- .../webhook_validate_form_parameter_test.py | 35 -- 49 files changed, 1 insertion(+), 3553 deletions(-) delete mode 100644 samples/AUTHORING_GUIDE.md delete mode 100644 samples/CONTRIBUTING.md delete mode 100644 samples/snippets/README.rst.in delete mode 100644 samples/snippets/create_agent.py delete mode 100644 samples/snippets/create_agent_test.py delete mode 100644 samples/snippets/detect_intent_audio.py delete mode 100644 samples/snippets/detect_intent_audio_test.py delete mode 100644 samples/snippets/detect_intent_disabled_webhook.py delete mode 100644 samples/snippets/detect_intent_disabled_webhook_test.py delete mode 100644 samples/snippets/detect_intent_event.py delete mode 100644 samples/snippets/detect_intent_event_test.py delete mode 100644 samples/snippets/detect_intent_stream.py delete mode 100644 samples/snippets/detect_intent_stream_test.py delete mode 100644 samples/snippets/detect_intent_synthesize_tts_response.py delete mode 100644 samples/snippets/detect_intent_synthesize_tts_response_test.py delete mode 100644 samples/snippets/detect_intent_texts.py delete mode 100644 samples/snippets/detect_intent_texts_test.py delete mode 100644 samples/snippets/detect_intent_with_intent_input.py delete mode 100644 samples/snippets/detect_intent_with_intent_input_test.py delete mode 100644 samples/snippets/detect_intent_with_sentiment_analysis.py delete mode 100644 samples/snippets/detect_intent_with_sentiment_analysis_test.py delete mode 100644 samples/snippets/list_testcase_results.py delete mode 100644 samples/snippets/list_testcase_results_test.py delete mode 100644 samples/snippets/list_training_phrases.py delete mode 100644 samples/snippets/list_training_phrases_test.py delete mode 100644 samples/snippets/long_running_operation.py delete mode 100644 samples/snippets/long_running_operation_test.py delete mode 100644 samples/snippets/noxfile.py delete mode 100644 samples/snippets/noxfile_config.py delete mode 100644 samples/snippets/page_management.py delete mode 100644 samples/snippets/page_management_test.py delete mode 100644 samples/snippets/requirements-test.txt delete mode 100644 samples/snippets/requirements.txt delete mode 100644 samples/snippets/resources/hello.wav delete mode 100644 samples/snippets/streaming_detect_intent_partial_response.py delete mode 100644 samples/snippets/streaming_detect_intent_partial_response_test.py delete mode 100644 samples/snippets/update_intent.py delete mode 100644 samples/snippets/update_intent_test.py delete mode 100644 samples/snippets/webhook.py delete mode 100644 samples/snippets/webhook_configure_session_parameters.py delete mode 100644 samples/snippets/webhook_configure_session_parameters_test.py delete mode 100644 samples/snippets/webhook_log_session_info.py delete mode 100644 samples/snippets/webhook_log_session_info_test.py delete mode 100644 samples/snippets/webhook_prebuilt_telecom.py delete mode 100644 samples/snippets/webhook_prebuilt_telecom_test.py delete mode 100644 samples/snippets/webhook_test.py delete mode 100644 samples/snippets/webhook_validate_form_parameter.py delete mode 100644 samples/snippets/webhook_validate_form_parameter_test.py diff --git a/samples/AUTHORING_GUIDE.md b/samples/AUTHORING_GUIDE.md deleted file mode 100644 index ab870f39..00000000 --- a/samples/AUTHORING_GUIDE.md +++ /dev/null @@ -1 +0,0 @@ -See https://github.com/GoogleCloudPlatform/python-docs-samples/blob/master/AUTHORING_GUIDE.md diff --git a/samples/CONTRIBUTING.md b/samples/CONTRIBUTING.md deleted file mode 100644 index fc4b8941..00000000 --- a/samples/CONTRIBUTING.md +++ /dev/null @@ -1 +0,0 @@ -See https://github.com/GoogleCloudPlatform/python-docs-samples/blob/master/CONTRIBUTING.md diff --git a/samples/snippets/README.rst b/samples/snippets/README.rst index 7c403a4d..20911a3f 100644 --- a/samples/snippets/README.rst +++ b/samples/snippets/README.rst @@ -1,221 +1 @@ - -.. This file is automatically generated. Do not edit this file directly. - -Dialogflow CX API Python Samples -=============================================================================== - -.. image:: https://gstatic.com/cloudssh/images/open-btn.png - :target: https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/GoogleCloudPlatform/python-docs-samples&page=editor&open_in_editor=/README.rst - - -This directory contains samples for Dialogflow CX API. The `Dialogflow CX API`_ enables you to create conversational experiences across devices and platforms. - - - - -.. _Dialogflow CX API: https://cloud.google.com/dialogflow/cx/docs/ - - -Setup -------------------------------------------------------------------------------- - - - -Authentication -++++++++++++++ - -This sample requires you to have authentication setup. Refer to the -`Authentication Getting Started Guide`_ for instructions on setting up -credentials for applications. - -.. _Authentication Getting Started Guide: - https://cloud.google.com/docs/authentication/getting-started - - - - -Install Dependencies -++++++++++++++++++++ - -#. Clone python-docs-samples and change directory to the sample directory you want to use. - - .. code-block:: bash - - $ git clone https://github.com/GoogleCloudPlatform/python-docs-samples.git - -#. Install `pip`_ and `virtualenv`_ if you do not already have them. You may want to refer to the `Python Development Environment Setup Guide`_ for Google Cloud Platform for instructions. - - .. _Python Development Environment Setup Guide: - https://cloud.google.com/python/setup - -#. Create a virtualenv. Samples are compatible with Python 3.6+. - - .. code-block:: bash - - $ virtualenv env - $ source env/bin/activate - -#. Install the dependencies needed to run the samples. - - .. code-block:: bash - - $ pip install -r requirements.txt - -.. _pip: https://pip.pypa.io/ -.. _virtualenv: https://virtualenv.pypa.io/ - - - - - - -Samples -------------------------------------------------------------------------------- - - -Detect Intent Text -+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ - -.. image:: https://gstatic.com/cloudssh/images/open-btn.png - :target: https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/GoogleCloudPlatform/python-docs-samples&page=editor&open_in_editor=/detect_intent_texts.py,/README.rst - - - - -To run this sample: - -.. code-block:: bash - - $ python detect_intent_texts.py - - - usage: detect_intent_texts.py [-h] --agent AGENT [--session-id SESSION_ID] - [--language-code LANGUAGE_CODE] - texts [texts ...] - - DialogFlow API Detect Intent Python sample with text inputs. - - Examples: - python detect_intent_texts.py -h - python detect_intent_texts.py --agent AGENT --session-id SESSION_ID "hello" "book a meeting room" "Mountain View" - python detect_intent_texts.py --agent AGENT --session-id SESSION_ID "tomorrow" "10 AM" "2 hours" "10 people" "A" "yes" - - positional arguments: - texts Text inputs. - - optional arguments: - -h, --help show this help message and exit - --agent AGENT Agent resource name. Required. - --session-id SESSION_ID - Identifier of the DetectIntent session. Defaults to a - random UUID. - --language-code LANGUAGE_CODE - Language code of the query. Defaults to "en-US". - - - - - -Detect Intent Audio -+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ - -.. image:: https://gstatic.com/cloudssh/images/open-btn.png - :target: https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/GoogleCloudPlatform/python-docs-samples&page=editor&open_in_editor=/detect_intent_audio.py,/README.rst - - - - -To run this sample: - -.. code-block:: bash - - $ python detect_intent_audio.py - - - usage: detect_intent_audio.py [-h] --agent AGENT [--session-id SESSION_ID] - [--language-code LANGUAGE_CODE] - --audio-file-path AUDIO_FILE_PATH - - DialogFlow API Detect Intent Python sample with audio file. - - Examples: - python detect_intent_audio.py -h - python detect_intent_audio.py --agent AGENT --session-id SESSION_ID --audio-file-path resources/hello.wav - - optional arguments: - -h, --help show this help message and exit - --agent AGENT Agent resource name. Required. - --session-id SESSION_ID - Identifier of the DetectIntent session. Defaults to a - random UUID. - --language-code LANGUAGE_CODE - Language code of the query. Defaults to "en-US". - --audio-file-path AUDIO_FILE_PATH - Path to the audio file. - - - - - -Detect Intent Stream -+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ - -.. image:: https://gstatic.com/cloudssh/images/open-btn.png - :target: https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/GoogleCloudPlatform/python-docs-samples&page=editor&open_in_editor=/detect_intent_stream.py,/README.rst - - - - -To run this sample: - -.. code-block:: bash - - $ python detect_intent_stream.py - - - usage: detect_intent_stream.py [-h] --agent AGENT [--session-id SESSION_ID] - [--language-code LANGUAGE_CODE] - --audio-file-path AUDIO_FILE_PATH - - DialogFlow API Detect Intent Python sample with audio files processed as an audio stream. - - Examples: - python detect_intent_stream.py -h - python detect_intent_stream.py --agent AGENT --session-id SESSION_ID --audio-file-path resources/hello.wav - - optional arguments: - -h, --help show this help message and exit - --agent AGENT Agent resource name. Required. - --session-id SESSION_ID - Identifier of the DetectIntent session. Defaults to a - random UUID. - --language-code LANGUAGE_CODE - Language code of the query. Defaults to "en-US". - --audio-file-path AUDIO_FILE_PATH - Path to the audio file. - - - - - - - - - -The client library -------------------------------------------------------------------------------- - -This sample uses the `Google Cloud Client Library for Python`_. -You can read the documentation for more details on API usage and use GitHub -to `browse the source`_ and `report issues`_. - -.. _Google Cloud Client Library for Python: - https://googlecloudplatform.github.io/google-cloud-python/ -.. _browse the source: - https://github.com/GoogleCloudPlatform/google-cloud-python -.. _report issues: - https://github.com/GoogleCloudPlatform/google-cloud-python/issues - - - -.. _Google Cloud SDK: https://cloud.google.com/sdk/ +The samples have migrated, please see the samples on https://github.com/GoogleCloudPlatform/python-docs-samples/tree/main/dialogflow-cx. \ No newline at end of file diff --git a/samples/snippets/README.rst.in b/samples/snippets/README.rst.in deleted file mode 100644 index 043c9b77..00000000 --- a/samples/snippets/README.rst.in +++ /dev/null @@ -1,25 +0,0 @@ -# This file is used to generate README.rst - -product: - name: Dialogflow CX API - short_name: Dialogflow CX API - url: https://cloud.google.com/dialogflow/cx/docs/ - description: > - The `Dialogflow CX API`_ enables you to create conversational experiences across devices and platforms. - -setup: -- auth -- install_deps - -samples: -- name: Detect Intent Text - file: detect_intent_texts.py - show_help: True -- name: Detect Intent Audio - file: detect_intent_audio.py - show_help: True -- name: Detect Intent Stream - file: detect_intent_stream.py - show_help: True - -cloud_client_library: true diff --git a/samples/snippets/create_agent.py b/samples/snippets/create_agent.py deleted file mode 100644 index daff5ff6..00000000 --- a/samples/snippets/create_agent.py +++ /dev/null @@ -1,40 +0,0 @@ -# Copyright 2021 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - - -"""DialogFlow API Create Agent Sample""" - -## [START dialogflow_cx_create_agent_sample] -from google.cloud.dialogflowcx_v3.services.agents.client import AgentsClient -from google.cloud.dialogflowcx_v3.types.agent import Agent - - -def create_agent(project_id, display_name): - - parent = "projects/" + project_id + "/locations/global" - - agents_client = AgentsClient() - - agent = Agent( - display_name=display_name, - default_language_code="en", - time_zone="America/Los_Angeles", - ) - - response = agents_client.create_agent(request={"agent": agent, "parent": parent}) - - return response - - -## [END dialogflow_cx_create_agent_sample] diff --git a/samples/snippets/create_agent_test.py b/samples/snippets/create_agent_test.py deleted file mode 100644 index 25b5f80d..00000000 --- a/samples/snippets/create_agent_test.py +++ /dev/null @@ -1,41 +0,0 @@ -# Copyright 2020, Google LLC -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -"""Test for create_agent""" - -import os -import uuid - -from google.cloud.dialogflowcx_v3.services.agents.client import AgentsClient -from google.cloud.dialogflowcx_v3.types.agent import DeleteAgentRequest - -import pytest - -from create_agent import create_agent - -PROJECT_ID = os.getenv("GOOGLE_CLOUD_PROJECT") -pytest.AGENT_PATH = "" - - -def delete_agent(name): - agents_client = AgentsClient() - request = DeleteAgentRequest(name=name) - agents_client.delete_agent(request=request) - - -def test_create_agent(): - agentName = f"fake_agent_{uuid.uuid4()}" - response = create_agent(PROJECT_ID, agentName) - delete_agent(response.name) - - assert response.display_name == agentName diff --git a/samples/snippets/detect_intent_audio.py b/samples/snippets/detect_intent_audio.py deleted file mode 100644 index c4ba5b02..00000000 --- a/samples/snippets/detect_intent_audio.py +++ /dev/null @@ -1,116 +0,0 @@ -#!/usr/bin/env python - -# Copyright 2020 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -"""DialogFlow API Detect Intent Python sample with audio file. - -Examples: - python detect_intent_audio.py -h - python detect_intent_audio.py --agent AGENT \ - --session-id SESSION_ID --audio-file-path resources/hello.wav -""" - -import argparse -import uuid - -from google.cloud.dialogflowcx_v3.services.agents import AgentsClient -from google.cloud.dialogflowcx_v3.services.sessions import SessionsClient -from google.cloud.dialogflowcx_v3.types import audio_config -from google.cloud.dialogflowcx_v3.types import session - - -# [START dialogflow_detect_intent_audio] -def run_sample(): - # TODO(developer): Replace these values when running the function - project_id = "YOUR-PROJECT-ID" - # For more information about regionalization see https://cloud.google.com/dialogflow/cx/docs/how/region - location_id = "YOUR-LOCATION-ID" - # For more info on agents see https://cloud.google.com/dialogflow/cx/docs/concept/agent - agent_id = "YOUR-AGENT-ID" - agent = f"projects/{project_id}/locations/{location_id}/agents/{agent_id}" - # For more information on sessions see https://cloud.google.com/dialogflow/cx/docs/concept/session - session_id = str(uuid.uuid4()) - audio_file_path = "YOUR-AUDIO-FILE-PATH" - # For more supported languages see https://cloud.google.com/dialogflow/es/docs/reference/language - language_code = "en-us" - - detect_intent_audio(agent, session_id, audio_file_path, language_code) - - -def detect_intent_audio(agent, session_id, audio_file_path, language_code): - """Returns the result of detect intent with an audio file as input. - - Using the same `session_id` between requests allows continuation - of the conversation.""" - session_path = f"{agent}/sessions/{session_id}" - print(f"Session path: {session_path}\n") - client_options = None - agent_components = AgentsClient.parse_agent_path(agent) - location_id = agent_components["location"] - if location_id != "global": - api_endpoint = f"{location_id}-dialogflow.googleapis.com:443" - print(f"API Endpoint: {api_endpoint}\n") - client_options = {"api_endpoint": api_endpoint} - session_client = SessionsClient(client_options=client_options) - - input_audio_config = audio_config.InputAudioConfig( - audio_encoding=audio_config.AudioEncoding.AUDIO_ENCODING_LINEAR_16, - sample_rate_hertz=24000, - ) - - with open(audio_file_path, "rb") as audio_file: - input_audio = audio_file.read() - - audio_input = session.AudioInput(config=input_audio_config, audio=input_audio) - query_input = session.QueryInput(audio=audio_input, language_code=language_code) - request = session.DetectIntentRequest(session=session_path, query_input=query_input) - response = session_client.detect_intent(request=request) - - print("=" * 20) - print(f"Query text: {response.query_result.transcript}") - response_messages = [ - " ".join(msg.text.text) for msg in response.query_result.response_messages - ] - print(f"Response text: {' '.join(response_messages)}\n") - - -# [END dialogflow_detect_intent_audio] - -if __name__ == "__main__": - parser = argparse.ArgumentParser( - description=__doc__, formatter_class=argparse.RawDescriptionHelpFormatter - ) - parser.add_argument( - "--agent", help="Agent resource name. Required.", required=True - ) - parser.add_argument( - "--session-id", - help="Identifier of the DetectIntent session. " "Defaults to a random UUID.", - default=str(uuid.uuid4()), - ) - parser.add_argument( - "--language-code", - help='Language code of the query. Defaults to "en-US".', - default="en-US", - ) - parser.add_argument( - "--audio-file-path", help="Path to the audio file.", required=True - ) - - args = parser.parse_args() - - detect_intent_audio( - args.agent, args.session_id, args.audio_file_path, args.language_code - ) diff --git a/samples/snippets/detect_intent_audio_test.py b/samples/snippets/detect_intent_audio_test.py deleted file mode 100644 index f0515428..00000000 --- a/samples/snippets/detect_intent_audio_test.py +++ /dev/null @@ -1,48 +0,0 @@ -# Copyright 2020, Google LLC -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -"""Tests for detect_intent_texts.""" - -from __future__ import absolute_import - -import os -import uuid - - -from detect_intent_audio import detect_intent_audio - -DIRNAME = os.path.realpath(os.path.dirname(__file__)) -PROJECT_ID = os.getenv("GOOGLE_CLOUD_PROJECT") -AGENT_ID = os.getenv("AGENT_ID") -AGENT_ID_US_CENTRAL1 = os.getenv("AGENT_ID_US_CENTRAL1") -AGENT = f"projects/{PROJECT_ID}/locations/global/agents/{AGENT_ID}" -AGENT_US_CENTRAL1 = ( - f"projects/{PROJECT_ID}/locations/us-central1/agents/{AGENT_ID_US_CENTRAL1}" -) -SESSION_ID = uuid.uuid4() -AUDIO_PATH = os.getenv("AUDIO_PATH") -AUDIO = f"{DIRNAME}/{AUDIO_PATH}" - - -def test_detect_intent_texts(capsys): - detect_intent_audio(AGENT, SESSION_ID, AUDIO, "en-US") - out, _ = capsys.readouterr() - - assert "Response text: Hi! I'm the virtual flights agent." in out - - -def test_detect_intent_texts_regional(capsys): - detect_intent_audio(AGENT_US_CENTRAL1, SESSION_ID, AUDIO, "en-US") - out, _ = capsys.readouterr() - - assert "Response text: Hi! I'm the virtual flights agent." in out diff --git a/samples/snippets/detect_intent_disabled_webhook.py b/samples/snippets/detect_intent_disabled_webhook.py deleted file mode 100644 index 8e157199..00000000 --- a/samples/snippets/detect_intent_disabled_webhook.py +++ /dev/null @@ -1,94 +0,0 @@ -#!/usr/bin/env python - -# Copyright 2022 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -"""DialogFlow Detect Intent Python sample, with a disabled webhook.""" - - -# [START dialogflow_cx_detect_intent_with_disabled_webhook] -import uuid - -from google.cloud.dialogflowcx_v3.services.sessions import SessionsClient -from google.cloud.dialogflowcx_v3.types import session - - -def run_sample(): - # TODO(developer): Update these values when running the function - project_id = "YOUR-PROJECT-ID" - location = "YOUR-LOCATION-ID" - agent_id = "YOUR-AGENT-ID" - text = "Perfect!" - language_code = "en-us" - - detect_intent_disabled_webhook( - project_id, - location, - agent_id, - text, - language_code, - ) - - -def detect_intent_disabled_webhook( - project_id, - location, - agent_id, - text, - language_code, -): - """Returns the result of detect intent with sentiment analysis""" - - client_options = None - if location != "global": - api_endpoint = f"{location}-dialogflow.googleapis.com:443" - print(f"API Endpoint: {api_endpoint}\n") - client_options = {"api_endpoint": api_endpoint} - session_client = SessionsClient(client_options=client_options) - session_id = str(uuid.uuid4()) - session_path = session_client.session_path( - project=project_id, - location=location, - agent=agent_id, - session=session_id, - ) - - # Prepare request - text_input = session.TextInput(text=text) - query_input = session.QueryInput(text=text_input, language_code=language_code) - query_params = session.QueryParameters( - disable_webhook=True, - ) - request = session.DetectIntentRequest( - session=session_path, - query_input=query_input, - query_params=query_params, - ) - - response = session_client.detect_intent(request=request) - print(f"Detect Intent Request: {request.query_params.disable_webhook}") - response_text = [] - for message in response.query_result.response_messages: - if message.text: - curr_response_text = message.text.text - print(f"Agent Response: {curr_response_text}") - response_text.append(curr_response_text) - return response_text - - -# [END dialogflow_cx_detect_intent_with_disabled_webhook] - - -if __name__ == "__main__": - run_sample() diff --git a/samples/snippets/detect_intent_disabled_webhook_test.py b/samples/snippets/detect_intent_disabled_webhook_test.py deleted file mode 100644 index 624dfd70..00000000 --- a/samples/snippets/detect_intent_disabled_webhook_test.py +++ /dev/null @@ -1,42 +0,0 @@ -# Copyright 2022, Google LLC -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -"""Tests for detect_intent_with_sentiment_analysis.py""" - -from __future__ import absolute_import - -import os - -from detect_intent_disabled_webhook import detect_intent_disabled_webhook - - -PROJECT_ID = os.getenv("GOOGLE_CLOUD_PROJECT") -AGENT_ID = os.getenv("AGENT_ID") - - -def test_detect_intent_positive(): - response_text_list = detect_intent_disabled_webhook( - PROJECT_ID, - "global", - AGENT_ID, - "Perfect!", - "en-us", - ) - for response_text in response_text_list: - assert response_text[0] in [ - "You are welcome!", - "It's my pleasure.", - "Anytime.", - "Of course.", - "It's my pleasure to serve you.", - ] diff --git a/samples/snippets/detect_intent_event.py b/samples/snippets/detect_intent_event.py deleted file mode 100644 index 211ff208..00000000 --- a/samples/snippets/detect_intent_event.py +++ /dev/null @@ -1,90 +0,0 @@ -#!/usr/bin/env python - -# Copyright 2022 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -"""DialogFlow Detects intent using EventInput.""" - - -# [START dialogflow_cx_v3_detect_intent_event_input_async] -import uuid - -from google.cloud.dialogflowcx_v3.services.sessions import SessionsClient -from google.cloud.dialogflowcx_v3.types import session - - -def run_sample(): - # TODO(developer): Update these values when running the function - # project_id = "YOUR-PROJECT-ID" - # location = "YOUR-LOCATION-ID" - # agent_id = "YOUR-AGENT-ID" - # event = "YOUR-EVENT" - # language_code = "YOUR-LANGUAGE-CODE" - - project_id = "dialogflow-cx-demo-1-348717" - location = "global" - agent_id = "8caa6b47-5dd7-4380-b86e-ea4301d565b0" - event = "sys.no-match-default" - language_code = "en-us" - - detect_intent_with_event_input( - project_id, - location, - agent_id, - event, - language_code, - ) - - -def detect_intent_with_event_input( - project_id, - location, - agent_id, - event, - language_code, -): - """Detects intent using EventInput""" - client_options = None - if location != "global": - api_endpoint = f"{location}-dialogflow.googleapis.com:443" - print(f"API Endpoint: {api_endpoint}\n") - client_options = {"api_endpoint": api_endpoint} - session_client = SessionsClient(client_options=client_options) - session_id = str(uuid.uuid4()) - session_path = session_client.session_path( - project=project_id, - location=location, - agent=agent_id, - session=session_id, - ) - - # Construct detect intent request: - event = session.EventInput(event=event) - query_input = session.QueryInput(event=event, language_code=language_code) - request = session.DetectIntentRequest( - session=session_path, - query_input=query_input, - ) - - response = session_client.detect_intent(request=request) - response_text = response.query_result.response_messages[0].text.text[0] - print(f"Response: {response_text}") - return response_text - - -# [END dialogflow_cx_v3_detect_intent_event_input_async] - - -if __name__ == "__main__": - run_sample() diff --git a/samples/snippets/detect_intent_event_test.py b/samples/snippets/detect_intent_event_test.py deleted file mode 100644 index 5c0f0339..00000000 --- a/samples/snippets/detect_intent_event_test.py +++ /dev/null @@ -1,48 +0,0 @@ -# Copyright 2022, Google LLC -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -"""Tests for detect_intent_with_sentiment_analysis.py""" - -from __future__ import absolute_import - -import os - -from detect_intent_event import detect_intent_with_event_input - - -PROJECT_ID = os.getenv("GOOGLE_CLOUD_PROJECT") -AGENT_ID = os.getenv("AGENT_ID") - - -def test_detect_intent_positive(): - response_text = detect_intent_with_event_input( - PROJECT_ID, - "global", - AGENT_ID, - "sys.no-match-default", - "en-us", - ) - assert response_text in [ - "Can you say that again?", - "I didn't get that. Can you repeat?", - "I didn't get that. Can you say it again?", - "I missed that, say that again?", - "I missed what you said. What was that?", - "One more time?", - "Say that one more time?", - "Sorry, can you say that again?", - "Sorry, could you say that again?", - "Sorry, I didn't get that. Can you rephrase?", - "Sorry, what was that?", - "What was that?", - ] diff --git a/samples/snippets/detect_intent_stream.py b/samples/snippets/detect_intent_stream.py deleted file mode 100644 index 38824646..00000000 --- a/samples/snippets/detect_intent_stream.py +++ /dev/null @@ -1,157 +0,0 @@ -#!/usr/bin/env python - -# Copyright 2020 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -"""DialogFlow API Detect Intent Python sample with audio files processed as an audio stream. - -Examples: - python detect_intent_stream.py -h - python detect_intent_stream.py --agent AGENT \ - --session-id SESSION_ID --audio-file-path resources/hello.wav -""" - -import argparse -import uuid - -from google.cloud.dialogflowcx_v3beta1.services.agents import AgentsClient -from google.cloud.dialogflowcx_v3beta1.services.sessions import SessionsClient -from google.cloud.dialogflowcx_v3beta1.types import audio_config -from google.cloud.dialogflowcx_v3beta1.types import session - - -# [START dialogflow_detect_intent_stream] -def run_sample(): - # TODO(developer): Replace these values when running the function - project_id = "YOUR-PROJECT-ID" - # For more information about regionalization see https://cloud.google.com/dialogflow/cx/docs/how/region - location_id = "YOUR-LOCATION-ID" - # For more info on agents see https://cloud.google.com/dialogflow/cx/docs/concept/agent - agent_id = "YOUR-AGENT-ID" - agent = f"projects/{project_id}/locations/{location_id}/agents/{agent_id}" - # For more information on sessions see https://cloud.google.com/dialogflow/cx/docs/concept/session - session_id = uuid.uuid4() - audio_file_path = "YOUR-AUDIO-FILE-PATH" - # For more supported languages see https://cloud.google.com/dialogflow/es/docs/reference/language - language_code = "en-us" - - detect_intent_stream(agent, session_id, audio_file_path, language_code) - - -def detect_intent_stream(agent, session_id, audio_file_path, language_code): - """Returns the result of detect intent with streaming audio as input. - - Using the same `session_id` between requests allows continuation - of the conversation.""" - session_path = f"{agent}/sessions/{session_id}" - print(f"Session path: {session_path}\n") - client_options = None - agent_components = AgentsClient.parse_agent_path(agent) - location_id = agent_components["location"] - if location_id != "global": - api_endpoint = f"{location_id}-dialogflow.googleapis.com:443" - print(f"API Endpoint: {api_endpoint}\n") - client_options = {"api_endpoint": api_endpoint} - session_client = SessionsClient(client_options=client_options) - - input_audio_config = audio_config.InputAudioConfig( - audio_encoding=audio_config.AudioEncoding.AUDIO_ENCODING_LINEAR_16, - sample_rate_hertz=24000, - ) - - def request_generator(): - audio_input = session.AudioInput(config=input_audio_config) - query_input = session.QueryInput(audio=audio_input, language_code=language_code) - voice_selection = audio_config.VoiceSelectionParams() - synthesize_speech_config = audio_config.SynthesizeSpeechConfig() - output_audio_config = audio_config.OutputAudioConfig() - - # Sets the voice name and gender - voice_selection.name = "en-GB-Standard-A" - voice_selection.ssml_gender = ( - audio_config.SsmlVoiceGender.SSML_VOICE_GENDER_FEMALE - ) - - synthesize_speech_config.voice = voice_selection - - # Sets the audio encoding - output_audio_config.audio_encoding = ( - audio_config.OutputAudioEncoding.OUTPUT_AUDIO_ENCODING_UNSPECIFIED - ) - output_audio_config.synthesize_speech_config = synthesize_speech_config - - # The first request contains the configuration. - yield session.StreamingDetectIntentRequest( - session=session_path, - query_input=query_input, - output_audio_config=output_audio_config, - ) - - # Here we are reading small chunks of audio data from a local - # audio file. In practice these chunks should come from - # an audio input device. - with open(audio_file_path, "rb") as audio_file: - while True: - chunk = audio_file.read(4096) - if not chunk: - break - # The later requests contains audio data. - audio_input = session.AudioInput(audio=chunk) - query_input = session.QueryInput(audio=audio_input) - yield session.StreamingDetectIntentRequest(query_input=query_input) - - responses = session_client.streaming_detect_intent(requests=request_generator()) - - print("=" * 20) - for response in responses: - print(f'Intermediate transcript: "{response.recognition_result.transcript}".') - - # Note: The result from the last response is the final transcript along - # with the detected content. - response = response.detect_intent_response - print(f"Query text: {response.query_result.transcript}") - response_messages = [ - " ".join(msg.text.text) for msg in response.query_result.response_messages - ] - print(f"Response text: {' '.join(response_messages)}\n") - - -# [END dialogflow_detect_intent_stream] - -if __name__ == "__main__": - parser = argparse.ArgumentParser( - description=__doc__, formatter_class=argparse.RawDescriptionHelpFormatter - ) - parser.add_argument( - "--agent", help="Agent resource name. Required.", required=True - ) - parser.add_argument( - "--session-id", - help="Identifier of the DetectIntent session. " "Defaults to a random UUID.", - default=str(uuid.uuid4()), - ) - parser.add_argument( - "--language-code", - help='Language code of the query. Defaults to "en-US".', - default="en-US", - ) - parser.add_argument( - "--audio-file-path", help="Path to the audio file.", required=True - ) - - args = parser.parse_args() - - detect_intent_stream( - args.agent, args.session_id, args.audio_file_path, args.language_code - ) diff --git a/samples/snippets/detect_intent_stream_test.py b/samples/snippets/detect_intent_stream_test.py deleted file mode 100644 index 7160b43c..00000000 --- a/samples/snippets/detect_intent_stream_test.py +++ /dev/null @@ -1,50 +0,0 @@ -# Copyright 2020, Google LLC -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -"""Tests for detect_intent_texts.""" - -from __future__ import absolute_import - -import os -import uuid - - -from detect_intent_stream import detect_intent_stream - -DIRNAME = os.path.realpath(os.path.dirname(__file__)) -PROJECT_ID = os.getenv("GOOGLE_CLOUD_PROJECT") -AGENT_ID = os.getenv("AGENT_ID") -AGENT_ID_US_CENTRAL1 = os.getenv("AGENT_ID_US_CENTRAL1") -AGENT = f"projects/{PROJECT_ID}/locations/global/agents/{AGENT_ID}" -AGENT_US_CENTRAL1 = ( - f"projects/{PROJECT_ID}/locations/us-central1/agents/{AGENT_ID_US_CENTRAL1}" -) -SESSION_ID = uuid.uuid4() -AUDIO_PATH = os.getenv("AUDIO_PATH") -AUDIO = f"{DIRNAME}/{AUDIO_PATH}" - - -def test_detect_intent_texts(capsys): - detect_intent_stream(AGENT, SESSION_ID, AUDIO, "en-US") - out, _ = capsys.readouterr() - - assert "Intermediate transcript:" in out - assert "Response text: Hi! I'm the virtual flights agent." in out - - -def test_detect_intent_texts_regional(capsys): - detect_intent_stream(AGENT_US_CENTRAL1, SESSION_ID, AUDIO, "en-US") - out, _ = capsys.readouterr() - - assert "Intermediate transcript:" in out - assert "Response text: Hi! I'm the virtual flights agent." in out diff --git a/samples/snippets/detect_intent_synthesize_tts_response.py b/samples/snippets/detect_intent_synthesize_tts_response.py deleted file mode 100644 index 8d1c0e23..00000000 --- a/samples/snippets/detect_intent_synthesize_tts_response.py +++ /dev/null @@ -1,104 +0,0 @@ -#!/usr/bin/env python - -# Copyright 2020-2022 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Detects intent and returns a synthesized Text-to-Speech (TTS) response - -# [START dialogflow_cx_v3_detect_intent_synthesize_tts_response_async] -import uuid - -from google.cloud.dialogflowcx_v3.services.sessions import SessionsClient -from google.cloud.dialogflowcx_v3.types import audio_config -from google.cloud.dialogflowcx_v3.types import session - - -def run_sample(): - # TODO(developer): Update these values when running the function - project_id = "YOUR-PROJECT-ID" - location = "YOUR-LOCATION-ID" - agent_id = "YOUR-AGENT-ID" - text = "YOUR-TEXT" - audio_encoding = "YOUR-AUDIO-ENCODING" - language_code = "YOUR-LANGUAGE-CODE" - output_file = "YOUR-OUTPUT-FILE" - - detect_intent_synthesize_tts_response( - project_id, - location, - agent_id, - text, - audio_encoding, - language_code, - output_file, - ) - - -def detect_intent_synthesize_tts_response( - project_id, - location, - agent_id, - text, - audio_encoding, - language_code, - output_file, -): - """Returns the result of detect intent with synthesized response.""" - client_options = None - if location != "global": - api_endpoint = f"{location}-dialogflow.googleapis.com:443" - print(f"API Endpoint: {api_endpoint}\n") - client_options = {"api_endpoint": api_endpoint} - session_client = SessionsClient(client_options=client_options) - session_id = str(uuid.uuid4()) - - # Constructs the audio query request - session_path = session_client.session_path( - project=project_id, - location=location, - agent=agent_id, - session=session_id, - ) - text_input = session.TextInput(text=text) - query_input = session.QueryInput(text=text_input, language_code=language_code) - synthesize_speech_config = audio_config.SynthesizeSpeechConfig( - speaking_rate=1.25, - pitch=10.0, - ) - output_audio_config = audio_config.OutputAudioConfig( - synthesize_speech_config=synthesize_speech_config, - audio_encoding=audio_config.OutputAudioEncoding[audio_encoding], - ) - request = session.DetectIntentRequest( - session=session_path, - query_input=query_input, - output_audio_config=output_audio_config, - ) - - response = session_client.detect_intent(request=request) - print( - "Speaking Rate: " - f"{response.output_audio_config.synthesize_speech_config.speaking_rate}" - ) - print("Pitch: " f"{response.output_audio_config.synthesize_speech_config.pitch}") - with open(output_file, "wb") as fout: - fout.write(response.output_audio) - print(f"Audio content written to file: {output_file}") - - -# [END dialogflow_cx_v3_detect_intent_synthesize_tts_response_async] - - -if __name__ == "__main__": - run_sample() diff --git a/samples/snippets/detect_intent_synthesize_tts_response_test.py b/samples/snippets/detect_intent_synthesize_tts_response_test.py deleted file mode 100644 index 61d4b0fa..00000000 --- a/samples/snippets/detect_intent_synthesize_tts_response_test.py +++ /dev/null @@ -1,41 +0,0 @@ -# Copyright 2022, Google LLC -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -"""Tests for detect_intent_with_sentiment_analysis.py""" - -from __future__ import absolute_import - -import os - -from detect_intent_synthesize_tts_response import detect_intent_synthesize_tts_response - - -PROJECT_ID = os.getenv("GOOGLE_CLOUD_PROJECT") -AGENT_ID = os.getenv("AGENT_ID") - - -def test_detect_intent_positive(capsys, tmp_path_factory): - - output_file = tmp_path_factory.mktemp("data") / "tmp.wav" - - detect_intent_synthesize_tts_response( - PROJECT_ID, - "global", - AGENT_ID, - "Perfect!", - "OUTPUT_AUDIO_ENCODING_LINEAR_16", - "en-us", - output_file, - ) - out, _ = capsys.readouterr() - assert f"Audio content written to file: {output_file}" in out diff --git a/samples/snippets/detect_intent_texts.py b/samples/snippets/detect_intent_texts.py deleted file mode 100644 index f81f9942..00000000 --- a/samples/snippets/detect_intent_texts.py +++ /dev/null @@ -1,110 +0,0 @@ -#!/usr/bin/env python - -# Copyright 2020 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -"""DialogFlow API Detect Intent Python sample with text inputs. - -Examples: - python detect_intent_texts.py -h - python detect_intent_texts.py --agent AGENT \ - --session-id SESSION_ID \ - "hello" "book a meeting room" "Mountain View" - python detect_intent_texts.py --agent AGENT \ - --session-id SESSION_ID \ - "tomorrow" "10 AM" "2 hours" "10 people" "A" "yes" -""" - -import argparse -import uuid - -from google.cloud.dialogflowcx_v3beta1.services.agents import AgentsClient -from google.cloud.dialogflowcx_v3beta1.services.sessions import SessionsClient -from google.cloud.dialogflowcx_v3beta1.types import session - - -# [START dialogflow_cx_detect_intent_text] -def run_sample(): - # TODO(developer): Replace these values when running the function - project_id = "YOUR-PROJECT-ID" - # For more information about regionalization see https://cloud.google.com/dialogflow/cx/docs/how/region - location_id = "YOUR-LOCATION-ID" - # For more info on agents see https://cloud.google.com/dialogflow/cx/docs/concept/agent - agent_id = "YOUR-AGENT-ID" - agent = f"projects/{project_id}/locations/{location_id}/agents/{agent_id}" - # For more information on sessions see https://cloud.google.com/dialogflow/cx/docs/concept/session - session_id = uuid.uuid4() - texts = ["Hello"] - # For more supported languages see https://cloud.google.com/dialogflow/es/docs/reference/language - language_code = "en-us" - - detect_intent_texts(agent, session_id, texts, language_code) - - -def detect_intent_texts(agent, session_id, texts, language_code): - """Returns the result of detect intent with texts as inputs. - - Using the same `session_id` between requests allows continuation - of the conversation.""" - session_path = f"{agent}/sessions/{session_id}" - print(f"Session path: {session_path}\n") - client_options = None - agent_components = AgentsClient.parse_agent_path(agent) - location_id = agent_components["location"] - if location_id != "global": - api_endpoint = f"{location_id}-dialogflow.googleapis.com:443" - print(f"API Endpoint: {api_endpoint}\n") - client_options = {"api_endpoint": api_endpoint} - session_client = SessionsClient(client_options=client_options) - - for text in texts: - text_input = session.TextInput(text=text) - query_input = session.QueryInput(text=text_input, language_code=language_code) - request = session.DetectIntentRequest( - session=session_path, query_input=query_input - ) - response = session_client.detect_intent(request=request) - - print("=" * 20) - print(f"Query text: {response.query_result.text}") - response_messages = [ - " ".join(msg.text.text) for msg in response.query_result.response_messages - ] - print(f"Response text: {' '.join(response_messages)}\n") - - -# [END dialogflow_cx_detect_intent_text] - -if __name__ == "__main__": - parser = argparse.ArgumentParser( - description=__doc__, formatter_class=argparse.RawDescriptionHelpFormatter - ) - parser.add_argument( - "--agent", help="Agent resource name. Required.", required=True - ) - parser.add_argument( - "--session-id", - help="Identifier of the DetectIntent session. " "Defaults to a random UUID.", - default=str(uuid.uuid4()), - ) - parser.add_argument( - "--language-code", - help='Language code of the query. Defaults to "en-US".', - default="en-US", - ) - parser.add_argument("texts", nargs="+", type=str, help="Text inputs.") - - args = parser.parse_args() - - detect_intent_texts(args.agent, args.session_id, args.texts, args.language_code) diff --git a/samples/snippets/detect_intent_texts_test.py b/samples/snippets/detect_intent_texts_test.py deleted file mode 100644 index 7ca35c8a..00000000 --- a/samples/snippets/detect_intent_texts_test.py +++ /dev/null @@ -1,46 +0,0 @@ -# Copyright 2020, Google LLC -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -"""Tests for detect_intent_texts.""" - -from __future__ import absolute_import - -import os -import uuid - - -from detect_intent_texts import detect_intent_texts - -PROJECT_ID = os.getenv("GOOGLE_CLOUD_PROJECT") -AGENT_ID = os.getenv("AGENT_ID") -AGENT = f"projects/{PROJECT_ID}/locations/global/agents/{AGENT_ID}" -SESSION_ID = uuid.uuid4() -TEXTS = ["hello", "book a flight"] -AGENT_ID_US_CENTRAL1 = os.getenv("AGENT_ID_US_CENTRAL1") -AGENT_US_CENTRAL1 = ( - f"projects/{PROJECT_ID}/locations/us-central1/agents/{AGENT_ID_US_CENTRAL1}" -) - - -def test_detect_intent_texts(capsys): - detect_intent_texts(AGENT, SESSION_ID, TEXTS, "en-US") - out, _ = capsys.readouterr() - - assert "Response text: I can help you find a ticket" in out - - -def test_detect_intent_texts_regional(capsys): - detect_intent_texts(AGENT_US_CENTRAL1, SESSION_ID, TEXTS, "en-US") - out, _ = capsys.readouterr() - - assert "Response text: I can help you find a ticket" in out diff --git a/samples/snippets/detect_intent_with_intent_input.py b/samples/snippets/detect_intent_with_intent_input.py deleted file mode 100644 index 05823fb1..00000000 --- a/samples/snippets/detect_intent_with_intent_input.py +++ /dev/null @@ -1,94 +0,0 @@ -#!/usr/bin/env python - -# Copyright 2022 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -"""DialogFlow Detect Intent Python sample with specified intent.""" - - -# [START dialogflow_cx_v3_detect_intent_with_intent_input_async] -import uuid - -from google.cloud.dialogflowcx_v3.services.intents import IntentsClient -from google.cloud.dialogflowcx_v3.services.sessions import SessionsClient -from google.cloud.dialogflowcx_v3.types import session - - -def run_sample(): - # TODO(developer): Update these values when running the function - project_id = "YOUR-PROJECT-ID" - location = "YOUR-LOCATION-ID" - agent_id = "YOUR-AGENT-ID" - intent_id = "YOUR-INTENT-ID" - language_code = "en-us" - - detect_intent_with_intent_input( - project_id, - location, - agent_id, - intent_id, - language_code, - ) - - -def detect_intent_with_intent_input( - project_id, - location, - agent_id, - intent_id, - language_code, -): - """Returns the result of detect intent with sentiment analysis""" - client_options = None - if location != "global": - api_endpoint = f"{location}-dialogflow.googleapis.com:443" - print(f"API Endpoint: {api_endpoint}\n") - client_options = {"api_endpoint": api_endpoint} - session_client = SessionsClient(client_options=client_options) - session_id = str(uuid.uuid4()) - intents_client = IntentsClient() - - session_path = session_client.session_path( - project=project_id, - location=location, - agent=agent_id, - session=session_id, - ) - intent_path = intents_client.intent_path( - project=project_id, - location=location, - agent=agent_id, - intent=intent_id, - ) - - intent = session.IntentInput(intent=intent_path) - query_input = session.QueryInput(intent=intent, language_code=language_code) - request = session.DetectIntentRequest( - session=session_path, - query_input=query_input, - ) - - response = session_client.detect_intent(request=request) - response_text = [] - for response_message in response.query_result.response_messages: - response_text.append(response_message.text.text) - print(response_message.text.text) - return response_text - - -# [END dialogflow_cx_v3_detect_intent_with_intent_input_async] - - -if __name__ == "__main__": - run_sample() diff --git a/samples/snippets/detect_intent_with_intent_input_test.py b/samples/snippets/detect_intent_with_intent_input_test.py deleted file mode 100644 index 5681254e..00000000 --- a/samples/snippets/detect_intent_with_intent_input_test.py +++ /dev/null @@ -1,38 +0,0 @@ -# Copyright 2022, Google LLC -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -"""Tests for detect_intent_with_sentiment_analysis.py""" - -from __future__ import absolute_import - -import os - -from detect_intent_with_intent_input import detect_intent_with_intent_input - - -PROJECT_ID = os.getenv("GOOGLE_CLOUD_PROJECT") -AGENT_ID = os.getenv("AGENT_ID") -INTENT_ID = os.getenv("INTENT_ID") - - -def test_detect_intent_with_intent_input(): - response_text = detect_intent_with_intent_input( - PROJECT_ID, - "global", - AGENT_ID, - INTENT_ID, - "en-us", - ) - assert len(response_text) == 2 - assert response_text[0] == ["Let's find a one-way ticket for you. "] - assert response_text[1] == ["Which city are you leaving from?"] diff --git a/samples/snippets/detect_intent_with_sentiment_analysis.py b/samples/snippets/detect_intent_with_sentiment_analysis.py deleted file mode 100644 index 0f7103a6..00000000 --- a/samples/snippets/detect_intent_with_sentiment_analysis.py +++ /dev/null @@ -1,89 +0,0 @@ -#!/usr/bin/env python - -# Copyright 2022 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -"""DialogFlow Detect Intent Python sample, text input and sentiment analysis.""" - - -# [START dialogflow_cx_v3_detect_intent_sentiment_analysis_async] -import uuid - -from google.cloud.dialogflowcx_v3beta1.services.sessions import SessionsClient -from google.cloud.dialogflowcx_v3beta1.types import session - - -def run_sample(): - # TODO(developer): Update these values when running the function - project_id = "YOUR-PROJECT-ID" - location = "YOUR-LOCATION-ID" - agent_id = "YOUR-AGENT-ID" - text = "Perfect!" - language_code = "en-us" - - detect_intent_with_sentiment_analysis( - project_id, - location, - agent_id, - text, - language_code, - ) - - -def detect_intent_with_sentiment_analysis( - project_id, - location, - agent_id, - text, - language_code, -): - """Returns the result of detect intent with sentiment analysis""" - - client_options = None - if location != "global": - api_endpoint = f"{location}-dialogflow.googleapis.com:443" - print(f"API Endpoint: {api_endpoint}\n") - client_options = {"api_endpoint": api_endpoint} - session_client = SessionsClient(client_options=client_options) - session_id = str(uuid.uuid4()) - - session_path = session_client.session_path( - project=project_id, - location=location, - agent=agent_id, - session=session_id, - ) - - text_input = session.TextInput(text=text) - query_input = session.QueryInput(text=text_input, language_code=language_code) - query_params = session.QueryParameters( - analyze_query_text_sentiment=True, - ) - request = session.DetectIntentRequest( - session=session_path, - query_input=query_input, - query_params=query_params, - ) - - response = session_client.detect_intent(request=request) - score = response.query_result.sentiment_analysis_result.score - print("Sentiment Score: {score}") - return score - - -# [END dialogflow_cx_v3_detect_intent_sentiment_analysis_async] - - -if __name__ == "__main__": - run_sample() diff --git a/samples/snippets/detect_intent_with_sentiment_analysis_test.py b/samples/snippets/detect_intent_with_sentiment_analysis_test.py deleted file mode 100644 index 47ae758f..00000000 --- a/samples/snippets/detect_intent_with_sentiment_analysis_test.py +++ /dev/null @@ -1,42 +0,0 @@ -# Copyright 2022, Google LLC -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -"""Tests for detect_intent_with_sentiment_analysis.py""" - -from __future__ import absolute_import - -import os - -import pytest - -from detect_intent_with_sentiment_analysis import detect_intent_with_sentiment_analysis - - -PROJECT_ID = os.getenv("GOOGLE_CLOUD_PROJECT") -AGENT_ID = os.getenv("AGENT_ID") - - -@pytest.mark.parametrize( - "text, expected_score_min, expected_score_max", - (["Perfect", 0.5, 1], ["I am not happy", -1, -0.5]), -) -def test_detect_intent_positive(text, expected_score_min, expected_score_max): - - score = detect_intent_with_sentiment_analysis( - PROJECT_ID, - "global", - AGENT_ID, - text, - "en-us", - ) - assert expected_score_min < score < expected_score_max diff --git a/samples/snippets/list_testcase_results.py b/samples/snippets/list_testcase_results.py deleted file mode 100644 index ef26b3f8..00000000 --- a/samples/snippets/list_testcase_results.py +++ /dev/null @@ -1,35 +0,0 @@ -# Copyright 2021 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# [START dialogflow_list_test_case_results_sample] - -from google.cloud.dialogflowcx_v3.services.test_cases.client import TestCasesClient -from google.cloud.dialogflowcx_v3.types.test_case import ListTestCaseResultsRequest - - -def list_test_case(project_id, agent_id, test_id, location): - - req = ListTestCaseResultsRequest() - req.parent = f"projects/{project_id}/locations/{location}/agents/{agent_id}/testCases/{test_id}" - req.filter = "environment=draft" - client = TestCasesClient( - client_options={"api_endpoint": f"{location}-dialogflow.googleapis.com"} - ) - # Makes a call to list all test case results that match filter - result = client.list_test_case_results(request=req) - print(result) - return result - - -# [END dialogflow_list_test_case_results_sample] diff --git a/samples/snippets/list_testcase_results_test.py b/samples/snippets/list_testcase_results_test.py deleted file mode 100644 index e4d534f7..00000000 --- a/samples/snippets/list_testcase_results_test.py +++ /dev/null @@ -1,29 +0,0 @@ -# Copyright 2021, Google LLC -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - - -import google.auth - -from list_testcase_results import list_test_case - -LOCATION = "global" - -_, PROJECT_ID = google.auth.default() -AGENT_ID = "143dee60-56fe-4191-a8d8-095f569f6cd8" -TEST_ID = "3c48d39e-71c0-4cb0-b974-3d5c596d347e" - - -def test_list_testcase_results(): - result = list_test_case(PROJECT_ID, AGENT_ID, TEST_ID, LOCATION) - - assert "Hello! How can I help you?" in str(result) diff --git a/samples/snippets/list_training_phrases.py b/samples/snippets/list_training_phrases.py deleted file mode 100644 index 11f7417f..00000000 --- a/samples/snippets/list_training_phrases.py +++ /dev/null @@ -1,41 +0,0 @@ -# Copyright 2021 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# [START dialogflow_list_training_phrases] - - -def list_training_phrases(project_id, agent_id, intent_id, location): - """Returns all training phrases for a specified intent.""" - - from google.cloud import dialogflowcx - - # Create the intents client - intent_client = dialogflowcx.IntentsClient() - - # Specify working intent - intent_name = intent_client.intent_path(project_id, location, agent_id, intent_id) - - # Compose the get-intent request - get_intent_request = dialogflowcx.GetIntentRequest(name=intent_name) - - intent = intent_client.get_intent(get_intent_request) - - # Iterate through the training phrases. - for phrase in intent.training_phrases: - print(phrase) - - return intent.training_phrases - - -# [END dialogflow_list_training_phrases] diff --git a/samples/snippets/list_training_phrases_test.py b/samples/snippets/list_training_phrases_test.py deleted file mode 100644 index 94d4e74c..00000000 --- a/samples/snippets/list_training_phrases_test.py +++ /dev/null @@ -1,34 +0,0 @@ -#!/usr/bin/env python - -# Copyright 2021 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -import os - -import google.auth - -import list_training_phrases - - -_, PROJECT_ID = google.auth.default() -INTENT_ID = os.getenv("INTENT_ID") -LOCATION = "global" -AGENT_ID = os.getenv("AGENT_ID") - - -def test_list_training_phrases(capsys): - training_phrases = list_training_phrases.list_training_phrases( - PROJECT_ID, AGENT_ID, INTENT_ID, LOCATION - ) - assert len(training_phrases) >= 15 # Number of training phrases at this point. diff --git a/samples/snippets/long_running_operation.py b/samples/snippets/long_running_operation.py deleted file mode 100644 index 7dea2543..00000000 --- a/samples/snippets/long_running_operation.py +++ /dev/null @@ -1,43 +0,0 @@ -# Copyright 2021 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - - -""" DialogFlow CX long running operation code snippet """ - -## [START dialogflow_cx_long_running_snippet] -from google.cloud.dialogflowcx_v3.services.agents.client import AgentsClient -from google.cloud.dialogflowcx_v3.types.agent import ExportAgentRequest - - -def export_long_running_agent(project_id, agent_id, location): - - api_endpoint = f"{location}-dialogflow.googleapis.com:443" - client_options = {"api_endpoint": api_endpoint} - - agents_client = AgentsClient(client_options=client_options) - - export_request = ExportAgentRequest() - - export_request.name = ( - f"projects/{project_id}/locations/{location}/agents/{agent_id}" - ) - - # export_agent returns a long running operation - operation = agents_client.export_agent(request=export_request) - - # Returns the result of the operation when the operation is done - return operation.result() - - -## [END dialogflow_cx_long_running_snippet] diff --git a/samples/snippets/long_running_operation_test.py b/samples/snippets/long_running_operation_test.py deleted file mode 100644 index 89158ae4..00000000 --- a/samples/snippets/long_running_operation_test.py +++ /dev/null @@ -1,66 +0,0 @@ -# Copyright 2021, Google LLC -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -import os -import uuid - -from google.cloud.dialogflowcx_v3.services.agents.client import AgentsClient -from google.cloud.dialogflowcx_v3.types.agent import Agent, DeleteAgentRequest - -import pytest - -from long_running_operation import export_long_running_agent - -PROJECT_ID = os.getenv("GOOGLE_CLOUD_PROJECT") -pytest.AGENT_ID = None -pytest.PARENT = None - - -def create_agent(project_id, display_name): - parent = "projects/" + project_id + "/locations/global" - - agents_client = AgentsClient() - - agent = Agent( - display_name=display_name, - default_language_code="en", - time_zone="America/Los_Angeles", - ) - - response = agents_client.create_agent(request={"agent": agent, "parent": parent}) - - return response - - -def delete_agent(name): - agents_client = AgentsClient() - agent = DeleteAgentRequest(name=name) - agents_client.delete_agent(request=agent) - - -@pytest.fixture(scope="function", autouse=True) -def setup_teardown(): - agentName = "temp_agent_" + str(uuid.uuid4()) - pytest.PARENT = create_agent(PROJECT_ID, agentName).name - pytest.AGENT_ID = pytest.PARENT.split("/")[5] - print("Created Agent in setUp") - - yield - - delete_agent(pytest.PARENT) - - -def test_export_agent(): - actualResponse = export_long_running_agent(PROJECT_ID, pytest.AGENT_ID, "global") - - assert pytest.AGENT_ID in str(actualResponse) diff --git a/samples/snippets/noxfile.py b/samples/snippets/noxfile.py deleted file mode 100644 index 1224cbe2..00000000 --- a/samples/snippets/noxfile.py +++ /dev/null @@ -1,293 +0,0 @@ -# Copyright 2019 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -from __future__ import print_function - -import glob -import os -from pathlib import Path -import sys -from typing import Callable, Dict, Optional - -import nox - - -# WARNING - WARNING - WARNING - WARNING - WARNING -# WARNING - WARNING - WARNING - WARNING - WARNING -# DO NOT EDIT THIS FILE EVER! -# WARNING - WARNING - WARNING - WARNING - WARNING -# WARNING - WARNING - WARNING - WARNING - WARNING - -BLACK_VERSION = "black==22.3.0" -ISORT_VERSION = "isort==5.10.1" - -# Copy `noxfile_config.py` to your directory and modify it instead. - -# `TEST_CONFIG` dict is a configuration hook that allows users to -# modify the test configurations. The values here should be in sync -# with `noxfile_config.py`. Users will copy `noxfile_config.py` into -# their directory and modify it. - -TEST_CONFIG = { - # You can opt out from the test for specific Python versions. - "ignored_versions": [], - # Old samples are opted out of enforcing Python type hints - # All new samples should feature them - "enforce_type_hints": False, - # An envvar key for determining the project id to use. Change it - # to 'BUILD_SPECIFIC_GCLOUD_PROJECT' if you want to opt in using a - # build specific Cloud project. You can also use your own string - # to use your own Cloud project. - "gcloud_project_env": "GOOGLE_CLOUD_PROJECT", - # 'gcloud_project_env': 'BUILD_SPECIFIC_GCLOUD_PROJECT', - # If you need to use a specific version of pip, - # change pip_version_override to the string representation - # of the version number, for example, "20.2.4" - "pip_version_override": None, - # A dictionary you want to inject into your test. Don't put any - # secrets here. These values will override predefined values. - "envs": {}, -} - - -try: - # Ensure we can import noxfile_config in the project's directory. - sys.path.append(".") - from noxfile_config import TEST_CONFIG_OVERRIDE -except ImportError as e: - print("No user noxfile_config found: detail: {}".format(e)) - TEST_CONFIG_OVERRIDE = {} - -# Update the TEST_CONFIG with the user supplied values. -TEST_CONFIG.update(TEST_CONFIG_OVERRIDE) - - -def get_pytest_env_vars() -> Dict[str, str]: - """Returns a dict for pytest invocation.""" - ret = {} - - # Override the GCLOUD_PROJECT and the alias. - env_key = TEST_CONFIG["gcloud_project_env"] - # This should error out if not set. - ret["GOOGLE_CLOUD_PROJECT"] = os.environ[env_key] - - # Apply user supplied envs. - ret.update(TEST_CONFIG["envs"]) - return ret - - -# DO NOT EDIT - automatically generated. -# All versions used to test samples. -ALL_VERSIONS = ["3.7", "3.8", "3.9", "3.10", "3.11"] - -# Any default versions that should be ignored. -IGNORED_VERSIONS = TEST_CONFIG["ignored_versions"] - -TESTED_VERSIONS = sorted([v for v in ALL_VERSIONS if v not in IGNORED_VERSIONS]) - -INSTALL_LIBRARY_FROM_SOURCE = os.environ.get("INSTALL_LIBRARY_FROM_SOURCE", False) in ( - "True", - "true", -) - -# Error if a python version is missing -nox.options.error_on_missing_interpreters = True - -# -# Style Checks -# - - -# Linting with flake8. -# -# We ignore the following rules: -# E203: whitespace before ‘:’ -# E266: too many leading ‘#’ for block comment -# E501: line too long -# I202: Additional newline in a section of imports -# -# We also need to specify the rules which are ignored by default: -# ['E226', 'W504', 'E126', 'E123', 'W503', 'E24', 'E704', 'E121'] -FLAKE8_COMMON_ARGS = [ - "--show-source", - "--builtin=gettext", - "--max-complexity=20", - "--exclude=.nox,.cache,env,lib,generated_pb2,*_pb2.py,*_pb2_grpc.py", - "--ignore=E121,E123,E126,E203,E226,E24,E266,E501,E704,W503,W504,I202", - "--max-line-length=88", -] - - -@nox.session -def lint(session: nox.sessions.Session) -> None: - if not TEST_CONFIG["enforce_type_hints"]: - session.install("flake8") - else: - session.install("flake8", "flake8-annotations") - - args = FLAKE8_COMMON_ARGS + [ - ".", - ] - session.run("flake8", *args) - - -# -# Black -# - - -@nox.session -def blacken(session: nox.sessions.Session) -> None: - """Run black. Format code to uniform standard.""" - session.install(BLACK_VERSION) - python_files = [path for path in os.listdir(".") if path.endswith(".py")] - - session.run("black", *python_files) - - -# -# format = isort + black -# - - -@nox.session -def format(session: nox.sessions.Session) -> None: - """ - Run isort to sort imports. Then run black - to format code to uniform standard. - """ - session.install(BLACK_VERSION, ISORT_VERSION) - python_files = [path for path in os.listdir(".") if path.endswith(".py")] - - # Use the --fss option to sort imports using strict alphabetical order. - # See https://pycqa.github.io/isort/docs/configuration/options.html#force-sort-within-sections - session.run("isort", "--fss", *python_files) - session.run("black", *python_files) - - -# -# Sample Tests -# - - -PYTEST_COMMON_ARGS = ["--junitxml=sponge_log.xml"] - - -def _session_tests( - session: nox.sessions.Session, post_install: Callable = None -) -> None: - # check for presence of tests - test_list = glob.glob("**/*_test.py", recursive=True) + glob.glob( - "**/test_*.py", recursive=True - ) - test_list.extend(glob.glob("**/tests", recursive=True)) - - if len(test_list) == 0: - print("No tests found, skipping directory.") - return - - if TEST_CONFIG["pip_version_override"]: - pip_version = TEST_CONFIG["pip_version_override"] - session.install(f"pip=={pip_version}") - """Runs py.test for a particular project.""" - concurrent_args = [] - if os.path.exists("requirements.txt"): - if os.path.exists("constraints.txt"): - session.install("-r", "requirements.txt", "-c", "constraints.txt") - else: - session.install("-r", "requirements.txt") - with open("requirements.txt") as rfile: - packages = rfile.read() - - if os.path.exists("requirements-test.txt"): - if os.path.exists("constraints-test.txt"): - session.install("-r", "requirements-test.txt", "-c", "constraints-test.txt") - else: - session.install("-r", "requirements-test.txt") - with open("requirements-test.txt") as rtfile: - packages += rtfile.read() - - if INSTALL_LIBRARY_FROM_SOURCE: - session.install("-e", _get_repo_root()) - - if post_install: - post_install(session) - - if "pytest-parallel" in packages: - concurrent_args.extend(["--workers", "auto", "--tests-per-worker", "auto"]) - elif "pytest-xdist" in packages: - concurrent_args.extend(["-n", "auto"]) - - session.run( - "pytest", - *(PYTEST_COMMON_ARGS + session.posargs + concurrent_args), - # Pytest will return 5 when no tests are collected. This can happen - # on travis where slow and flaky tests are excluded. - # See http://doc.pytest.org/en/latest/_modules/_pytest/main.html - success_codes=[0, 5], - env=get_pytest_env_vars(), - ) - - -@nox.session(python=ALL_VERSIONS) -def py(session: nox.sessions.Session) -> None: - """Runs py.test for a sample using the specified version of Python.""" - if session.python in TESTED_VERSIONS: - _session_tests(session) - else: - session.skip( - "SKIPPED: {} tests are disabled for this sample.".format(session.python) - ) - - -# -# Readmegen -# - - -def _get_repo_root() -> Optional[str]: - """Returns the root folder of the project.""" - # Get root of this repository. Assume we don't have directories nested deeper than 10 items. - p = Path(os.getcwd()) - for i in range(10): - if p is None: - break - if Path(p / ".git").exists(): - return str(p) - # .git is not available in repos cloned via Cloud Build - # setup.py is always in the library's root, so use that instead - # https://github.com/googleapis/synthtool/issues/792 - if Path(p / "setup.py").exists(): - return str(p) - p = p.parent - raise Exception("Unable to detect repository root.") - - -GENERATED_READMES = sorted([x for x in Path(".").rglob("*.rst.in")]) - - -@nox.session -@nox.parametrize("path", GENERATED_READMES) -def readmegen(session: nox.sessions.Session, path: str) -> None: - """(Re-)generates the readme for a sample.""" - session.install("jinja2", "pyyaml") - dir_ = os.path.dirname(path) - - if os.path.exists(os.path.join(dir_, "requirements.txt")): - session.install("-r", os.path.join(dir_, "requirements.txt")) - - in_file = os.path.join(dir_, "README.rst.in") - session.run( - "python", _get_repo_root() + "/scripts/readme-gen/readme_gen.py", in_file - ) diff --git a/samples/snippets/noxfile_config.py b/samples/snippets/noxfile_config.py deleted file mode 100644 index 995dc281..00000000 --- a/samples/snippets/noxfile_config.py +++ /dev/null @@ -1,40 +0,0 @@ -# Copyright 2020 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Default TEST_CONFIG_OVERRIDE for python repos. - -# You can copy this file into your directory, then it will be inported from -# the noxfile.py. - -# The source of truth: -# https://github.com/GoogleCloudPlatform/python-docs-samples/blob/master/noxfile_config.py - -TEST_CONFIG_OVERRIDE = { - # You can opt out from the test for specific Python versions. - "ignored_versions": ["2.7"], - # An envvar key for determining the project id to use. Change it - # to 'BUILD_SPECIFIC_GCLOUD_PROJECT' if you want to opt in using a - # build specific Cloud project. You can also use your own string - # to use your own Cloud project. - # 'gcloud_project_env': 'BUILD_SPECIFIC_GCLOUD_PROJECT', - "gcloud_project_env": "GOOGLE_CLOUD_PROJECT", - # A dictionary you want to inject into your test. Don't put any - # secrets here. These values will override predefined values. - "envs": { - "AGENT_ID": "53516802-3e2a-4016-80b6-a3df0d240240", - "AGENT_ID_US_CENTRAL1": "edf8372c-c66a-4984-83ba-b85885e95e2a", - "AUDIO_PATH": "resources/hello.wav", - "INTENT_ID": "164428bd-647a-4e30-ab0f-cc7f3e3b76f9", - }, -} diff --git a/samples/snippets/page_management.py b/samples/snippets/page_management.py deleted file mode 100644 index cee6e36c..00000000 --- a/samples/snippets/page_management.py +++ /dev/null @@ -1,79 +0,0 @@ -# Copyright 2021, Google LLC -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -from google.cloud.dialogflowcx_v3 import PagesAsyncClient -from google.cloud.dialogflowcx_v3.types.page import ( - CreatePageRequest, - DeletePageRequest, - ListPagesRequest, - Page, -) - - -# [START dialogflow_cx_create_page] -async def create_page(project_id, agent_id, flow_id, location, displayName): - pages_client = PagesAsyncClient() - - page = Page() - page.display_name = displayName - - request = CreatePageRequest() - request.parent = ( - "projects/" - + project_id - + "/locations/" - + location - + "/agents/" - + agent_id - + "/flows/" - + flow_id - ) - request.page = page - - response = await pages_client.create_page(request=request) - return response - - -# [END dialogflow_cx_create_page] - - -# [START dialogflow_cx_list_page] -async def list_page(project_id, agent_id, flow_id, location): - pages_client = PagesAsyncClient() - - request = ListPagesRequest() - request.parent = ( - f"projects/{project_id}/locations/{location}/agents/{agent_id}/flows/{flow_id}" - ) - - request.language_code = "en" - - response = await pages_client.list_pages(request=request) - return response - - -# [END dialogflow_cx_list_page] - - -# [START dialogflow_cx_delete_page] -async def delete_page(project_id, agent_id, flow_id, page_id, location): - pages_client = PagesAsyncClient() - - request = DeletePageRequest() - request.name = f"projects/{project_id}/locations/{location}/agents/{agent_id}/flows/{flow_id}/pages/{page_id}" - - response = await pages_client.delete_page(request=request) - return response - - -# [END dialogflow_cx_delete_page] diff --git a/samples/snippets/page_management_test.py b/samples/snippets/page_management_test.py deleted file mode 100644 index 13d9bf80..00000000 --- a/samples/snippets/page_management_test.py +++ /dev/null @@ -1,114 +0,0 @@ -# Copyright 2021, Google LLC -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -import asyncio -from copy import Error -import os -import uuid - -from google.cloud.dialogflowcx_v3.services.agents.client import AgentsClient -from google.cloud.dialogflowcx_v3.types.agent import Agent, DeleteAgentRequest - -import pytest - -from page_management import create_page, delete_page, list_page - -PROJECT_ID = os.getenv("GOOGLE_CLOUD_PROJECT") -pytest.AGENT_ID = None -pytest.PARENT = None -pytest.CREATED_PAGE = None -pytest.PAGE_ID = None - - -def delete_agent(name): - agents_client = AgentsClient() - agent = DeleteAgentRequest(name=name) - agents_client.delete_agent(request=agent) - - -@pytest.fixture -def loop(): - loop = asyncio.new_event_loop() - yield loop - loop.close() - - -@pytest.fixture(scope="module", autouse=True) -def setup_teardown(): - loop = asyncio.new_event_loop() - agentName = "temp_agent_" + str(uuid.uuid4()) - - parent = "projects/" + PROJECT_ID + "/locations/global" - - agents_client = AgentsClient() - - agent = Agent( - display_name=agentName, - default_language_code="en", - time_zone="America/Los_Angeles", - ) - - response = agents_client.create_agent(request={"agent": agent, "parent": parent}) - pytest.PARENT = response.name - - pytest.AGENT_ID = pytest.PARENT.split("/")[5] - print("Created Agent in setUp") - - yield - - delete_agent(pytest.PARENT) - loop.close() - - -def test_create_page(loop: asyncio.AbstractEventLoop): - pytest.CREATED_PAGE = f"fake_page_{uuid.uuid4()}" - actualResponse = loop.run_until_complete( - create_page( - PROJECT_ID, - pytest.AGENT_ID, - "00000000-0000-0000-0000-000000000000", - "global", - pytest.CREATED_PAGE, - ) - ) - - pytest.PAGE_ID = actualResponse.name.split("/")[9] - assert actualResponse.display_name == pytest.CREATED_PAGE - - -def test_list_page(loop: asyncio.AbstractEventLoop): - actualResponse = loop.run_until_complete( - list_page( - PROJECT_ID, - pytest.AGENT_ID, - "00000000-0000-0000-0000-000000000000", - "global", - ) - ) - - assert pytest.PAGE_ID in str(actualResponse) - - -def test_delete_page(loop: asyncio.AbstractEventLoop): - try: - loop.run_until_complete( - delete_page( - PROJECT_ID, - pytest.AGENT_ID, - "00000000-0000-0000-0000-000000000000", - pytest.PAGE_ID, - "global", - ) - ) - except Error: - pytest.fail("Unexpected MyError ..") diff --git a/samples/snippets/requirements-test.txt b/samples/snippets/requirements-test.txt deleted file mode 100644 index c021c5b5..00000000 --- a/samples/snippets/requirements-test.txt +++ /dev/null @@ -1 +0,0 @@ -pytest==7.2.2 diff --git a/samples/snippets/requirements.txt b/samples/snippets/requirements.txt deleted file mode 100644 index 453fd9e5..00000000 --- a/samples/snippets/requirements.txt +++ /dev/null @@ -1,3 +0,0 @@ -google-cloud-dialogflow-cx==1.20.0 -Flask==2.2.3 -python-dateutil==2.8.2 diff --git a/samples/snippets/resources/hello.wav b/samples/snippets/resources/hello.wav deleted file mode 100644 index 0aadf16c7116b218b7fcb6828286846661dcc301..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 29564 zcmcG$1$5j`?fW@ct)nDB&|nHeU`%*>gvli0CirgpoT)h%^PwdG{z z%=_NAZ}$};lqEz|2q9M=GV->uvYc` zM|!J%SJ7F8zlxKp8U8cBf45h`Rzd$7|M#z7-&OopeX4N%%~ut!zyI)`|Gnk^JnO&H`~L^ae>Km)WB;!p z|KGI#-=F`NSO0gZ{qM^1zYF)jo3|>C{OjjmvHl%r{%QT^>OYQykokH1BfEdDe!*2i z{KpahIR^Y|-@i)iKjZopo&IBM)pb>LWc`fgf5(oh796$xL-XHPzxe(|_1{sqih}>x z|L@oTa9KrP750CZPZgHGDf`8970f@!ul`>URaj^wm#WX-*#6eX-<(v*wW{~mr|POI zTU9|-jSc+l-3)-L^de8_yf~acqqJu>9Fz8G` zKN`PCNopY3c^L1=*#VPhc(5fCG)?9c?Q2(Jq|(f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>HJOOPAx50?VoApv`ke#kq>M&u}R6Nw-y)Qo1L4bjGE zGqefNcluBlilG$p6uE>P1A5QZ$P{D%l7~2u2z(JP2W3oxyTd-1fzCtUK#PD^Q6q>^ z|E}HyXoelsdi8C<0Dd1ZLF)sC@#*BM1xSV?m3ILF z_H*SJU`jp%OiwFdXm&}y3h1&60ikqP@*p4!Uj?+rNRkJ1b`v1$<^Y0rQ$Xu&4LFb; z09mmkU?8^v|Fr;w>&B`S(Y+41Z<)Z3?)(=cT@MJge-r*|iTx>dzXEvFsbz|9pUMaD zocNz2WTtrh5FlsP<{wDy`OhhpMWFUGscZnXC8bJxo)O@`Gd9#_C`gr;BIVZ*ak6U?ct+R`P!lNP{#wP#N42gV{Gb@^X=p66Rg zU1O@WzvcMv!ogXdXKP61AE>QUYTt87*4737cb#fw_@5=!O0Tw#sby+PN#gnRzip+C zrM{Pv%=6FvU1sgE=k@!0|9|fJ@9or`cs~8-cCFl>ANjx5&%gituBX0PJO91)e9!as l-*@Q$f1dxV4*wkcM*{yy;2#P6BY}S;@Q(!kk-$F^_#Z0t#B=}v diff --git a/samples/snippets/streaming_detect_intent_partial_response.py b/samples/snippets/streaming_detect_intent_partial_response.py deleted file mode 100644 index 29b8ffdf..00000000 --- a/samples/snippets/streaming_detect_intent_partial_response.py +++ /dev/null @@ -1,125 +0,0 @@ -# Copyright 2022, Google LLC -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - - -# [START dialogflow_cx_streaming_detect_intent_enable_partial_response] -import uuid - -from google.cloud.dialogflowcx_v3.services.sessions import SessionsClient -from google.cloud.dialogflowcx_v3.types import audio_config -from google.cloud.dialogflowcx_v3.types import InputAudioConfig -from google.cloud.dialogflowcx_v3.types import session - - -def run_sample(): - """ - TODO(developer): Modify these variables before running the sample. - """ - project_id = "YOUR-PROJECT-ID" - location = "YOUR-LOCATION-ID" - agent_id = "YOUR-AGENT-ID" - audio_file_name = "YOUR-AUDIO-FILE-PATH" - encoding = "AUDIO_ENCODING_LINEAR_16" - sample_rate_hertz = 16000 - language_code = "en" - - streaming_detect_intent_partial_response( - project_id, - location, - agent_id, - audio_file_name, - encoding, - sample_rate_hertz, - language_code, - ) - - -def streaming_detect_intent_partial_response( - project_id, - location, - agent_id, - audio_file_name, - encoding, - sample_rate_hertz, - language_code, -): - - client_options = None - if location != "global": - api_endpoint = f"{location}-dialogflow.googleapis.com:443" - print(f"API Endpoint: {api_endpoint}\n") - client_options = {"api_endpoint": api_endpoint} - session_client = SessionsClient(client_options=client_options) - session_id = str(uuid.uuid4()) - - session_path = session_client.session_path( - project=project_id, - location=location, - agent=agent_id, - session=session_id, - ) - - def request_generator(): - audio_encoding = audio_config.AudioEncoding[encoding] - config = InputAudioConfig( - audio_encoding=audio_encoding, - sample_rate_hertz=sample_rate_hertz, - single_utterance=True, - ) - audio_input = session.AudioInput(config=config) - query_input = session.QueryInput(audio=audio_input, language_code=language_code) - yield session.StreamingDetectIntentRequest( - session=session_path, - query_input=query_input, - enable_partial_response=True, - ) - # Here we are reading small chunks of audio data from a local - # audio file. In practice these chunks should come from - # an audio input device. - with open(audio_file_name, "rb") as audio_file: - while True: - chunk = audio_file.read(4096) - if not chunk: - break - # The later requests contains audio data. - audio_input = session.AudioInput(audio=chunk, config=config) - query_input = session.QueryInput( - audio=audio_input, language_code=language_code - ) - yield session.StreamingDetectIntentRequest( - session=session_path, - query_input=query_input, - enable_partial_response=True, - ) - - responses = session_client.streaming_detect_intent(requests=request_generator()) - - print("=" * 20) - for response in responses: - print(f'Intermediate transcript: "{response.recognition_result.transcript}".') - - # Note: The result from the last response is the final transcript along - # with the detected content. - response = response.detect_intent_response - print(f"Query text: {response.query_result.transcript}") - response_messages = [ - " ".join(msg.text.text) for msg in response.query_result.response_messages - ] - print(f"Response text: {' '.join(response_messages)}\n") - - -# [END dialogflow_cx_streaming_detect_intent_enable_partial_response] - - -if __name__ == "__main__": - run_sample() diff --git a/samples/snippets/streaming_detect_intent_partial_response_test.py b/samples/snippets/streaming_detect_intent_partial_response_test.py deleted file mode 100644 index c773e105..00000000 --- a/samples/snippets/streaming_detect_intent_partial_response_test.py +++ /dev/null @@ -1,49 +0,0 @@ -# Copyright 2022, Google LLC -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -"""Tests for detect_intent_texts.""" - -from __future__ import absolute_import - -import os - -from streaming_detect_intent_partial_response import ( - streaming_detect_intent_partial_response, -) - - -DIRNAME = os.path.realpath(os.path.dirname(__file__)) -PROJECT_ID = os.getenv("GOOGLE_CLOUD_PROJECT") -AGENT_ID = os.getenv("AGENT_ID") -AUDIO_PATH = os.getenv("AUDIO_PATH") -AUDIO = f"{DIRNAME}/{AUDIO_PATH}" - - -def test_streaming_detect_intent_partial_response(capsys): - - encoding = "AUDIO_ENCODING_LINEAR_16" - sample_rate_hertz = 24000 - - streaming_detect_intent_partial_response( - PROJECT_ID, - "global", - AGENT_ID, - AUDIO, - encoding, - sample_rate_hertz, - "en-US", - ) - out, _ = capsys.readouterr() - - assert "Intermediate transcript:" in out - assert "Response text: Hi! I'm the virtual flights agent." in out diff --git a/samples/snippets/update_intent.py b/samples/snippets/update_intent.py deleted file mode 100644 index ba7f5588..00000000 --- a/samples/snippets/update_intent.py +++ /dev/null @@ -1,33 +0,0 @@ -# Copyright 2021, Google LLC -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# [START dialogflow_cx_update_intent] -from google.cloud.dialogflowcx_v3.services.intents import IntentsClient -from google.protobuf import field_mask_pb2 - - -def update_intent(project_id, agent_id, intent_id, location, displayName): - - intents_client = IntentsClient() - - intent_name = intents_client.intent_path(project_id, location, agent_id, intent_id) - - intent = intents_client.get_intent(request={"name": intent_name}) - - intent.display_name = displayName - update_mask = field_mask_pb2.FieldMask(paths=["display_name"]) - response = intents_client.update_intent(intent=intent, update_mask=update_mask) - return response - - -# [END dialogflow_cx_update_intent] diff --git a/samples/snippets/update_intent_test.py b/samples/snippets/update_intent_test.py deleted file mode 100644 index 58fafa60..00000000 --- a/samples/snippets/update_intent_test.py +++ /dev/null @@ -1,82 +0,0 @@ -# Copyright 2021, Google LLC -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -import os -import uuid - -from google.cloud.dialogflowcx_v3.services.agents.client import AgentsClient -from google.cloud.dialogflowcx_v3.services.intents.client import IntentsClient -from google.cloud.dialogflowcx_v3.types.agent import Agent, DeleteAgentRequest -from google.cloud.dialogflowcx_v3.types.intent import CreateIntentRequest, Intent - -import pytest - -from update_intent import update_intent - -PROJECT_ID = os.getenv("GOOGLE_CLOUD_PROJECT") -pytest.INTENT_ID = None -pytest.AGENT_ID = None -pytest.PARENT = None - - -def create_agent(project_id, display_name): - parent = "projects/" + project_id + "/locations/global" - - agents_client = AgentsClient() - - agent = Agent( - display_name=display_name, - default_language_code="en", - time_zone="America/Los_Angeles", - ) - - response = agents_client.create_agent(request={"agent": agent, "parent": parent}) - - return response - - -def delete_agent(name): - agents_client = AgentsClient() - agent = DeleteAgentRequest(name=name) - agents_client.delete_agent(request=agent) - - -@pytest.fixture(scope="function", autouse=True) -def setup_teardown(): - agentName = "temp_agent_" + str(uuid.uuid4()) - pytest.PARENT = create_agent(PROJECT_ID, agentName).name - pytest.AGENT_ID = pytest.PARENT.split("/")[5] - print("Created Agent in setUp") - intentClient = IntentsClient() - intent = Intent() - - intent.display_name = "fake_intent" - - req = CreateIntentRequest() - req.parent = pytest.PARENT - req.intent = intent - - pytest.INTENT_ID = intentClient.create_intent(request=req).name.split("/")[7] - - yield - - delete_agent(pytest.PARENT) - - -def test_fieldmaskTest(): - fake_intent = f"fake_intent_{uuid.uuid4()}" - actualResponse = update_intent( - PROJECT_ID, pytest.AGENT_ID, pytest.INTENT_ID, "global", fake_intent - ) - - assert actualResponse.display_name == fake_intent diff --git a/samples/snippets/webhook.py b/samples/snippets/webhook.py deleted file mode 100644 index 4a75f8dd..00000000 --- a/samples/snippets/webhook.py +++ /dev/null @@ -1,42 +0,0 @@ -# Copyright 2021, Google LLC -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -""" handle_webhook will return the correct fullfilment response dependong the tag that is sent in the request""" - -# [START dialogflow_cx_webhook] - -# TODO(developer): change entry point to handle_webhook in cloud function - - -def handle_webhook(request): - - req = request.get_json() - - tag = req["fulfillmentInfo"]["tag"] - - if tag == "Default Welcome Intent": - text = "Hello from a GCF Webhook" - elif tag == "get-name": - text = "My name is Flowhook" - else: - text = f"There are no fulfillment responses defined for {tag} tag" - - # You can also use the google.cloud.dialogflowcx_v3.types.WebhookRequest protos instead of manually writing the json object - # Please see https://googleapis.dev/python/dialogflow/latest/dialogflow_v2/types.html?highlight=webhookresponse#google.cloud.dialogflow_v2.types.WebhookResponse for an overview - res = {"fulfillment_response": {"messages": [{"text": {"text": [text]}}]}} - - # Returns json - return res - - -# [END dialogflow_cx_webhook] diff --git a/samples/snippets/webhook_configure_session_parameters.py b/samples/snippets/webhook_configure_session_parameters.py deleted file mode 100644 index 94d51a04..00000000 --- a/samples/snippets/webhook_configure_session_parameters.py +++ /dev/null @@ -1,38 +0,0 @@ -# Copyright 2022, Google LLC -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - - -""" DialogFlow CX: webhook to configure new session parameters.""" - -# [START dialogflow_cx_v3_webhook_configure_session_parameters] - -# TODO (developer): change entry point to configure_session_params in Cloud Function - - -def configure_session_params(request): - """Webhook to validate or configure new session parameters.""" - - order_number = 123 - - json_response = { - "sessionInfo": { - "parameters": { - "orderNumber": order_number, - }, - }, - } - - return json_response - - -# [END dialogflow_cx_v3_webhook_configure_session_parameters] diff --git a/samples/snippets/webhook_configure_session_parameters_test.py b/samples/snippets/webhook_configure_session_parameters_test.py deleted file mode 100644 index 19da4668..00000000 --- a/samples/snippets/webhook_configure_session_parameters_test.py +++ /dev/null @@ -1,35 +0,0 @@ -# Copyright 2022, Google LLC -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -"""Test configure new session parameters""" - -import flask -import pytest - -from webhook_configure_session_parameters import configure_session_params - - -@pytest.fixture(name="app", scope="module") -def fixture_app(): - """Flask fixture to pass a flask.Request to the test function.""" - return flask.Flask(__name__) - - -def test_validate_parameter(app): - """Test for configure new session parameters.""" - - request = {"fulfillmentInfo": {"tag": "configure-session-parameter"}} - - with app.test_request_context(json=request): - res = configure_session_params(flask.request) - assert "orderNumber" in res["sessionInfo"]["parameters"] diff --git a/samples/snippets/webhook_log_session_info.py b/samples/snippets/webhook_log_session_info.py deleted file mode 100644 index d309c9ec..00000000 --- a/samples/snippets/webhook_log_session_info.py +++ /dev/null @@ -1,45 +0,0 @@ -# Copyright 2022, Google LLC -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -""" DialogFlow CX: webhook to log session ID for each request.""" - -# [START dialogflow_cx_v3_webhook_log_session_id] - -import re - - -def log_session_id_for_troubleshooting(request): - """Webhook will log session id corresponding to request.""" - - req = request.get_json() - # You can read more about SessionInfo at https://cloud.google.com/dialogflow/cx/docs/reference/rest/v3/SessionInfo - # Use a regex pattern to get the session ID - session_id_regex = r".+\/sessions\/(.+)" - session = req["sessionInfo"]["session"] - regex_match = re.search(session_id_regex, session) - session_id = regex_match.group(1) - - # Instead of printing, use the logging tools available to you - print(f"Debug Node: session ID = {session_id}") - - # Return a generic response - res = { - "fulfillment_response": { - "messages": [{"text": {"text": [f"Request Session ID: {session_id}"]}}] - } - } - - # Returns json - return res - - -# [END dialogflow_cx_v3_webhook_log_session_id] diff --git a/samples/snippets/webhook_log_session_info_test.py b/samples/snippets/webhook_log_session_info_test.py deleted file mode 100644 index 3c30056d..00000000 --- a/samples/snippets/webhook_log_session_info_test.py +++ /dev/null @@ -1,64 +0,0 @@ -# Copyright 2022, Google LLC -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -"""Test validate form webhook request session ID snippet.""" - -import flask -import pytest - -from webhook_log_session_info import log_session_id_for_troubleshooting - - -@pytest.fixture(name="app", scope="module") -def fixture_app(): - """Flask fixture to pass a flask.Request to the test function""" - return flask.Flask(__name__) - - -@pytest.fixture -def session_id(): - return "d0bdaa0c-0d00-0000-b0eb-b00b0db000b0" - - -@pytest.fixture -def session_prefix(): - agent_id = "000000f0-f000-00b0-0000-af00d0e00000" - return f"projects/test_project/locations/us-central1/agents/{agent_id}" - - -@pytest.fixture -def session(session_prefix, session_id): - """Session string without environment path""" - return f"{session_prefix}/sessions/{session_id}" - - -@pytest.fixture -def env_session(session_prefix, session_id): - """Session string with environment path""" - environment = "0d0000f0-0aac-0d0c-0a00-b00b0000a000" - return f"{session_prefix}/environments/{environment}/sessions/{session_id}" - - -def test_logging_session_id(app, session, session_id): - """Parameterized test for regular session string.""" - request = {"sessionInfo": {"session": session}} - with app.test_request_context(json=request): - res = log_session_id_for_troubleshooting(flask.request) - assert session_id in str(res) - - -def test_logging_session_id_with_env_path(app, env_session, session_id): - """Parameterized test for session string with environment path.""" - request = {"sessionInfo": {"session": env_session}} - with app.test_request_context(json=request): - res = log_session_id_for_troubleshooting(flask.request) - assert session_id in str(res) diff --git a/samples/snippets/webhook_prebuilt_telecom.py b/samples/snippets/webhook_prebuilt_telecom.py deleted file mode 100644 index 40b1124a..00000000 --- a/samples/snippets/webhook_prebuilt_telecom.py +++ /dev/null @@ -1,299 +0,0 @@ -# Copyright 2022, Google LLC -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -""" handle_webhook will return the correct fullfilment response depending on the tag that is sent in the request""" -# [START dialogflow_cx_v3_webhook_prebuilt_telecom] -import copy -import logging - - -def cxPrebuiltAgentsTelecom(request): - logging.info("Cloud Function:" + "Invoked cloud function from Dialogflow") - request_dict = request.get_json() - - # Get the parameters in current page - parameter_info_list = request_dict["pageInfo"]["formInfo"]["parameterInfo"] - parameter_dict = {} - for parameter_info in parameter_info_list: - key = parameter_info["displayName"] - parameter_dict[key] = parameter_info["value"] - - # Get the tag - tag = request_dict["fulfillmentInfo"]["tag"] - - # BEGIN detectCustomerAnomaly - if tag == "detectCustomerAnomaly": - logging.info(tag + " was triggered.") - phone_number = parameter_dict["phone_number"] - bill_state = parameter_dict["bill_state"] - parameters = copy.deepcopy(parameter_dict) - bill_amount = None - product_line = None - anomaly_detect = "false" - purchase = "The Godfather" - purchase_amount = 9.99 - total_bill_amount = 64.33 - bill_without_purchase = 54.34 - updated_parameters = {} - - month_name, first_of_month, last_month_name = get_date_details(bill_state) - logging.info(month_name, first_of_month, last_month_name) - - # Getting the month name based on the bill state - current or previous - # For example, if the current month is December, we get the values as - # December, December 1st, November - - # Only 999999 will have anomaly detection - if str(phone_number) == "999999": - anomaly_detect = "true" - product_line = "phone" - purchase = "device protection" - updated_parameters["product_line"] = product_line - updated_parameters["bill_month"] = month_name - updated_parameters["last_month"] = last_month_name - - # If bill hike amount is given - we just add it to the total bill - if "bill_amount" in parameters: - bill_amount = parameters["bill_amount"] - purchase_amount = bill_amount["amount"] - total_bill_amount = 54.34 + purchase_amount - - # Adding the updated session parameters to the new parameters json - updated_parameters["anomaly_detect"] = anomaly_detect - updated_parameters["purchase"] = purchase - updated_parameters["purchase_amount"] = purchase_amount - updated_parameters["bill_without_purchase"] = bill_without_purchase - updated_parameters["total_bill"] = total_bill_amount - updated_parameters["first_month"] = first_of_month - - res = {"sessionInfo": {"parameters": updated_parameters}} - - # BEGIN validatePhoneLine - elif tag == "validatePhoneLine": - logging.info(tag + " was triggered.") - phone = parameter_dict["phone_number"] - phone_line_verified = "false" - line_index = None - domestic_coverage = "false" - covered_lines = ["5555555555", "5105105100", "1231231234", "9999999999"] - - # Loop over the covered lines array - for index, line in enumerate(covered_lines): - # For each phone line in the array, check if the last 4 digits are - # included in the string. when true, update the line_index variable - if phone == line: - line_index = index - logging.info("This is the index " + str(line_index)) - - # Only 9999999999 will fail - if line_index == 3: - phone_line_verified = "false" - else: - phone_line_verified = "true" - - # Only 1231231234 will have domestic coverage - if line_index == 2: - domestic_coverage = "true" - else: - domestic_coverage = "false" - - res = { - "sessionInfo": { - "parameters": { - "phone_line_verified": phone_line_verified, - "domestic_coverage": domestic_coverage, - } - } - } - - # BEGIN cruisePlanCoverage - elif tag == "cruisePlanCoverage": - logging.info(tag + " was triggered.") - port = parameter_dict["destination"] - port_is_covered = None - # Sample list of covered cruise ports. - covered_ports = [ - "mexico", - "canada", - "anguilla", - ] - - if port.lower() in covered_ports: - port_is_covered = "true" - else: - port_is_covered = "false" - - res = { - "sessionInfo": { - "parameters": { - "port_is_covered": port_is_covered, - } - } - } - - # BEGIN internationalCoverage - elif tag == "internationalCoverage": - logging.info(tag + " was triggered.") - destination = parameter_dict["destination"] - coverage = None - # Sample list of covered international monthly destinations. - covered_by_monthly = [ - "anguilla", - "australia", - "brazil", - "canada", - "chile", - "england", - "france", - "india", - "japan", - "mexico", - "russia", - "singapore", - ] - # Sample list of covered international daily destinations. - covered_by_daily = [ - "anguilla", - "australia", - "brazil", - "canada", - "chile", - "england", - "france", - "india", - "japan", - "mexico", - "singapore", - ] - if ( - destination.lower() in covered_by_monthly - and destination.lower() in covered_by_daily - ): - coverage = "both" - elif ( - destination.lower() in covered_by_monthly - and destination.lower() not in covered_by_daily - ): - coverage = "monthly_only" - elif ( - destination.lower() not in covered_by_monthly - and destination.lower() not in covered_by_daily - ): - coverage = "neither" - else: - # This should never happen, because covered_by_daily is a subset of - # covered_by_monthly - coverage = "daily_only" - - res = { - "sessionInfo": { - "parameters": { - "coverage": coverage, - } - } - } - - # BEGIN cheapestPlan - elif tag == "cheapestPlan": - logging.info(tag + " was triggered.") - trip_duration = parameter_dict["trip_duration"] - monthly_cost = None - daily_cost = None - suggested_plan = None - - # Can only suggest cheapest if both are valid for location. - - # When trip is longer than 30 days, calculate per-month cost (example $ - # amounts). Suggest monthly plan. - if trip_duration > 30: - monthly_cost = (int(trip_duration / 30)) * 70 - daily_cost = trip_duration * 10 - suggested_plan = "monthly" - - # When trip is <= 30 days, but greater than 6 days, calculate monthly - # plan cost and daily plan cost. Suggest monthly b/c it is the cheaper - # one. - elif trip_duration <= 30 and trip_duration > 6: - monthly_cost = 70 - daily_cost = trip_duration * 10 - suggested_plan = "monthly" - - # When trip is <= 6 days, calculate daily plan cost. Suggest daily - # plan. - elif trip_duration <= 6 and trip_duration > 0: - monthly_cost = 70 - daily_cost = trip_duration * 10 - suggested_plan = "daily" - - else: - # This should never happen b/c trip_duration would have to be - # negative - suggested_plan = "null" - - res = { - "sessionInfo": { - "parameters": { - "monthly_cost": monthly_cost, - "daily_cost": daily_cost, - "suggested_plan": suggested_plan, - } - } - } - - # Default Case - else: - res = None - logging.info(f'{"default case called"}') - - # Returns json - return res - - -# Get the current month, first day of current month and last month values -# based on today's date -def get_date_details(bill_state): - from datetime import date - from dateutil.relativedelta import relativedelta - - monthNames = [ - "January", - "February", - "March", - "April", - "May", - "June", - "July", - "August", - "September", - "October", - "November", - "December", - ] - today = date.today() - # index starts with 0 - first_month_name = monthNames[(today.month - 1)] - firstDay = today.replace(day=1) - first_day_str = str(firstDay) - - last_month_name = monthNames[(today.month - 1) - 1] - last_month_first_day_str = str( - today.replace(day=1, month=(today - relativedelta(months=1)).month) - ) - second_last_month_name = monthNames[(today.month - 1) - 2] - if bill_state == "current": - return [first_month_name, first_day_str, last_month_name] - else: - return [last_month_name, last_month_first_day_str, second_last_month_name] - - -# [END dialogflow_cx_v3_webhook_prebuilt_telecom] diff --git a/samples/snippets/webhook_prebuilt_telecom_test.py b/samples/snippets/webhook_prebuilt_telecom_test.py deleted file mode 100644 index b7ac9e17..00000000 --- a/samples/snippets/webhook_prebuilt_telecom_test.py +++ /dev/null @@ -1,311 +0,0 @@ -# Copyright 2022, Google LLC -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -"""Test validate form parameter webhook snippet.""" - -import flask -import pytest - -from webhook_prebuilt_telecom import cxPrebuiltAgentsTelecom - - -@pytest.fixture(name="app", scope="module") -def fixture_app(): - """Flask fixture to pass a flask.Request to the test function""" - return flask.Flask(__name__) - - -def test_detect_customeranomaly_current(app): - """Parameterized test for detecting customer anomaly webhook snippet.""" - - from datetime import date - - request = { - "fulfillmentInfo": {"tag": "detectCustomerAnomaly"}, - "pageInfo": { - "formInfo": { - "parameterInfo": [ - {"displayName": "phone_number", "value": 999999}, - {"displayName": "bill_state", "value": "current"}, - {"displayName": "bill_amount", "value": {"amount": 1000}}, - ] - } - }, - } - - with app.test_request_context(json=request): - res = cxPrebuiltAgentsTelecom(flask.request) - assert res["sessionInfo"]["parameters"]["anomaly_detect"] == "true" - assert res["sessionInfo"]["parameters"]["total_bill"] == 1054.34 - assert res["sessionInfo"]["parameters"]["first_month"] == str( - date.today().replace(day=1) - ) - - -def test_detect_customeranomaly_other(app): - """Parameterized test for detecting customer anomaly webhook snippet.""" - - from datetime import date - - request = { - "fulfillmentInfo": {"tag": "detectCustomerAnomaly"}, - "pageInfo": { - "formInfo": { - "parameterInfo": [ - {"displayName": "phone_number", "value": 8231234789}, - {"displayName": "bill_state", "value": "other situation"}, - {"displayName": "bill_amount", "value": {"amount": 1000}}, - ] - } - }, - } - - with app.test_request_context(json=request): - res = cxPrebuiltAgentsTelecom(flask.request) - today = date.today() - assert res["sessionInfo"]["parameters"]["anomaly_detect"] == "false" - assert res["sessionInfo"]["parameters"]["total_bill"] == 1054.34 - assert res["sessionInfo"]["parameters"]["first_month"] == str( - today.replace(day=1, month=1 + ((today.month - 2) % 12)) - ) - - -def test_validate_phoneline(app): - """Parameterized test for validate form parameter webhook snippet.""" - - request = { - "fulfillmentInfo": {"tag": "validatePhoneLine"}, - "pageInfo": { - "formInfo": { - "parameterInfo": [ - {"displayName": "phone_number", "value": "5105105100"} - ] - } - }, - } - - with app.test_request_context(json=request): - res = cxPrebuiltAgentsTelecom(flask.request) - assert res["sessionInfo"]["parameters"]["phone_line_verified"] == "true" - - -def test_invalid_phoneline(app): - """Parameterized test for validate form parameter webhook snippet.""" - - request = { - "fulfillmentInfo": {"tag": "validatePhoneLine"}, - "pageInfo": { - "formInfo": { - "parameterInfo": [ - {"displayName": "phone_number", "value": "9999999999"} - ] - } - }, - } - - with app.test_request_context(json=request): - res = cxPrebuiltAgentsTelecom(flask.request) - assert res["sessionInfo"]["parameters"]["phone_line_verified"] == "false" - - -def test_invalid_phoneline2(app): - """Parameterized test for validate form parameter webhook snippet.""" - - request = { - "fulfillmentInfo": {"tag": "validatePhoneLine"}, - "pageInfo": { - "formInfo": { - "parameterInfo": [ - {"displayName": "phone_number", "value": "1231231234"} - ] - } - }, - } - - with app.test_request_context(json=request): - res = cxPrebuiltAgentsTelecom(flask.request) - assert res["sessionInfo"]["parameters"]["domestic_coverage"] == "true" - - -def test_cruiseplan_coverage(app): - """Parameterized test for cruise plan coverage webhook snippet.""" - - request = { - "fulfillmentInfo": {"tag": "cruisePlanCoverage"}, - "pageInfo": { - "formInfo": { - "parameterInfo": [{"displayName": "destination", "value": "mexico"}] - } - }, - } - - with app.test_request_context(json=request): - res = cxPrebuiltAgentsTelecom(flask.request) - assert res["sessionInfo"]["parameters"]["port_is_covered"] == "true" - - -def test_cruiseplan_notcovered(app): - """Parameterized test for cruise plan coverage webhook snippet.""" - - request = { - "fulfillmentInfo": {"tag": "cruisePlanCoverage"}, - "pageInfo": { - "formInfo": { - "parameterInfo": [{"displayName": "destination", "value": "china"}] - } - }, - } - - with app.test_request_context(json=request): - res = cxPrebuiltAgentsTelecom(flask.request) - assert res["sessionInfo"]["parameters"]["port_is_covered"] == "false" - - -def test_international_coverage1(app): - """Parameterized test for international coverage webhook snippet.""" - - request = { - "fulfillmentInfo": {"tag": "internationalCoverage"}, - "pageInfo": { - "formInfo": { - "parameterInfo": [{"displayName": "destination", "value": "singapore"}] - } - }, - } - - with app.test_request_context(json=request): - res = cxPrebuiltAgentsTelecom(flask.request) - assert res["sessionInfo"]["parameters"]["coverage"] == "both" - - -def test_international_coverage2(app): - """Parameterized test for international coverage webhook snippet.""" - - request = { - "fulfillmentInfo": {"tag": "internationalCoverage"}, - "pageInfo": { - "formInfo": { - "parameterInfo": [{"displayName": "destination", "value": "russia"}] - } - }, - } - - with app.test_request_context(json=request): - res = cxPrebuiltAgentsTelecom(flask.request) - assert res["sessionInfo"]["parameters"]["coverage"] == "monthly_only" - - -def test_international_coverage3(app): - """Parameterized test for international coverage webhook snippet.""" - - request = { - "fulfillmentInfo": {"tag": "internationalCoverage"}, - "pageInfo": { - "formInfo": { - "parameterInfo": [{"displayName": "destination", "value": "china"}] - } - }, - } - - with app.test_request_context(json=request): - res = cxPrebuiltAgentsTelecom(flask.request) - assert res["sessionInfo"]["parameters"]["coverage"] == "neither" - - -def test_cheapest_plan1(app): - """Parameterized test for international coverage webhook snippet.""" - - request = { - "fulfillmentInfo": {"tag": "cheapestPlan"}, - "pageInfo": { - "formInfo": { - "parameterInfo": [{"displayName": "trip_duration", "value": 40}] - } - }, - } - - with app.test_request_context(json=request): - res = cxPrebuiltAgentsTelecom(flask.request) - assert res["sessionInfo"]["parameters"]["monthly_cost"] == 70 - assert res["sessionInfo"]["parameters"]["daily_cost"] == 400 - assert res["sessionInfo"]["parameters"]["suggested_plan"] == "monthly" - - -def test_cheapest_plan2(app): - """Parameterized test for international coverage webhook snippet.""" - - request = { - "fulfillmentInfo": {"tag": "cheapestPlan"}, - "pageInfo": { - "formInfo": { - "parameterInfo": [{"displayName": "trip_duration", "value": 20}] - } - }, - } - - with app.test_request_context(json=request): - res = cxPrebuiltAgentsTelecom(flask.request) - assert res["sessionInfo"]["parameters"]["monthly_cost"] == 70 - assert res["sessionInfo"]["parameters"]["daily_cost"] == 200 - assert res["sessionInfo"]["parameters"]["suggested_plan"] == "monthly" - - -def test_cheapest_plan3(app): - """Parameterized test for international coverage webhook snippet.""" - - request = { - "fulfillmentInfo": {"tag": "cheapestPlan"}, - "pageInfo": { - "formInfo": { - "parameterInfo": [{"displayName": "trip_duration", "value": 5}] - } - }, - } - - with app.test_request_context(json=request): - res = cxPrebuiltAgentsTelecom(flask.request) - assert res["sessionInfo"]["parameters"]["monthly_cost"] == 70 - assert res["sessionInfo"]["parameters"]["daily_cost"] == 50 - assert res["sessionInfo"]["parameters"]["suggested_plan"] == "daily" - - -def test_cheapest_plan4(app): - """Invalid Case: This happens only when customer enters a negative number""" - - request = { - "fulfillmentInfo": {"tag": "cheapestPlan"}, - "pageInfo": { - "formInfo": { - "parameterInfo": [{"displayName": "trip_duration", "value": -1}] - } - }, - } - - with app.test_request_context(json=request): - res = cxPrebuiltAgentsTelecom(flask.request) - assert res["sessionInfo"]["parameters"]["suggested_plan"] == "null" - - -def test_default_tag(app): - """Default Case.""" - - request = { - "fulfillmentInfo": {"tag": None}, - "pageInfo": { - "formInfo": {"parameterInfo": [{"displayName": None, "value": None}]} - }, - } - - with app.test_request_context(json=request): - res = cxPrebuiltAgentsTelecom(flask.request) - assert res is None diff --git a/samples/snippets/webhook_test.py b/samples/snippets/webhook_test.py deleted file mode 100644 index 1d42ff78..00000000 --- a/samples/snippets/webhook_test.py +++ /dev/null @@ -1,34 +0,0 @@ -# Copyright 2021, Google LLC -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -"""Test webhook""" - -import flask -import pytest - -from webhook import handle_webhook - -# Create a fake 'app' for generating test request contexts. - -request = {"fulfillmentInfo": {"tag": "Default Welcome Intent"}} - - -@pytest.fixture(scope="module") -def app(): - return flask.Flask(__name__) - - -def test_handle_webhook(app): - with app.test_request_context(json=request): - res = handle_webhook(flask.request) - assert "Hello from a GCF Webhook" in str(res) diff --git a/samples/snippets/webhook_validate_form_parameter.py b/samples/snippets/webhook_validate_form_parameter.py deleted file mode 100644 index 5e2574fc..00000000 --- a/samples/snippets/webhook_validate_form_parameter.py +++ /dev/null @@ -1,45 +0,0 @@ -# Copyright 2022, Google LLC -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - - -""" DialogFlow CX: webhook to validate or invalidate form parameters snippet.""" - - -# [START dialogflow_cx_v3_webhook_validate_form_parameter] - - -def validate_parameter(request): - """Webhook will validate or invalidate parameter based on logic configured by the user.""" - return { - "page_info": { - "form_info": { - "parameter_info": [ - { - "displayName": "orderNumber", - "required": True, - "state": "INVALID", - "value": 123, - }, - ], - }, - }, - "sessionInfo": { - "parameters": { - # Set session parameter to None if the form parameter is 'INVALID' and your agent needs to reprompt the user - "orderNumber": None, - }, - }, - } - - -# [END dialogflow_cx_v3_webhook_validate_form_parameter] diff --git a/samples/snippets/webhook_validate_form_parameter_test.py b/samples/snippets/webhook_validate_form_parameter_test.py deleted file mode 100644 index 8a29f5eb..00000000 --- a/samples/snippets/webhook_validate_form_parameter_test.py +++ /dev/null @@ -1,35 +0,0 @@ -# Copyright 2022, Google LLC -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -"""Test validate form parameter webhook snippet.""" - -import flask -import pytest - -from webhook_validate_form_parameter import validate_parameter - - -@pytest.fixture(name="app", scope="module") -def fixture_app(): - """Flask fixture to pass a flask.Request to the test function""" - return flask.Flask(__name__) - - -def test_validate_parameter(app): - """Parameterized test for validate form parameter webhook snippet.""" - - request = {"pageInfo": {"formInfo": {"parameterInfo": [{"value": 123}]}}} - - with app.test_request_context(json=request): - res = validate_parameter(flask.request) - assert res["page_info"]["form_info"]["parameter_info"][0]["state"] == "INVALID" From 361a359e60c8953453a6837e3e5f1916fad76095 Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Tue, 14 Mar 2023 06:56:44 -0400 Subject: [PATCH 5/8] docs: clarified wording around quota usage (#515) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * docs: clarified wording around quota usage PiperOrigin-RevId: 516225429 Source-Link: https://github.com/googleapis/googleapis/commit/c13a9855f25c7b41805278dc1447ccc274311a30 Source-Link: https://github.com/googleapis/googleapis-gen/commit/7bf5248fa1d724006a589e07d9029951c74a8bc6 Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiN2JmNTI0OGZhMWQ3MjQwMDZhNTg5ZTA3ZDkwMjk5NTFjNzRhOGJjNiJ9 * 🦉 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 --- .../dialogflowcx_v3/services/deployments/async_client.py | 2 +- google/cloud/dialogflowcx_v3/services/deployments/client.py | 2 +- .../dialogflowcx_v3/services/deployments/transports/rest.py | 2 +- google/cloud/dialogflowcx_v3/types/deployment.py | 2 +- google/cloud/dialogflowcx_v3/types/session.py | 4 ++-- 5 files changed, 6 insertions(+), 6 deletions(-) diff --git a/google/cloud/dialogflowcx_v3/services/deployments/async_client.py b/google/cloud/dialogflowcx_v3/services/deployments/async_client.py index e1606481..15675b63 100644 --- a/google/cloud/dialogflowcx_v3/services/deployments/async_client.py +++ b/google/cloud/dialogflowcx_v3/services/deployments/async_client.py @@ -399,7 +399,7 @@ async def sample_get_deployment(): Returns: google.cloud.dialogflowcx_v3.types.Deployment: - Represents an deployment in an + Represents a deployment in an environment. A deployment happens when a flow version configured to be active in the environment. You can configure diff --git a/google/cloud/dialogflowcx_v3/services/deployments/client.py b/google/cloud/dialogflowcx_v3/services/deployments/client.py index 2d9f78ad..c97a4f95 100644 --- a/google/cloud/dialogflowcx_v3/services/deployments/client.py +++ b/google/cloud/dialogflowcx_v3/services/deployments/client.py @@ -704,7 +704,7 @@ def sample_get_deployment(): Returns: google.cloud.dialogflowcx_v3.types.Deployment: - Represents an deployment in an + Represents a deployment in an environment. A deployment happens when a flow version configured to be active in the environment. You can configure diff --git a/google/cloud/dialogflowcx_v3/services/deployments/transports/rest.py b/google/cloud/dialogflowcx_v3/services/deployments/transports/rest.py index 05d5a8dd..48a75e61 100644 --- a/google/cloud/dialogflowcx_v3/services/deployments/transports/rest.py +++ b/google/cloud/dialogflowcx_v3/services/deployments/transports/rest.py @@ -384,7 +384,7 @@ def __call__( Returns: ~.deployment.Deployment: - Represents an deployment in an + Represents a deployment in an environment. A deployment happens when a flow version configured to be active in the environment. You can configure diff --git a/google/cloud/dialogflowcx_v3/types/deployment.py b/google/cloud/dialogflowcx_v3/types/deployment.py index e1ede854..3a2215a0 100644 --- a/google/cloud/dialogflowcx_v3/types/deployment.py +++ b/google/cloud/dialogflowcx_v3/types/deployment.py @@ -34,7 +34,7 @@ class Deployment(proto.Message): - r"""Represents an deployment in an environment. A deployment + r"""Represents a deployment in an environment. A deployment happens when a flow version configured to be active in the environment. You can configure running pre-deployment steps, e.g. running validation test cases, experiment auto-rollout, diff --git a/google/cloud/dialogflowcx_v3/types/session.py b/google/cloud/dialogflowcx_v3/types/session.py index ff760d0b..7c2be730 100644 --- a/google/cloud/dialogflowcx_v3/types/session.py +++ b/google/cloud/dialogflowcx_v3/types/session.py @@ -1009,8 +1009,8 @@ class AudioInput(proto.Message): to process the speech audio. audio (bytes): The natural language speech audio to be processed. A single - request can contain up to 1 minute of speech audio data. The - [transcribed + request can contain up to 2 minutes of speech audio data. + The [transcribed text][google.cloud.dialogflow.cx.v3.QueryResult.transcript] cannot contain more than 256 bytes. From 84a2ef0f0da967828d2b566fd4287d60ab714ef6 Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Thu, 16 Mar 2023 12:44:11 +0000 Subject: [PATCH 6/8] chore(deps): Update nox in .kokoro/requirements.in [autoapprove] (#516) Source-Link: https://togithub.com/googleapis/synthtool/commit/92006bb3cdc84677aa93c7f5235424ec2b157146 Post-Processor: gcr.io/cloud-devrel-public-resources/owlbot-python:latest@sha256:2e247c7bf5154df7f98cce087a20ca7605e236340c7d6d1a14447e5c06791bd6 --- .github/.OwlBot.lock.yaml | 2 +- .kokoro/requirements.in | 2 +- .kokoro/requirements.txt | 14 +++++--------- 3 files changed, 7 insertions(+), 11 deletions(-) diff --git a/.github/.OwlBot.lock.yaml b/.github/.OwlBot.lock.yaml index 5fc5daa3..b8edda51 100644 --- a/.github/.OwlBot.lock.yaml +++ b/.github/.OwlBot.lock.yaml @@ -13,4 +13,4 @@ # limitations under the License. docker: image: gcr.io/cloud-devrel-public-resources/owlbot-python:latest - digest: sha256:8555f0e37e6261408f792bfd6635102d2da5ad73f8f09bcb24f25e6afb5fac97 + digest: sha256:2e247c7bf5154df7f98cce087a20ca7605e236340c7d6d1a14447e5c06791bd6 diff --git a/.kokoro/requirements.in b/.kokoro/requirements.in index 882178ce..ec867d9f 100644 --- a/.kokoro/requirements.in +++ b/.kokoro/requirements.in @@ -5,6 +5,6 @@ typing-extensions twine wheel setuptools -nox +nox>=2022.11.21 # required to remove dependency on py charset-normalizer<3 click<8.1.0 diff --git a/.kokoro/requirements.txt b/.kokoro/requirements.txt index fa99c129..66a2172a 100644 --- a/.kokoro/requirements.txt +++ b/.kokoro/requirements.txt @@ -1,6 +1,6 @@ # -# This file is autogenerated by pip-compile with python 3.10 -# To update, run: +# This file is autogenerated by pip-compile with Python 3.9 +# by the following command: # # pip-compile --allow-unsafe --generate-hashes requirements.in # @@ -335,9 +335,9 @@ more-itertools==9.0.0 \ --hash=sha256:250e83d7e81d0c87ca6bd942e6aeab8cc9daa6096d12c5308f3f92fa5e5c1f41 \ --hash=sha256:5a6257e40878ef0520b1803990e3e22303a41b5714006c32a3fd8304b26ea1ab # via jaraco-classes -nox==2022.8.7 \ - --hash=sha256:1b894940551dc5c389f9271d197ca5d655d40bdc6ccf93ed6880e4042760a34b \ - --hash=sha256:96cca88779e08282a699d672258ec01eb7c792d35bbbf538c723172bce23212c +nox==2022.11.21 \ + --hash=sha256:0e41a990e290e274cb205a976c4c97ee3c5234441a8132c8c3fd9ea3c22149eb \ + --hash=sha256:e21c31de0711d1274ca585a2c5fde36b1aa962005ba8e9322bf5eeed16dcd684 # via -r requirements.in packaging==21.3 \ --hash=sha256:dd47c42927d89ab911e606518907cc2d3a1f38bbd026385970643f9c5b8ecfeb \ @@ -380,10 +380,6 @@ protobuf==3.20.3 \ # gcp-docuploader # gcp-releasetool # google-api-core -py==1.11.0 \ - --hash=sha256:51c75c4126074b472f746a24399ad32f6053d1b34b68d2fa41e558e6f4a98719 \ - --hash=sha256:607c53218732647dff4acdfcd50cb62615cedf612e72d1724fb1a0cc6405b378 - # via nox pyasn1==0.4.8 \ --hash=sha256:39c7e2ec30515947ff4e87fb6f456dfc6e84857d34be479c9d4a4ba4bf46aa5d \ --hash=sha256:aef77c9fb94a3ac588e87841208bdec464471d9871bd5050a287cc9a475cd0ba From b05b15f2ac54ffd83a33ee0829cab395f157a42f Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Thu, 23 Mar 2023 09:44:10 -0400 Subject: [PATCH 7/8] docs: minor formatting changes (#517) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * docs: Fix formatting of request arg in docstring chore: Update gapic-generator-python to v1.9.1 PiperOrigin-RevId: 518604533 Source-Link: https://github.com/googleapis/googleapis/commit/8a085aeddfa010af5bcef090827aac5255383d7e Source-Link: https://github.com/googleapis/googleapis-gen/commit/b2ab4b0a0ae2907e812c209198a74e0898afcb04 Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiYjJhYjRiMGEwYWUyOTA3ZTgxMmMyMDkxOThhNzRlMDg5OGFmY2IwNCJ9 * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md * chore: Update the copyright year docs: Reformat some lines of code PiperOrigin-RevId: 518686790 Source-Link: https://github.com/googleapis/googleapis/commit/2205f23a4ef0e505a5f9abf3cb54531fb4e959d9 Source-Link: https://github.com/googleapis/googleapis-gen/commit/0b041ff2be2d1ad3010ef351a5d62b6d2a1c8a3b Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiMGIwNDFmZjJiZTJkMWFkMzAxMGVmMzUxYTVkNjJiNmQyYTFjOGEzYiJ9 * 🦉 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 --- .../services/agents/transports/rest.py | 9 --- .../services/changelogs/transports/rest.py | 2 - .../services/deployments/transports/rest.py | 2 - .../services/entity_types/transports/rest.py | 5 -- .../services/environments/transports/rest.py | 9 --- .../services/experiments/transports/rest.py | 7 --- .../services/flows/transports/rest.py | 10 ---- .../services/intents/transports/rest.py | 5 -- .../services/pages/transports/rest.py | 5 -- .../transports/rest.py | 5 -- .../session_entity_types/transports/rest.py | 5 -- .../services/sessions/async_client.py | 59 ++++++++++--------- .../services/sessions/client.py | 59 ++++++++++--------- .../services/test_cases/transports/rest.py | 12 ---- .../transports/rest.py | 5 -- .../services/versions/transports/rest.py | 7 --- .../services/webhooks/transports/rest.py | 5 -- .../services/agents/transports/rest.py | 9 --- .../services/changelogs/transports/rest.py | 2 - .../services/deployments/transports/rest.py | 2 - .../services/entity_types/transports/rest.py | 5 -- .../services/environments/transports/rest.py | 9 --- .../services/experiments/transports/rest.py | 7 --- .../services/flows/transports/rest.py | 10 ---- .../services/intents/transports/rest.py | 5 -- .../services/pages/transports/rest.py | 5 -- .../transports/rest.py | 5 -- .../session_entity_types/transports/rest.py | 5 -- .../services/sessions/async_client.py | 59 ++++++++++--------- .../services/sessions/client.py | 59 ++++++++++--------- .../services/test_cases/transports/rest.py | 12 ---- .../transports/rest.py | 5 -- .../services/versions/transports/rest.py | 7 --- .../services/webhooks/transports/rest.py | 5 -- 34 files changed, 124 insertions(+), 298 deletions(-) diff --git a/google/cloud/dialogflowcx_v3/services/agents/transports/rest.py b/google/cloud/dialogflowcx_v3/services/agents/transports/rest.py index 0bdb46c8..ae8a8542 100644 --- a/google/cloud/dialogflowcx_v3/services/agents/transports/rest.py +++ b/google/cloud/dialogflowcx_v3/services/agents/transports/rest.py @@ -621,7 +621,6 @@ def __call__( request (~.gcdc_agent.CreateAgentRequest): The request object. The request message for [Agents.CreateAgent][google.cloud.dialogflow.cx.v3.Agents.CreateAgent]. - retry (google.api_core.retry.Retry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. @@ -731,7 +730,6 @@ def __call__( request (~.agent.DeleteAgentRequest): The request object. The request message for [Agents.DeleteAgent][google.cloud.dialogflow.cx.v3.Agents.DeleteAgent]. - retry (google.api_core.retry.Retry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. @@ -807,7 +805,6 @@ def __call__( request (~.agent.ExportAgentRequest): The request object. The request message for [Agents.ExportAgent][google.cloud.dialogflow.cx.v3.Agents.ExportAgent]. - retry (google.api_core.retry.Retry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. @@ -905,7 +902,6 @@ def __call__( request (~.agent.GetAgentRequest): The request object. The request message for [Agents.GetAgent][google.cloud.dialogflow.cx.v3.Agents.GetAgent]. - retry (google.api_core.retry.Retry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. @@ -1007,7 +1003,6 @@ def __call__( request (~.agent.GetAgentValidationResultRequest): The request object. The request message for [Agents.GetAgentValidationResult][google.cloud.dialogflow.cx.v3.Agents.GetAgentValidationResult]. - retry (google.api_core.retry.Retry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. @@ -1099,7 +1094,6 @@ def __call__( request (~.agent.ListAgentsRequest): The request object. The request message for [Agents.ListAgents][google.cloud.dialogflow.cx.v3.Agents.ListAgents]. - retry (google.api_core.retry.Retry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. @@ -1189,7 +1183,6 @@ def __call__( request (~.agent.RestoreAgentRequest): The request object. The request message for [Agents.RestoreAgent][google.cloud.dialogflow.cx.v3.Agents.RestoreAgent]. - retry (google.api_core.retry.Retry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. @@ -1287,7 +1280,6 @@ def __call__( request (~.gcdc_agent.UpdateAgentRequest): The request object. The request message for [Agents.UpdateAgent][google.cloud.dialogflow.cx.v3.Agents.UpdateAgent]. - retry (google.api_core.retry.Retry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. @@ -1397,7 +1389,6 @@ def __call__( request (~.agent.ValidateAgentRequest): The request object. The request message for [Agents.ValidateAgent][google.cloud.dialogflow.cx.v3.Agents.ValidateAgent]. - retry (google.api_core.retry.Retry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. diff --git a/google/cloud/dialogflowcx_v3/services/changelogs/transports/rest.py b/google/cloud/dialogflowcx_v3/services/changelogs/transports/rest.py index 62006579..fd6b911e 100644 --- a/google/cloud/dialogflowcx_v3/services/changelogs/transports/rest.py +++ b/google/cloud/dialogflowcx_v3/services/changelogs/transports/rest.py @@ -373,7 +373,6 @@ def __call__( request (~.changelog.GetChangelogRequest): The request object. The request message for [Changelogs.GetChangelog][google.cloud.dialogflow.cx.v3.Changelogs.GetChangelog]. - retry (google.api_core.retry.Retry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. @@ -463,7 +462,6 @@ def __call__( request (~.changelog.ListChangelogsRequest): The request object. The request message for [Changelogs.ListChangelogs][google.cloud.dialogflow.cx.v3.Changelogs.ListChangelogs]. - retry (google.api_core.retry.Retry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. diff --git a/google/cloud/dialogflowcx_v3/services/deployments/transports/rest.py b/google/cloud/dialogflowcx_v3/services/deployments/transports/rest.py index 48a75e61..d30727f6 100644 --- a/google/cloud/dialogflowcx_v3/services/deployments/transports/rest.py +++ b/google/cloud/dialogflowcx_v3/services/deployments/transports/rest.py @@ -375,7 +375,6 @@ def __call__( request (~.deployment.GetDeploymentRequest): The request object. The request message for [Deployments.GetDeployment][google.cloud.dialogflow.cx.v3.Deployments.GetDeployment]. - retry (google.api_core.retry.Retry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. @@ -470,7 +469,6 @@ def __call__( request (~.deployment.ListDeploymentsRequest): The request object. The request message for [Deployments.ListDeployments][google.cloud.dialogflow.cx.v3.Deployments.ListDeployments]. - retry (google.api_core.retry.Retry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. diff --git a/google/cloud/dialogflowcx_v3/services/entity_types/transports/rest.py b/google/cloud/dialogflowcx_v3/services/entity_types/transports/rest.py index 382553ab..b0ba903f 100644 --- a/google/cloud/dialogflowcx_v3/services/entity_types/transports/rest.py +++ b/google/cloud/dialogflowcx_v3/services/entity_types/transports/rest.py @@ -455,7 +455,6 @@ def __call__( request (~.gcdc_entity_type.CreateEntityTypeRequest): The request object. The request message for [EntityTypes.CreateEntityType][google.cloud.dialogflow.cx.v3.EntityTypes.CreateEntityType]. - retry (google.api_core.retry.Retry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. @@ -589,7 +588,6 @@ def __call__( request (~.entity_type.DeleteEntityTypeRequest): The request object. The request message for [EntityTypes.DeleteEntityType][google.cloud.dialogflow.cx.v3.EntityTypes.DeleteEntityType]. - retry (google.api_core.retry.Retry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. @@ -667,7 +665,6 @@ def __call__( request (~.entity_type.GetEntityTypeRequest): The request object. The request message for [EntityTypes.GetEntityType][google.cloud.dialogflow.cx.v3.EntityTypes.GetEntityType]. - retry (google.api_core.retry.Retry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. @@ -790,7 +787,6 @@ def __call__( request (~.entity_type.ListEntityTypesRequest): The request object. The request message for [EntityTypes.ListEntityTypes][google.cloud.dialogflow.cx.v3.EntityTypes.ListEntityTypes]. - retry (google.api_core.retry.Retry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. @@ -882,7 +878,6 @@ def __call__( request (~.gcdc_entity_type.UpdateEntityTypeRequest): The request object. The request message for [EntityTypes.UpdateEntityType][google.cloud.dialogflow.cx.v3.EntityTypes.UpdateEntityType]. - retry (google.api_core.retry.Retry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. diff --git a/google/cloud/dialogflowcx_v3/services/environments/transports/rest.py b/google/cloud/dialogflowcx_v3/services/environments/transports/rest.py index 30fdc92c..816a7ed1 100644 --- a/google/cloud/dialogflowcx_v3/services/environments/transports/rest.py +++ b/google/cloud/dialogflowcx_v3/services/environments/transports/rest.py @@ -640,7 +640,6 @@ def __call__( request (~.gcdc_environment.CreateEnvironmentRequest): The request object. The request message for [Environments.CreateEnvironment][google.cloud.dialogflow.cx.v3.Environments.CreateEnvironment]. - retry (google.api_core.retry.Retry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. @@ -740,7 +739,6 @@ def __call__( request (~.environment.DeleteEnvironmentRequest): The request object. The request message for [Environments.DeleteEnvironment][google.cloud.dialogflow.cx.v3.Environments.DeleteEnvironment]. - retry (google.api_core.retry.Retry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. @@ -818,7 +816,6 @@ def __call__( request (~.environment.DeployFlowRequest): The request object. The request message for [Environments.DeployFlow][google.cloud.dialogflow.cx.v3.Environments.DeployFlow]. - retry (google.api_core.retry.Retry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. @@ -916,7 +913,6 @@ def __call__( request (~.environment.GetEnvironmentRequest): The request object. The request message for [Environments.GetEnvironment][google.cloud.dialogflow.cx.v3.Environments.GetEnvironment]. - retry (google.api_core.retry.Retry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. @@ -1020,7 +1016,6 @@ def __call__( request (~.environment.ListContinuousTestResultsRequest): The request object. The request message for [Environments.ListContinuousTestResults][google.cloud.dialogflow.cx.v3.Environments.ListContinuousTestResults]. - retry (google.api_core.retry.Retry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. @@ -1112,7 +1107,6 @@ def __call__( request (~.environment.ListEnvironmentsRequest): The request object. The request message for [Environments.ListEnvironments][google.cloud.dialogflow.cx.v3.Environments.ListEnvironments]. - retry (google.api_core.retry.Retry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. @@ -1205,7 +1199,6 @@ def __call__( request (~.environment.LookupEnvironmentHistoryRequest): The request object. The request message for [Environments.LookupEnvironmentHistory][google.cloud.dialogflow.cx.v3.Environments.LookupEnvironmentHistory]. - retry (google.api_core.retry.Retry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. @@ -1297,7 +1290,6 @@ def __call__( request (~.environment.RunContinuousTestRequest): The request object. The request message for [Environments.RunContinuousTest][google.cloud.dialogflow.cx.v3.Environments.RunContinuousTest]. - retry (google.api_core.retry.Retry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. @@ -1399,7 +1391,6 @@ def __call__( request (~.gcdc_environment.UpdateEnvironmentRequest): The request object. The request message for [Environments.UpdateEnvironment][google.cloud.dialogflow.cx.v3.Environments.UpdateEnvironment]. - retry (google.api_core.retry.Retry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. diff --git a/google/cloud/dialogflowcx_v3/services/experiments/transports/rest.py b/google/cloud/dialogflowcx_v3/services/experiments/transports/rest.py index 5c4fc9be..da3d5524 100644 --- a/google/cloud/dialogflowcx_v3/services/experiments/transports/rest.py +++ b/google/cloud/dialogflowcx_v3/services/experiments/transports/rest.py @@ -517,7 +517,6 @@ def __call__( request (~.gcdc_experiment.CreateExperimentRequest): The request object. The request message for [Experiments.CreateExperiment][google.cloud.dialogflow.cx.v3.Experiments.CreateExperiment]. - retry (google.api_core.retry.Retry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. @@ -618,7 +617,6 @@ def __call__( request (~.experiment.DeleteExperimentRequest): The request object. The request message for [Experiments.DeleteExperiment][google.cloud.dialogflow.cx.v3.Experiments.DeleteExperiment]. - retry (google.api_core.retry.Retry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. @@ -696,7 +694,6 @@ def __call__( request (~.experiment.GetExperimentRequest): The request object. The request message for [Experiments.GetExperiment][google.cloud.dialogflow.cx.v3.Experiments.GetExperiment]. - retry (google.api_core.retry.Retry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. @@ -786,7 +783,6 @@ def __call__( request (~.experiment.ListExperimentsRequest): The request object. The request message for [Experiments.ListExperiments][google.cloud.dialogflow.cx.v3.Experiments.ListExperiments]. - retry (google.api_core.retry.Retry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. @@ -878,7 +874,6 @@ def __call__( request (~.experiment.StartExperimentRequest): The request object. The request message for [Experiments.StartExperiment][google.cloud.dialogflow.cx.v3.Experiments.StartExperiment]. - retry (google.api_core.retry.Retry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. @@ -979,7 +974,6 @@ def __call__( request (~.experiment.StopExperimentRequest): The request object. The request message for [Experiments.StopExperiment][google.cloud.dialogflow.cx.v3.Experiments.StopExperiment]. - retry (google.api_core.retry.Retry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. @@ -1080,7 +1074,6 @@ def __call__( request (~.gcdc_experiment.UpdateExperimentRequest): The request object. The request message for [Experiments.UpdateExperiment][google.cloud.dialogflow.cx.v3.Experiments.UpdateExperiment]. - retry (google.api_core.retry.Retry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. diff --git a/google/cloud/dialogflowcx_v3/services/flows/transports/rest.py b/google/cloud/dialogflowcx_v3/services/flows/transports/rest.py index 9e012c24..2b1c8d72 100644 --- a/google/cloud/dialogflowcx_v3/services/flows/transports/rest.py +++ b/google/cloud/dialogflowcx_v3/services/flows/transports/rest.py @@ -646,7 +646,6 @@ def __call__( request (~.gcdc_flow.CreateFlowRequest): The request object. The request message for [Flows.CreateFlow][google.cloud.dialogflow.cx.v3.Flows.CreateFlow]. - retry (google.api_core.retry.Retry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. @@ -766,7 +765,6 @@ def __call__( request (~.flow.DeleteFlowRequest): The request object. The request message for [Flows.DeleteFlow][google.cloud.dialogflow.cx.v3.Flows.DeleteFlow]. - retry (google.api_core.retry.Retry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. @@ -842,7 +840,6 @@ def __call__( request (~.flow.ExportFlowRequest): The request object. The request message for [Flows.ExportFlow][google.cloud.dialogflow.cx.v3.Flows.ExportFlow]. - retry (google.api_core.retry.Retry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. @@ -940,7 +937,6 @@ def __call__( request (~.flow.GetFlowRequest): The request object. The response message for [Flows.GetFlow][google.cloud.dialogflow.cx.v3.Flows.GetFlow]. - retry (google.api_core.retry.Retry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. @@ -1052,7 +1048,6 @@ def __call__( request (~.flow.GetFlowValidationResultRequest): The request object. The request message for [Flows.GetFlowValidationResult][google.cloud.dialogflow.cx.v3.Flows.GetFlowValidationResult]. - retry (google.api_core.retry.Retry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. @@ -1144,7 +1139,6 @@ def __call__( request (~.flow.ImportFlowRequest): The request object. The request message for [Flows.ImportFlow][google.cloud.dialogflow.cx.v3.Flows.ImportFlow]. - retry (google.api_core.retry.Retry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. @@ -1242,7 +1236,6 @@ def __call__( request (~.flow.ListFlowsRequest): The request object. The request message for [Flows.ListFlows][google.cloud.dialogflow.cx.v3.Flows.ListFlows]. - retry (google.api_core.retry.Retry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. @@ -1332,7 +1325,6 @@ def __call__( request (~.flow.TrainFlowRequest): The request object. The request message for [Flows.TrainFlow][google.cloud.dialogflow.cx.v3.Flows.TrainFlow]. - retry (google.api_core.retry.Retry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. @@ -1430,7 +1422,6 @@ def __call__( request (~.gcdc_flow.UpdateFlowRequest): The request object. The request message for [Flows.UpdateFlow][google.cloud.dialogflow.cx.v3.Flows.UpdateFlow]. - retry (google.api_core.retry.Retry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. @@ -1550,7 +1541,6 @@ def __call__( request (~.flow.ValidateFlowRequest): The request object. The request message for [Flows.ValidateFlow][google.cloud.dialogflow.cx.v3.Flows.ValidateFlow]. - retry (google.api_core.retry.Retry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. diff --git a/google/cloud/dialogflowcx_v3/services/intents/transports/rest.py b/google/cloud/dialogflowcx_v3/services/intents/transports/rest.py index 768912ea..9c293f01 100644 --- a/google/cloud/dialogflowcx_v3/services/intents/transports/rest.py +++ b/google/cloud/dialogflowcx_v3/services/intents/transports/rest.py @@ -443,7 +443,6 @@ def __call__( request (~.gcdc_intent.CreateIntentRequest): The request object. The request message for [Intents.CreateIntent][google.cloud.dialogflow.cx.v3.Intents.CreateIntent]. - retry (google.api_core.retry.Retry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. @@ -547,7 +546,6 @@ def __call__( request (~.intent.DeleteIntentRequest): The request object. The request message for [Intents.DeleteIntent][google.cloud.dialogflow.cx.v3.Intents.DeleteIntent]. - retry (google.api_core.retry.Retry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. @@ -623,7 +621,6 @@ def __call__( request (~.intent.GetIntentRequest): The request object. The request message for [Intents.GetIntent][google.cloud.dialogflow.cx.v3.Intents.GetIntent]. - retry (google.api_core.retry.Retry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. @@ -718,7 +715,6 @@ def __call__( request (~.intent.ListIntentsRequest): The request object. The request message for [Intents.ListIntents][google.cloud.dialogflow.cx.v3.Intents.ListIntents]. - retry (google.api_core.retry.Retry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. @@ -808,7 +804,6 @@ def __call__( request (~.gcdc_intent.UpdateIntentRequest): The request object. The request message for [Intents.UpdateIntent][google.cloud.dialogflow.cx.v3.Intents.UpdateIntent]. - retry (google.api_core.retry.Retry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. diff --git a/google/cloud/dialogflowcx_v3/services/pages/transports/rest.py b/google/cloud/dialogflowcx_v3/services/pages/transports/rest.py index 34c6ef01..50da6531 100644 --- a/google/cloud/dialogflowcx_v3/services/pages/transports/rest.py +++ b/google/cloud/dialogflowcx_v3/services/pages/transports/rest.py @@ -438,7 +438,6 @@ def __call__( request (~.gcdc_page.CreatePageRequest): The request object. The request message for [Pages.CreatePage][google.cloud.dialogflow.cx.v3.Pages.CreatePage]. - retry (google.api_core.retry.Retry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. @@ -556,7 +555,6 @@ def __call__( request (~.page.DeletePageRequest): The request object. The request message for [Pages.DeletePage][google.cloud.dialogflow.cx.v3.Pages.DeletePage]. - retry (google.api_core.retry.Retry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. @@ -632,7 +630,6 @@ def __call__( request (~.page.GetPageRequest): The request object. The request message for [Pages.GetPage][google.cloud.dialogflow.cx.v3.Pages.GetPage]. - retry (google.api_core.retry.Retry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. @@ -741,7 +738,6 @@ def __call__( request (~.page.ListPagesRequest): The request object. The request message for [Pages.ListPages][google.cloud.dialogflow.cx.v3.Pages.ListPages]. - retry (google.api_core.retry.Retry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. @@ -831,7 +827,6 @@ def __call__( request (~.gcdc_page.UpdatePageRequest): The request object. The request message for [Pages.UpdatePage][google.cloud.dialogflow.cx.v3.Pages.UpdatePage]. - retry (google.api_core.retry.Retry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. diff --git a/google/cloud/dialogflowcx_v3/services/security_settings_service/transports/rest.py b/google/cloud/dialogflowcx_v3/services/security_settings_service/transports/rest.py index 47a86abb..e8d46904 100644 --- a/google/cloud/dialogflowcx_v3/services/security_settings_service/transports/rest.py +++ b/google/cloud/dialogflowcx_v3/services/security_settings_service/transports/rest.py @@ -467,7 +467,6 @@ def __call__( request (~.gcdc_security_settings.CreateSecuritySettingsRequest): The request object. The request message for [SecuritySettings.CreateSecuritySettings][]. - retry (google.api_core.retry.Retry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. @@ -574,7 +573,6 @@ def __call__( request (~.security_settings.DeleteSecuritySettingsRequest): The request object. The request message for [SecuritySettings.DeleteSecuritySettings][]. - retry (google.api_core.retry.Retry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. @@ -652,7 +650,6 @@ def __call__( request (~.security_settings.GetSecuritySettingsRequest): The request object. The request message for [SecuritySettingsService.GetSecuritySettings][google.cloud.dialogflow.cx.v3.SecuritySettingsService.GetSecuritySettings]. - retry (google.api_core.retry.Retry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. @@ -748,7 +745,6 @@ def __call__( request (~.security_settings.ListSecuritySettingsRequest): The request object. The request message for [SecuritySettings.ListSecuritySettings][]. - retry (google.api_core.retry.Retry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. @@ -842,7 +838,6 @@ def __call__( request (~.gcdc_security_settings.UpdateSecuritySettingsRequest): The request object. The request message for [SecuritySettingsService.UpdateSecuritySettings][google.cloud.dialogflow.cx.v3.SecuritySettingsService.UpdateSecuritySettings]. - retry (google.api_core.retry.Retry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. diff --git a/google/cloud/dialogflowcx_v3/services/session_entity_types/transports/rest.py b/google/cloud/dialogflowcx_v3/services/session_entity_types/transports/rest.py index 9139ecbc..b665807c 100644 --- a/google/cloud/dialogflowcx_v3/services/session_entity_types/transports/rest.py +++ b/google/cloud/dialogflowcx_v3/services/session_entity_types/transports/rest.py @@ -473,7 +473,6 @@ def __call__( request (~.gcdc_session_entity_type.CreateSessionEntityTypeRequest): The request object. The request message for [SessionEntityTypes.CreateSessionEntityType][google.cloud.dialogflow.cx.v3.SessionEntityTypes.CreateSessionEntityType]. - retry (google.api_core.retry.Retry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. @@ -597,7 +596,6 @@ def __call__( request (~.session_entity_type.DeleteSessionEntityTypeRequest): The request object. The request message for [SessionEntityTypes.DeleteSessionEntityType][google.cloud.dialogflow.cx.v3.SessionEntityTypes.DeleteSessionEntityType]. - retry (google.api_core.retry.Retry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. @@ -679,7 +677,6 @@ def __call__( request (~.session_entity_type.GetSessionEntityTypeRequest): The request object. The request message for [SessionEntityTypes.GetSessionEntityType][google.cloud.dialogflow.cx.v3.SessionEntityTypes.GetSessionEntityType]. - retry (google.api_core.retry.Retry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. @@ -790,7 +787,6 @@ def __call__( request (~.session_entity_type.ListSessionEntityTypesRequest): The request object. The request message for [SessionEntityTypes.ListSessionEntityTypes][google.cloud.dialogflow.cx.v3.SessionEntityTypes.ListSessionEntityTypes]. - retry (google.api_core.retry.Retry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. @@ -887,7 +883,6 @@ def __call__( request (~.gcdc_session_entity_type.UpdateSessionEntityTypeRequest): The request object. The request message for [SessionEntityTypes.UpdateSessionEntityType][google.cloud.dialogflow.cx.v3.SessionEntityTypes.UpdateSessionEntityType]. - retry (google.api_core.retry.Retry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. diff --git a/google/cloud/dialogflowcx_v3/services/sessions/async_client.py b/google/cloud/dialogflowcx_v3/services/sessions/async_client.py index da5d30f5..9afbf9a8 100644 --- a/google/cloud/dialogflowcx_v3/services/sessions/async_client.py +++ b/google/cloud/dialogflowcx_v3/services/sessions/async_client.py @@ -397,39 +397,42 @@ def request_generator(): Args: requests (AsyncIterator[`google.cloud.dialogflowcx_v3.types.StreamingDetectIntentRequest`]): - The request object AsyncIterator. The top-level message sent by the - client to the + The request object AsyncIterator. The top-level message sent by the client to the [Sessions.StreamingDetectIntent][google.cloud.dialogflow.cx.v3.Sessions.StreamingDetectIntent] method. Multiple request messages should be sent in order: - 1. The first message must contain - [session][google.cloud.dialogflow.cx.v3.StreamingDetectIntentRequest.session], - [query_input][google.cloud.dialogflow.cx.v3.StreamingDetectIntentRequest.query_input] - plus optionally - [query_params][google.cloud.dialogflow.cx.v3.StreamingDetectIntentRequest.query_params]. - If the client wants to receive an audio response, it - should also contain - [output_audio_config][google.cloud.dialogflow.cx.v3.StreamingDetectIntentRequest.output_audio_config]. - 2. If - [query_input][google.cloud.dialogflow.cx.v3.StreamingDetectIntentRequest.query_input] - was set to - [query_input.audio.config][google.cloud.dialogflow.cx.v3.AudioInput.config], - all subsequent messages must contain - [query_input.audio.audio][google.cloud.dialogflow.cx.v3.AudioInput.audio] - to continue with Speech recognition. If you decide to - rather detect an intent from text input after you - already started Speech recognition, please send a - message with - [query_input.text][google.cloud.dialogflow.cx.v3.QueryInput.text]. - However, note that: - - * Dialogflow will bill you for the audio duration so - far. * Dialogflow discards all Speech recognition - results in favor of the input text. - * Dialogflow will use the language code from the - first message. + 1. The first message must contain + [session][google.cloud.dialogflow.cx.v3.StreamingDetectIntentRequest.session], + [query_input][google.cloud.dialogflow.cx.v3.StreamingDetectIntentRequest.query_input] + plus optionally + [query_params][google.cloud.dialogflow.cx.v3.StreamingDetectIntentRequest.query_params]. + If the client wants to receive an audio response, it + should also contain + [output_audio_config][google.cloud.dialogflow.cx.v3.StreamingDetectIntentRequest.output_audio_config]. + + 2. If + [query_input][google.cloud.dialogflow.cx.v3.StreamingDetectIntentRequest.query_input] + was set to + [query_input.audio.config][google.cloud.dialogflow.cx.v3.AudioInput.config], + all subsequent messages must contain + [query_input.audio.audio][google.cloud.dialogflow.cx.v3.AudioInput.audio] + to continue with Speech recognition. If you decide to + rather detect an intent from text input after you + already started Speech recognition, please send a + message with + [query_input.text][google.cloud.dialogflow.cx.v3.QueryInput.text]. + + However, note that: + + - Dialogflow will bill you for the audio duration so + far. + - Dialogflow discards all Speech recognition results + in favor of the input text. + - Dialogflow will use the language code from the + first message. + After you sent all input, you must half-close or abort the request stream. retry (google.api_core.retry.Retry): Designation of what errors, if any, diff --git a/google/cloud/dialogflowcx_v3/services/sessions/client.py b/google/cloud/dialogflowcx_v3/services/sessions/client.py index 3339b728..5283a926 100644 --- a/google/cloud/dialogflowcx_v3/services/sessions/client.py +++ b/google/cloud/dialogflowcx_v3/services/sessions/client.py @@ -803,39 +803,42 @@ def request_generator(): Args: requests (Iterator[google.cloud.dialogflowcx_v3.types.StreamingDetectIntentRequest]): - The request object iterator. The top-level message sent by the - client to the + The request object iterator. The top-level message sent by the client to the [Sessions.StreamingDetectIntent][google.cloud.dialogflow.cx.v3.Sessions.StreamingDetectIntent] method. Multiple request messages should be sent in order: - 1. The first message must contain - [session][google.cloud.dialogflow.cx.v3.StreamingDetectIntentRequest.session], - [query_input][google.cloud.dialogflow.cx.v3.StreamingDetectIntentRequest.query_input] - plus optionally - [query_params][google.cloud.dialogflow.cx.v3.StreamingDetectIntentRequest.query_params]. - If the client wants to receive an audio response, it - should also contain - [output_audio_config][google.cloud.dialogflow.cx.v3.StreamingDetectIntentRequest.output_audio_config]. - 2. If - [query_input][google.cloud.dialogflow.cx.v3.StreamingDetectIntentRequest.query_input] - was set to - [query_input.audio.config][google.cloud.dialogflow.cx.v3.AudioInput.config], - all subsequent messages must contain - [query_input.audio.audio][google.cloud.dialogflow.cx.v3.AudioInput.audio] - to continue with Speech recognition. If you decide to - rather detect an intent from text input after you - already started Speech recognition, please send a - message with - [query_input.text][google.cloud.dialogflow.cx.v3.QueryInput.text]. - However, note that: - - * Dialogflow will bill you for the audio duration so - far. * Dialogflow discards all Speech recognition - results in favor of the input text. - * Dialogflow will use the language code from the - first message. + 1. The first message must contain + [session][google.cloud.dialogflow.cx.v3.StreamingDetectIntentRequest.session], + [query_input][google.cloud.dialogflow.cx.v3.StreamingDetectIntentRequest.query_input] + plus optionally + [query_params][google.cloud.dialogflow.cx.v3.StreamingDetectIntentRequest.query_params]. + If the client wants to receive an audio response, it + should also contain + [output_audio_config][google.cloud.dialogflow.cx.v3.StreamingDetectIntentRequest.output_audio_config]. + + 2. If + [query_input][google.cloud.dialogflow.cx.v3.StreamingDetectIntentRequest.query_input] + was set to + [query_input.audio.config][google.cloud.dialogflow.cx.v3.AudioInput.config], + all subsequent messages must contain + [query_input.audio.audio][google.cloud.dialogflow.cx.v3.AudioInput.audio] + to continue with Speech recognition. If you decide to + rather detect an intent from text input after you + already started Speech recognition, please send a + message with + [query_input.text][google.cloud.dialogflow.cx.v3.QueryInput.text]. + + However, note that: + + - Dialogflow will bill you for the audio duration so + far. + - Dialogflow discards all Speech recognition results + in favor of the input text. + - Dialogflow will use the language code from the + first message. + After you sent all input, you must half-close or abort the request stream. retry (google.api_core.retry.Retry): Designation of what errors, if any, diff --git a/google/cloud/dialogflowcx_v3/services/test_cases/transports/rest.py b/google/cloud/dialogflowcx_v3/services/test_cases/transports/rest.py index 8bd0f4ed..63bc4f76 100644 --- a/google/cloud/dialogflowcx_v3/services/test_cases/transports/rest.py +++ b/google/cloud/dialogflowcx_v3/services/test_cases/transports/rest.py @@ -728,7 +728,6 @@ def __call__( request (~.test_case.BatchDeleteTestCasesRequest): The request object. The request message for [TestCases.BatchDeleteTestCases][google.cloud.dialogflow.cx.v3.TestCases.BatchDeleteTestCases]. - retry (google.api_core.retry.Retry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. @@ -815,7 +814,6 @@ def __call__( request (~.test_case.BatchRunTestCasesRequest): The request object. The request message for [TestCases.BatchRunTestCases][google.cloud.dialogflow.cx.v3.TestCases.BatchRunTestCases]. - retry (google.api_core.retry.Retry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. @@ -917,7 +915,6 @@ def __call__( request (~.test_case.CalculateCoverageRequest): The request object. The request message for [TestCases.CalculateCoverage][google.cloud.dialogflow.cx.v3.TestCases.CalculateCoverage]. - retry (google.api_core.retry.Retry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. @@ -1009,7 +1006,6 @@ def __call__( request (~.gcdc_test_case.CreateTestCaseRequest): The request object. The request message for [TestCases.CreateTestCase][google.cloud.dialogflow.cx.v3.TestCases.CreateTestCase]. - retry (google.api_core.retry.Retry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. @@ -1108,7 +1104,6 @@ def __call__( request (~.test_case.ExportTestCasesRequest): The request object. The request message for [TestCases.ExportTestCases][google.cloud.dialogflow.cx.v3.TestCases.ExportTestCases]. - retry (google.api_core.retry.Retry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. @@ -1208,7 +1203,6 @@ def __call__( request (~.test_case.GetTestCaseRequest): The request object. The request message for [TestCases.GetTestCase][google.cloud.dialogflow.cx.v3.TestCases.GetTestCase]. - retry (google.api_core.retry.Retry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. @@ -1296,7 +1290,6 @@ def __call__( request (~.test_case.GetTestCaseResultRequest): The request object. The request message for [TestCases.GetTestCaseResult][google.cloud.dialogflow.cx.v3.TestCases.GetTestCaseResult]. - retry (google.api_core.retry.Retry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. @@ -1388,7 +1381,6 @@ def __call__( request (~.test_case.ImportTestCasesRequest): The request object. The request message for [TestCases.ImportTestCases][google.cloud.dialogflow.cx.v3.TestCases.ImportTestCases]. - retry (google.api_core.retry.Retry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. @@ -1488,7 +1480,6 @@ def __call__( request (~.test_case.ListTestCaseResultsRequest): The request object. The request message for [TestCases.ListTestCaseResults][google.cloud.dialogflow.cx.v3.TestCases.ListTestCaseResults]. - retry (google.api_core.retry.Retry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. @@ -1580,7 +1571,6 @@ def __call__( request (~.test_case.ListTestCasesRequest): The request object. The request message for [TestCases.ListTestCases][google.cloud.dialogflow.cx.v3.TestCases.ListTestCases]. - retry (google.api_core.retry.Retry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. @@ -1670,7 +1660,6 @@ def __call__( request (~.test_case.RunTestCaseRequest): The request object. The request message for [TestCases.RunTestCase][google.cloud.dialogflow.cx.v3.TestCases.RunTestCase]. - retry (google.api_core.retry.Retry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. @@ -1770,7 +1759,6 @@ def __call__( request (~.gcdc_test_case.UpdateTestCaseRequest): The request object. The request message for [TestCases.UpdateTestCase][google.cloud.dialogflow.cx.v3.TestCases.UpdateTestCase]. - retry (google.api_core.retry.Retry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. diff --git a/google/cloud/dialogflowcx_v3/services/transition_route_groups/transports/rest.py b/google/cloud/dialogflowcx_v3/services/transition_route_groups/transports/rest.py index fe8864f9..939b97ef 100644 --- a/google/cloud/dialogflowcx_v3/services/transition_route_groups/transports/rest.py +++ b/google/cloud/dialogflowcx_v3/services/transition_route_groups/transports/rest.py @@ -475,7 +475,6 @@ def __call__( request (~.gcdc_transition_route_group.CreateTransitionRouteGroupRequest): The request object. The request message for [TransitionRouteGroups.CreateTransitionRouteGroup][google.cloud.dialogflow.cx.v3.TransitionRouteGroups.CreateTransitionRouteGroup]. - retry (google.api_core.retry.Retry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. @@ -583,7 +582,6 @@ def __call__( request (~.transition_route_group.DeleteTransitionRouteGroupRequest): The request object. The request message for [TransitionRouteGroups.DeleteTransitionRouteGroup][google.cloud.dialogflow.cx.v3.TransitionRouteGroups.DeleteTransitionRouteGroup]. - retry (google.api_core.retry.Retry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. @@ -664,7 +662,6 @@ def __call__( request (~.transition_route_group.GetTransitionRouteGroupRequest): The request object. The request message for [TransitionRouteGroups.GetTransitionRouteGroup][google.cloud.dialogflow.cx.v3.TransitionRouteGroups.GetTransitionRouteGroup]. - retry (google.api_core.retry.Retry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. @@ -761,7 +758,6 @@ def __call__( request (~.transition_route_group.ListTransitionRouteGroupsRequest): The request object. The request message for [TransitionRouteGroups.ListTransitionRouteGroups][google.cloud.dialogflow.cx.v3.TransitionRouteGroups.ListTransitionRouteGroups]. - retry (google.api_core.retry.Retry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. @@ -856,7 +852,6 @@ def __call__( request (~.gcdc_transition_route_group.UpdateTransitionRouteGroupRequest): The request object. The request message for [TransitionRouteGroups.UpdateTransitionRouteGroup][google.cloud.dialogflow.cx.v3.TransitionRouteGroups.UpdateTransitionRouteGroup]. - retry (google.api_core.retry.Retry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. diff --git a/google/cloud/dialogflowcx_v3/services/versions/transports/rest.py b/google/cloud/dialogflowcx_v3/services/versions/transports/rest.py index cefc398b..0fbecd05 100644 --- a/google/cloud/dialogflowcx_v3/services/versions/transports/rest.py +++ b/google/cloud/dialogflowcx_v3/services/versions/transports/rest.py @@ -568,7 +568,6 @@ def __call__( request (~.version.CompareVersionsRequest): The request object. The request message for [Versions.CompareVersions][google.cloud.dialogflow.cx.v3.Versions.CompareVersions]. - retry (google.api_core.retry.Retry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. @@ -669,7 +668,6 @@ def __call__( request (~.gcdc_version.CreateVersionRequest): The request object. The request message for [Versions.CreateVersion][google.cloud.dialogflow.cx.v3.Versions.CreateVersion]. - retry (google.api_core.retry.Retry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. @@ -767,7 +765,6 @@ def __call__( request (~.version.DeleteVersionRequest): The request object. The request message for [Versions.DeleteVersion][google.cloud.dialogflow.cx.v3.Versions.DeleteVersion]. - retry (google.api_core.retry.Retry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. @@ -843,7 +840,6 @@ def __call__( request (~.version.GetVersionRequest): The request object. The request message for [Versions.GetVersion][google.cloud.dialogflow.cx.v3.Versions.GetVersion]. - retry (google.api_core.retry.Retry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. @@ -931,7 +927,6 @@ def __call__( request (~.version.ListVersionsRequest): The request object. The request message for [Versions.ListVersions][google.cloud.dialogflow.cx.v3.Versions.ListVersions]. - retry (google.api_core.retry.Retry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. @@ -1021,7 +1016,6 @@ def __call__( request (~.version.LoadVersionRequest): The request object. The request message for [Versions.LoadVersion][google.cloud.dialogflow.cx.v3.Versions.LoadVersion]. - retry (google.api_core.retry.Retry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. @@ -1121,7 +1115,6 @@ def __call__( request (~.gcdc_version.UpdateVersionRequest): The request object. The request message for [Versions.UpdateVersion][google.cloud.dialogflow.cx.v3.Versions.UpdateVersion]. - retry (google.api_core.retry.Retry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. diff --git a/google/cloud/dialogflowcx_v3/services/webhooks/transports/rest.py b/google/cloud/dialogflowcx_v3/services/webhooks/transports/rest.py index 63c09dbd..d1c113fb 100644 --- a/google/cloud/dialogflowcx_v3/services/webhooks/transports/rest.py +++ b/google/cloud/dialogflowcx_v3/services/webhooks/transports/rest.py @@ -447,7 +447,6 @@ def __call__( request (~.gcdc_webhook.CreateWebhookRequest): The request object. The request message for [Webhooks.CreateWebhook][google.cloud.dialogflow.cx.v3.Webhooks.CreateWebhook]. - retry (google.api_core.retry.Retry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. @@ -551,7 +550,6 @@ def __call__( request (~.webhook.DeleteWebhookRequest): The request object. The request message for [Webhooks.DeleteWebhook][google.cloud.dialogflow.cx.v3.Webhooks.DeleteWebhook]. - retry (google.api_core.retry.Retry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. @@ -627,7 +625,6 @@ def __call__( request (~.webhook.GetWebhookRequest): The request object. The request message for [Webhooks.GetWebhook][google.cloud.dialogflow.cx.v3.Webhooks.GetWebhook]. - retry (google.api_core.retry.Retry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. @@ -722,7 +719,6 @@ def __call__( request (~.webhook.ListWebhooksRequest): The request object. The request message for [Webhooks.ListWebhooks][google.cloud.dialogflow.cx.v3.Webhooks.ListWebhooks]. - retry (google.api_core.retry.Retry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. @@ -812,7 +808,6 @@ def __call__( request (~.gcdc_webhook.UpdateWebhookRequest): The request object. The request message for [Webhooks.UpdateWebhook][google.cloud.dialogflow.cx.v3.Webhooks.UpdateWebhook]. - retry (google.api_core.retry.Retry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. diff --git a/google/cloud/dialogflowcx_v3beta1/services/agents/transports/rest.py b/google/cloud/dialogflowcx_v3beta1/services/agents/transports/rest.py index a4aa2fe1..469560ac 100644 --- a/google/cloud/dialogflowcx_v3beta1/services/agents/transports/rest.py +++ b/google/cloud/dialogflowcx_v3beta1/services/agents/transports/rest.py @@ -622,7 +622,6 @@ def __call__( request (~.gcdc_agent.CreateAgentRequest): The request object. The request message for [Agents.CreateAgent][google.cloud.dialogflow.cx.v3beta1.Agents.CreateAgent]. - retry (google.api_core.retry.Retry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. @@ -733,7 +732,6 @@ def __call__( request (~.agent.DeleteAgentRequest): The request object. The request message for [Agents.DeleteAgent][google.cloud.dialogflow.cx.v3beta1.Agents.DeleteAgent]. - retry (google.api_core.retry.Retry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. @@ -809,7 +807,6 @@ def __call__( request (~.agent.ExportAgentRequest): The request object. The request message for [Agents.ExportAgent][google.cloud.dialogflow.cx.v3beta1.Agents.ExportAgent]. - retry (google.api_core.retry.Retry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. @@ -907,7 +904,6 @@ def __call__( request (~.agent.GetAgentRequest): The request object. The request message for [Agents.GetAgent][google.cloud.dialogflow.cx.v3beta1.Agents.GetAgent]. - retry (google.api_core.retry.Retry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. @@ -1010,7 +1006,6 @@ def __call__( request (~.agent.GetAgentValidationResultRequest): The request object. The request message for [Agents.GetAgentValidationResult][google.cloud.dialogflow.cx.v3beta1.Agents.GetAgentValidationResult]. - retry (google.api_core.retry.Retry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. @@ -1102,7 +1097,6 @@ def __call__( request (~.agent.ListAgentsRequest): The request object. The request message for [Agents.ListAgents][google.cloud.dialogflow.cx.v3beta1.Agents.ListAgents]. - retry (google.api_core.retry.Retry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. @@ -1192,7 +1186,6 @@ def __call__( request (~.agent.RestoreAgentRequest): The request object. The request message for [Agents.RestoreAgent][google.cloud.dialogflow.cx.v3beta1.Agents.RestoreAgent]. - retry (google.api_core.retry.Retry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. @@ -1290,7 +1283,6 @@ def __call__( request (~.gcdc_agent.UpdateAgentRequest): The request object. The request message for [Agents.UpdateAgent][google.cloud.dialogflow.cx.v3beta1.Agents.UpdateAgent]. - retry (google.api_core.retry.Retry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. @@ -1401,7 +1393,6 @@ def __call__( request (~.agent.ValidateAgentRequest): The request object. The request message for [Agents.ValidateAgent][google.cloud.dialogflow.cx.v3beta1.Agents.ValidateAgent]. - retry (google.api_core.retry.Retry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. diff --git a/google/cloud/dialogflowcx_v3beta1/services/changelogs/transports/rest.py b/google/cloud/dialogflowcx_v3beta1/services/changelogs/transports/rest.py index 693a5981..8dd85a68 100644 --- a/google/cloud/dialogflowcx_v3beta1/services/changelogs/transports/rest.py +++ b/google/cloud/dialogflowcx_v3beta1/services/changelogs/transports/rest.py @@ -373,7 +373,6 @@ def __call__( request (~.changelog.GetChangelogRequest): The request object. The request message for [Changelogs.GetChangelog][google.cloud.dialogflow.cx.v3beta1.Changelogs.GetChangelog]. - retry (google.api_core.retry.Retry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. @@ -463,7 +462,6 @@ def __call__( request (~.changelog.ListChangelogsRequest): The request object. The request message for [Changelogs.ListChangelogs][google.cloud.dialogflow.cx.v3beta1.Changelogs.ListChangelogs]. - retry (google.api_core.retry.Retry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. diff --git a/google/cloud/dialogflowcx_v3beta1/services/deployments/transports/rest.py b/google/cloud/dialogflowcx_v3beta1/services/deployments/transports/rest.py index 6a40b0b8..7775b170 100644 --- a/google/cloud/dialogflowcx_v3beta1/services/deployments/transports/rest.py +++ b/google/cloud/dialogflowcx_v3beta1/services/deployments/transports/rest.py @@ -375,7 +375,6 @@ def __call__( request (~.deployment.GetDeploymentRequest): The request object. The request message for [Deployments.GetDeployment][google.cloud.dialogflow.cx.v3beta1.Deployments.GetDeployment]. - retry (google.api_core.retry.Retry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. @@ -470,7 +469,6 @@ def __call__( request (~.deployment.ListDeploymentsRequest): The request object. The request message for [Deployments.ListDeployments][google.cloud.dialogflow.cx.v3beta1.Deployments.ListDeployments]. - retry (google.api_core.retry.Retry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. diff --git a/google/cloud/dialogflowcx_v3beta1/services/entity_types/transports/rest.py b/google/cloud/dialogflowcx_v3beta1/services/entity_types/transports/rest.py index 147cc1d6..a273345e 100644 --- a/google/cloud/dialogflowcx_v3beta1/services/entity_types/transports/rest.py +++ b/google/cloud/dialogflowcx_v3beta1/services/entity_types/transports/rest.py @@ -455,7 +455,6 @@ def __call__( request (~.gcdc_entity_type.CreateEntityTypeRequest): The request object. The request message for [EntityTypes.CreateEntityType][google.cloud.dialogflow.cx.v3beta1.EntityTypes.CreateEntityType]. - retry (google.api_core.retry.Retry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. @@ -589,7 +588,6 @@ def __call__( request (~.entity_type.DeleteEntityTypeRequest): The request object. The request message for [EntityTypes.DeleteEntityType][google.cloud.dialogflow.cx.v3beta1.EntityTypes.DeleteEntityType]. - retry (google.api_core.retry.Retry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. @@ -667,7 +665,6 @@ def __call__( request (~.entity_type.GetEntityTypeRequest): The request object. The request message for [EntityTypes.GetEntityType][google.cloud.dialogflow.cx.v3beta1.EntityTypes.GetEntityType]. - retry (google.api_core.retry.Retry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. @@ -790,7 +787,6 @@ def __call__( request (~.entity_type.ListEntityTypesRequest): The request object. The request message for [EntityTypes.ListEntityTypes][google.cloud.dialogflow.cx.v3beta1.EntityTypes.ListEntityTypes]. - retry (google.api_core.retry.Retry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. @@ -882,7 +878,6 @@ def __call__( request (~.gcdc_entity_type.UpdateEntityTypeRequest): The request object. The request message for [EntityTypes.UpdateEntityType][google.cloud.dialogflow.cx.v3beta1.EntityTypes.UpdateEntityType]. - retry (google.api_core.retry.Retry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. diff --git a/google/cloud/dialogflowcx_v3beta1/services/environments/transports/rest.py b/google/cloud/dialogflowcx_v3beta1/services/environments/transports/rest.py index 5385c324..6c3c70ab 100644 --- a/google/cloud/dialogflowcx_v3beta1/services/environments/transports/rest.py +++ b/google/cloud/dialogflowcx_v3beta1/services/environments/transports/rest.py @@ -640,7 +640,6 @@ def __call__( request (~.gcdc_environment.CreateEnvironmentRequest): The request object. The request message for [Environments.CreateEnvironment][google.cloud.dialogflow.cx.v3beta1.Environments.CreateEnvironment]. - retry (google.api_core.retry.Retry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. @@ -740,7 +739,6 @@ def __call__( request (~.environment.DeleteEnvironmentRequest): The request object. The request message for [Environments.DeleteEnvironment][google.cloud.dialogflow.cx.v3beta1.Environments.DeleteEnvironment]. - retry (google.api_core.retry.Retry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. @@ -818,7 +816,6 @@ def __call__( request (~.environment.DeployFlowRequest): The request object. The request message for [Environments.DeployFlow][google.cloud.dialogflow.cx.v3beta1.Environments.DeployFlow]. - retry (google.api_core.retry.Retry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. @@ -916,7 +913,6 @@ def __call__( request (~.environment.GetEnvironmentRequest): The request object. The request message for [Environments.GetEnvironment][google.cloud.dialogflow.cx.v3beta1.Environments.GetEnvironment]. - retry (google.api_core.retry.Retry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. @@ -1020,7 +1016,6 @@ def __call__( request (~.environment.ListContinuousTestResultsRequest): The request object. The request message for [Environments.ListContinuousTestResults][google.cloud.dialogflow.cx.v3beta1.Environments.ListContinuousTestResults]. - retry (google.api_core.retry.Retry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. @@ -1112,7 +1107,6 @@ def __call__( request (~.environment.ListEnvironmentsRequest): The request object. The request message for [Environments.ListEnvironments][google.cloud.dialogflow.cx.v3beta1.Environments.ListEnvironments]. - retry (google.api_core.retry.Retry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. @@ -1205,7 +1199,6 @@ def __call__( request (~.environment.LookupEnvironmentHistoryRequest): The request object. The request message for [Environments.LookupEnvironmentHistory][google.cloud.dialogflow.cx.v3beta1.Environments.LookupEnvironmentHistory]. - retry (google.api_core.retry.Retry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. @@ -1297,7 +1290,6 @@ def __call__( request (~.environment.RunContinuousTestRequest): The request object. The request message for [Environments.RunContinuousTest][google.cloud.dialogflow.cx.v3beta1.Environments.RunContinuousTest]. - retry (google.api_core.retry.Retry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. @@ -1399,7 +1391,6 @@ def __call__( request (~.gcdc_environment.UpdateEnvironmentRequest): The request object. The request message for [Environments.UpdateEnvironment][google.cloud.dialogflow.cx.v3beta1.Environments.UpdateEnvironment]. - retry (google.api_core.retry.Retry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. diff --git a/google/cloud/dialogflowcx_v3beta1/services/experiments/transports/rest.py b/google/cloud/dialogflowcx_v3beta1/services/experiments/transports/rest.py index 0477a862..cbcc8c0a 100644 --- a/google/cloud/dialogflowcx_v3beta1/services/experiments/transports/rest.py +++ b/google/cloud/dialogflowcx_v3beta1/services/experiments/transports/rest.py @@ -517,7 +517,6 @@ def __call__( request (~.gcdc_experiment.CreateExperimentRequest): The request object. The request message for [Experiments.CreateExperiment][google.cloud.dialogflow.cx.v3beta1.Experiments.CreateExperiment]. - retry (google.api_core.retry.Retry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. @@ -618,7 +617,6 @@ def __call__( request (~.experiment.DeleteExperimentRequest): The request object. The request message for [Experiments.DeleteExperiment][google.cloud.dialogflow.cx.v3beta1.Experiments.DeleteExperiment]. - retry (google.api_core.retry.Retry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. @@ -696,7 +694,6 @@ def __call__( request (~.experiment.GetExperimentRequest): The request object. The request message for [Experiments.GetExperiment][google.cloud.dialogflow.cx.v3beta1.Experiments.GetExperiment]. - retry (google.api_core.retry.Retry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. @@ -786,7 +783,6 @@ def __call__( request (~.experiment.ListExperimentsRequest): The request object. The request message for [Experiments.ListExperiments][google.cloud.dialogflow.cx.v3beta1.Experiments.ListExperiments]. - retry (google.api_core.retry.Retry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. @@ -878,7 +874,6 @@ def __call__( request (~.experiment.StartExperimentRequest): The request object. The request message for [Experiments.StartExperiment][google.cloud.dialogflow.cx.v3beta1.Experiments.StartExperiment]. - retry (google.api_core.retry.Retry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. @@ -979,7 +974,6 @@ def __call__( request (~.experiment.StopExperimentRequest): The request object. The request message for [Experiments.StopExperiment][google.cloud.dialogflow.cx.v3beta1.Experiments.StopExperiment]. - retry (google.api_core.retry.Retry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. @@ -1080,7 +1074,6 @@ def __call__( request (~.gcdc_experiment.UpdateExperimentRequest): The request object. The request message for [Experiments.UpdateExperiment][google.cloud.dialogflow.cx.v3beta1.Experiments.UpdateExperiment]. - retry (google.api_core.retry.Retry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. diff --git a/google/cloud/dialogflowcx_v3beta1/services/flows/transports/rest.py b/google/cloud/dialogflowcx_v3beta1/services/flows/transports/rest.py index efba88cb..7138c600 100644 --- a/google/cloud/dialogflowcx_v3beta1/services/flows/transports/rest.py +++ b/google/cloud/dialogflowcx_v3beta1/services/flows/transports/rest.py @@ -647,7 +647,6 @@ def __call__( request (~.gcdc_flow.CreateFlowRequest): The request object. The request message for [Flows.CreateFlow][google.cloud.dialogflow.cx.v3beta1.Flows.CreateFlow]. - retry (google.api_core.retry.Retry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. @@ -767,7 +766,6 @@ def __call__( request (~.flow.DeleteFlowRequest): The request object. The request message for [Flows.DeleteFlow][google.cloud.dialogflow.cx.v3beta1.Flows.DeleteFlow]. - retry (google.api_core.retry.Retry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. @@ -843,7 +841,6 @@ def __call__( request (~.flow.ExportFlowRequest): The request object. The request message for [Flows.ExportFlow][google.cloud.dialogflow.cx.v3beta1.Flows.ExportFlow]. - retry (google.api_core.retry.Retry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. @@ -941,7 +938,6 @@ def __call__( request (~.flow.GetFlowRequest): The request object. The response message for [Flows.GetFlow][google.cloud.dialogflow.cx.v3beta1.Flows.GetFlow]. - retry (google.api_core.retry.Retry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. @@ -1053,7 +1049,6 @@ def __call__( request (~.flow.GetFlowValidationResultRequest): The request object. The request message for [Flows.GetFlowValidationResult][google.cloud.dialogflow.cx.v3beta1.Flows.GetFlowValidationResult]. - retry (google.api_core.retry.Retry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. @@ -1145,7 +1140,6 @@ def __call__( request (~.flow.ImportFlowRequest): The request object. The request message for [Flows.ImportFlow][google.cloud.dialogflow.cx.v3beta1.Flows.ImportFlow]. - retry (google.api_core.retry.Retry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. @@ -1243,7 +1237,6 @@ def __call__( request (~.flow.ListFlowsRequest): The request object. The request message for [Flows.ListFlows][google.cloud.dialogflow.cx.v3beta1.Flows.ListFlows]. - retry (google.api_core.retry.Retry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. @@ -1333,7 +1326,6 @@ def __call__( request (~.flow.TrainFlowRequest): The request object. The request message for [Flows.TrainFlow][google.cloud.dialogflow.cx.v3beta1.Flows.TrainFlow]. - retry (google.api_core.retry.Retry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. @@ -1431,7 +1423,6 @@ def __call__( request (~.gcdc_flow.UpdateFlowRequest): The request object. The request message for [Flows.UpdateFlow][google.cloud.dialogflow.cx.v3beta1.Flows.UpdateFlow]. - retry (google.api_core.retry.Retry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. @@ -1551,7 +1542,6 @@ def __call__( request (~.flow.ValidateFlowRequest): The request object. The request message for [Flows.ValidateFlow][google.cloud.dialogflow.cx.v3beta1.Flows.ValidateFlow]. - retry (google.api_core.retry.Retry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. diff --git a/google/cloud/dialogflowcx_v3beta1/services/intents/transports/rest.py b/google/cloud/dialogflowcx_v3beta1/services/intents/transports/rest.py index b793a934..8f3be852 100644 --- a/google/cloud/dialogflowcx_v3beta1/services/intents/transports/rest.py +++ b/google/cloud/dialogflowcx_v3beta1/services/intents/transports/rest.py @@ -443,7 +443,6 @@ def __call__( request (~.gcdc_intent.CreateIntentRequest): The request object. The request message for [Intents.CreateIntent][google.cloud.dialogflow.cx.v3beta1.Intents.CreateIntent]. - retry (google.api_core.retry.Retry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. @@ -547,7 +546,6 @@ def __call__( request (~.intent.DeleteIntentRequest): The request object. The request message for [Intents.DeleteIntent][google.cloud.dialogflow.cx.v3beta1.Intents.DeleteIntent]. - retry (google.api_core.retry.Retry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. @@ -623,7 +621,6 @@ def __call__( request (~.intent.GetIntentRequest): The request object. The request message for [Intents.GetIntent][google.cloud.dialogflow.cx.v3beta1.Intents.GetIntent]. - retry (google.api_core.retry.Retry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. @@ -718,7 +715,6 @@ def __call__( request (~.intent.ListIntentsRequest): The request object. The request message for [Intents.ListIntents][google.cloud.dialogflow.cx.v3beta1.Intents.ListIntents]. - retry (google.api_core.retry.Retry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. @@ -808,7 +804,6 @@ def __call__( request (~.gcdc_intent.UpdateIntentRequest): The request object. The request message for [Intents.UpdateIntent][google.cloud.dialogflow.cx.v3beta1.Intents.UpdateIntent]. - retry (google.api_core.retry.Retry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. diff --git a/google/cloud/dialogflowcx_v3beta1/services/pages/transports/rest.py b/google/cloud/dialogflowcx_v3beta1/services/pages/transports/rest.py index 9ee68d25..b563f63b 100644 --- a/google/cloud/dialogflowcx_v3beta1/services/pages/transports/rest.py +++ b/google/cloud/dialogflowcx_v3beta1/services/pages/transports/rest.py @@ -439,7 +439,6 @@ def __call__( request (~.gcdc_page.CreatePageRequest): The request object. The request message for [Pages.CreatePage][google.cloud.dialogflow.cx.v3beta1.Pages.CreatePage]. - retry (google.api_core.retry.Retry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. @@ -557,7 +556,6 @@ def __call__( request (~.page.DeletePageRequest): The request object. The request message for [Pages.DeletePage][google.cloud.dialogflow.cx.v3beta1.Pages.DeletePage]. - retry (google.api_core.retry.Retry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. @@ -633,7 +631,6 @@ def __call__( request (~.page.GetPageRequest): The request object. The request message for [Pages.GetPage][google.cloud.dialogflow.cx.v3beta1.Pages.GetPage]. - retry (google.api_core.retry.Retry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. @@ -742,7 +739,6 @@ def __call__( request (~.page.ListPagesRequest): The request object. The request message for [Pages.ListPages][google.cloud.dialogflow.cx.v3beta1.Pages.ListPages]. - retry (google.api_core.retry.Retry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. @@ -832,7 +828,6 @@ def __call__( request (~.gcdc_page.UpdatePageRequest): The request object. The request message for [Pages.UpdatePage][google.cloud.dialogflow.cx.v3beta1.Pages.UpdatePage]. - retry (google.api_core.retry.Retry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. diff --git a/google/cloud/dialogflowcx_v3beta1/services/security_settings_service/transports/rest.py b/google/cloud/dialogflowcx_v3beta1/services/security_settings_service/transports/rest.py index bc1a087c..c9eaf0a4 100644 --- a/google/cloud/dialogflowcx_v3beta1/services/security_settings_service/transports/rest.py +++ b/google/cloud/dialogflowcx_v3beta1/services/security_settings_service/transports/rest.py @@ -467,7 +467,6 @@ def __call__( request (~.gcdc_security_settings.CreateSecuritySettingsRequest): The request object. The request message for [SecuritySettings.CreateSecuritySettings][]. - retry (google.api_core.retry.Retry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. @@ -574,7 +573,6 @@ def __call__( request (~.security_settings.DeleteSecuritySettingsRequest): The request object. The request message for [SecuritySettings.DeleteSecuritySettings][]. - retry (google.api_core.retry.Retry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. @@ -652,7 +650,6 @@ def __call__( request (~.security_settings.GetSecuritySettingsRequest): The request object. The request message for [SecuritySettingsService.GetSecuritySettings][google.cloud.dialogflow.cx.v3beta1.SecuritySettingsService.GetSecuritySettings]. - retry (google.api_core.retry.Retry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. @@ -748,7 +745,6 @@ def __call__( request (~.security_settings.ListSecuritySettingsRequest): The request object. The request message for [SecuritySettings.ListSecuritySettings][]. - retry (google.api_core.retry.Retry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. @@ -842,7 +838,6 @@ def __call__( request (~.gcdc_security_settings.UpdateSecuritySettingsRequest): The request object. The request message for [SecuritySettingsService.UpdateSecuritySettings][google.cloud.dialogflow.cx.v3beta1.SecuritySettingsService.UpdateSecuritySettings]. - retry (google.api_core.retry.Retry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. diff --git a/google/cloud/dialogflowcx_v3beta1/services/session_entity_types/transports/rest.py b/google/cloud/dialogflowcx_v3beta1/services/session_entity_types/transports/rest.py index 7d7c2f4c..dfb2e5cb 100644 --- a/google/cloud/dialogflowcx_v3beta1/services/session_entity_types/transports/rest.py +++ b/google/cloud/dialogflowcx_v3beta1/services/session_entity_types/transports/rest.py @@ -473,7 +473,6 @@ def __call__( request (~.gcdc_session_entity_type.CreateSessionEntityTypeRequest): The request object. The request message for [SessionEntityTypes.CreateSessionEntityType][google.cloud.dialogflow.cx.v3beta1.SessionEntityTypes.CreateSessionEntityType]. - retry (google.api_core.retry.Retry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. @@ -597,7 +596,6 @@ def __call__( request (~.session_entity_type.DeleteSessionEntityTypeRequest): The request object. The request message for [SessionEntityTypes.DeleteSessionEntityType][google.cloud.dialogflow.cx.v3beta1.SessionEntityTypes.DeleteSessionEntityType]. - retry (google.api_core.retry.Retry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. @@ -679,7 +677,6 @@ def __call__( request (~.session_entity_type.GetSessionEntityTypeRequest): The request object. The request message for [SessionEntityTypes.GetSessionEntityType][google.cloud.dialogflow.cx.v3beta1.SessionEntityTypes.GetSessionEntityType]. - retry (google.api_core.retry.Retry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. @@ -790,7 +787,6 @@ def __call__( request (~.session_entity_type.ListSessionEntityTypesRequest): The request object. The request message for [SessionEntityTypes.ListSessionEntityTypes][google.cloud.dialogflow.cx.v3beta1.SessionEntityTypes.ListSessionEntityTypes]. - retry (google.api_core.retry.Retry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. @@ -887,7 +883,6 @@ def __call__( request (~.gcdc_session_entity_type.UpdateSessionEntityTypeRequest): The request object. The request message for [SessionEntityTypes.UpdateSessionEntityType][google.cloud.dialogflow.cx.v3beta1.SessionEntityTypes.UpdateSessionEntityType]. - retry (google.api_core.retry.Retry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. diff --git a/google/cloud/dialogflowcx_v3beta1/services/sessions/async_client.py b/google/cloud/dialogflowcx_v3beta1/services/sessions/async_client.py index ff4b80e7..0114e9ab 100644 --- a/google/cloud/dialogflowcx_v3beta1/services/sessions/async_client.py +++ b/google/cloud/dialogflowcx_v3beta1/services/sessions/async_client.py @@ -397,39 +397,42 @@ def request_generator(): Args: requests (AsyncIterator[`google.cloud.dialogflowcx_v3beta1.types.StreamingDetectIntentRequest`]): - The request object AsyncIterator. The top-level message sent by the - client to the + The request object AsyncIterator. The top-level message sent by the client to the [Sessions.StreamingDetectIntent][google.cloud.dialogflow.cx.v3beta1.Sessions.StreamingDetectIntent] method. Multiple request messages should be sent in order: - 1. The first message must contain - [session][google.cloud.dialogflow.cx.v3beta1.StreamingDetectIntentRequest.session], - [query_input][google.cloud.dialogflow.cx.v3beta1.StreamingDetectIntentRequest.query_input] - plus optionally - [query_params][google.cloud.dialogflow.cx.v3beta1.StreamingDetectIntentRequest.query_params]. - If the client wants to receive an audio response, it - should also contain - [output_audio_config][google.cloud.dialogflow.cx.v3beta1.StreamingDetectIntentRequest.output_audio_config]. - 2. If - [query_input][google.cloud.dialogflow.cx.v3beta1.StreamingDetectIntentRequest.query_input] - was set to - [query_input.audio.config][google.cloud.dialogflow.cx.v3beta1.AudioInput.config], - all subsequent messages must contain - [query_input.audio.audio][google.cloud.dialogflow.cx.v3beta1.AudioInput.audio] - to continue with Speech recognition. If you decide to - rather detect an intent from text input after you - already started Speech recognition, please send a - message with - [query_input.text][google.cloud.dialogflow.cx.v3beta1.QueryInput.text]. - However, note that: - - * Dialogflow will bill you for the audio duration so - far. * Dialogflow discards all Speech recognition - results in favor of the input text. - * Dialogflow will use the language code from the - first message. + 1. The first message must contain + [session][google.cloud.dialogflow.cx.v3beta1.StreamingDetectIntentRequest.session], + [query_input][google.cloud.dialogflow.cx.v3beta1.StreamingDetectIntentRequest.query_input] + plus optionally + [query_params][google.cloud.dialogflow.cx.v3beta1.StreamingDetectIntentRequest.query_params]. + If the client wants to receive an audio response, it + should also contain + [output_audio_config][google.cloud.dialogflow.cx.v3beta1.StreamingDetectIntentRequest.output_audio_config]. + + 2. If + [query_input][google.cloud.dialogflow.cx.v3beta1.StreamingDetectIntentRequest.query_input] + was set to + [query_input.audio.config][google.cloud.dialogflow.cx.v3beta1.AudioInput.config], + all subsequent messages must contain + [query_input.audio.audio][google.cloud.dialogflow.cx.v3beta1.AudioInput.audio] + to continue with Speech recognition. If you decide to + rather detect an intent from text input after you + already started Speech recognition, please send a + message with + [query_input.text][google.cloud.dialogflow.cx.v3beta1.QueryInput.text]. + + However, note that: + + - Dialogflow will bill you for the audio duration so + far. + - Dialogflow discards all Speech recognition results + in favor of the input text. + - Dialogflow will use the language code from the + first message. + After you sent all input, you must half-close or abort the request stream. retry (google.api_core.retry.Retry): Designation of what errors, if any, diff --git a/google/cloud/dialogflowcx_v3beta1/services/sessions/client.py b/google/cloud/dialogflowcx_v3beta1/services/sessions/client.py index feff8f51..a787cbc3 100644 --- a/google/cloud/dialogflowcx_v3beta1/services/sessions/client.py +++ b/google/cloud/dialogflowcx_v3beta1/services/sessions/client.py @@ -803,39 +803,42 @@ def request_generator(): Args: requests (Iterator[google.cloud.dialogflowcx_v3beta1.types.StreamingDetectIntentRequest]): - The request object iterator. The top-level message sent by the - client to the + The request object iterator. The top-level message sent by the client to the [Sessions.StreamingDetectIntent][google.cloud.dialogflow.cx.v3beta1.Sessions.StreamingDetectIntent] method. Multiple request messages should be sent in order: - 1. The first message must contain - [session][google.cloud.dialogflow.cx.v3beta1.StreamingDetectIntentRequest.session], - [query_input][google.cloud.dialogflow.cx.v3beta1.StreamingDetectIntentRequest.query_input] - plus optionally - [query_params][google.cloud.dialogflow.cx.v3beta1.StreamingDetectIntentRequest.query_params]. - If the client wants to receive an audio response, it - should also contain - [output_audio_config][google.cloud.dialogflow.cx.v3beta1.StreamingDetectIntentRequest.output_audio_config]. - 2. If - [query_input][google.cloud.dialogflow.cx.v3beta1.StreamingDetectIntentRequest.query_input] - was set to - [query_input.audio.config][google.cloud.dialogflow.cx.v3beta1.AudioInput.config], - all subsequent messages must contain - [query_input.audio.audio][google.cloud.dialogflow.cx.v3beta1.AudioInput.audio] - to continue with Speech recognition. If you decide to - rather detect an intent from text input after you - already started Speech recognition, please send a - message with - [query_input.text][google.cloud.dialogflow.cx.v3beta1.QueryInput.text]. - However, note that: - - * Dialogflow will bill you for the audio duration so - far. * Dialogflow discards all Speech recognition - results in favor of the input text. - * Dialogflow will use the language code from the - first message. + 1. The first message must contain + [session][google.cloud.dialogflow.cx.v3beta1.StreamingDetectIntentRequest.session], + [query_input][google.cloud.dialogflow.cx.v3beta1.StreamingDetectIntentRequest.query_input] + plus optionally + [query_params][google.cloud.dialogflow.cx.v3beta1.StreamingDetectIntentRequest.query_params]. + If the client wants to receive an audio response, it + should also contain + [output_audio_config][google.cloud.dialogflow.cx.v3beta1.StreamingDetectIntentRequest.output_audio_config]. + + 2. If + [query_input][google.cloud.dialogflow.cx.v3beta1.StreamingDetectIntentRequest.query_input] + was set to + [query_input.audio.config][google.cloud.dialogflow.cx.v3beta1.AudioInput.config], + all subsequent messages must contain + [query_input.audio.audio][google.cloud.dialogflow.cx.v3beta1.AudioInput.audio] + to continue with Speech recognition. If you decide to + rather detect an intent from text input after you + already started Speech recognition, please send a + message with + [query_input.text][google.cloud.dialogflow.cx.v3beta1.QueryInput.text]. + + However, note that: + + - Dialogflow will bill you for the audio duration so + far. + - Dialogflow discards all Speech recognition results + in favor of the input text. + - Dialogflow will use the language code from the + first message. + After you sent all input, you must half-close or abort the request stream. retry (google.api_core.retry.Retry): Designation of what errors, if any, diff --git a/google/cloud/dialogflowcx_v3beta1/services/test_cases/transports/rest.py b/google/cloud/dialogflowcx_v3beta1/services/test_cases/transports/rest.py index d3fb3b21..e4e1eb27 100644 --- a/google/cloud/dialogflowcx_v3beta1/services/test_cases/transports/rest.py +++ b/google/cloud/dialogflowcx_v3beta1/services/test_cases/transports/rest.py @@ -728,7 +728,6 @@ def __call__( request (~.test_case.BatchDeleteTestCasesRequest): The request object. The request message for [TestCases.BatchDeleteTestCases][google.cloud.dialogflow.cx.v3beta1.TestCases.BatchDeleteTestCases]. - retry (google.api_core.retry.Retry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. @@ -815,7 +814,6 @@ def __call__( request (~.test_case.BatchRunTestCasesRequest): The request object. The request message for [TestCases.BatchRunTestCases][google.cloud.dialogflow.cx.v3beta1.TestCases.BatchRunTestCases]. - retry (google.api_core.retry.Retry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. @@ -917,7 +915,6 @@ def __call__( request (~.test_case.CalculateCoverageRequest): The request object. The request message for [TestCases.CalculateCoverage][google.cloud.dialogflow.cx.v3beta1.TestCases.CalculateCoverage]. - retry (google.api_core.retry.Retry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. @@ -1009,7 +1006,6 @@ def __call__( request (~.gcdc_test_case.CreateTestCaseRequest): The request object. The request message for [TestCases.CreateTestCase][google.cloud.dialogflow.cx.v3beta1.TestCases.CreateTestCase]. - retry (google.api_core.retry.Retry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. @@ -1108,7 +1104,6 @@ def __call__( request (~.test_case.ExportTestCasesRequest): The request object. The request message for [TestCases.ExportTestCases][google.cloud.dialogflow.cx.v3beta1.TestCases.ExportTestCases]. - retry (google.api_core.retry.Retry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. @@ -1208,7 +1203,6 @@ def __call__( request (~.test_case.GetTestCaseRequest): The request object. The request message for [TestCases.GetTestCase][google.cloud.dialogflow.cx.v3beta1.TestCases.GetTestCase]. - retry (google.api_core.retry.Retry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. @@ -1296,7 +1290,6 @@ def __call__( request (~.test_case.GetTestCaseResultRequest): The request object. The request message for [TestCases.GetTestCaseResult][google.cloud.dialogflow.cx.v3beta1.TestCases.GetTestCaseResult]. - retry (google.api_core.retry.Retry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. @@ -1388,7 +1381,6 @@ def __call__( request (~.test_case.ImportTestCasesRequest): The request object. The request message for [TestCases.ImportTestCases][google.cloud.dialogflow.cx.v3beta1.TestCases.ImportTestCases]. - retry (google.api_core.retry.Retry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. @@ -1488,7 +1480,6 @@ def __call__( request (~.test_case.ListTestCaseResultsRequest): The request object. The request message for [TestCases.ListTestCaseResults][google.cloud.dialogflow.cx.v3beta1.TestCases.ListTestCaseResults]. - retry (google.api_core.retry.Retry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. @@ -1580,7 +1571,6 @@ def __call__( request (~.test_case.ListTestCasesRequest): The request object. The request message for [TestCases.ListTestCases][google.cloud.dialogflow.cx.v3beta1.TestCases.ListTestCases]. - retry (google.api_core.retry.Retry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. @@ -1670,7 +1660,6 @@ def __call__( request (~.test_case.RunTestCaseRequest): The request object. The request message for [TestCases.RunTestCase][google.cloud.dialogflow.cx.v3beta1.TestCases.RunTestCase]. - retry (google.api_core.retry.Retry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. @@ -1770,7 +1759,6 @@ def __call__( request (~.gcdc_test_case.UpdateTestCaseRequest): The request object. The request message for [TestCases.UpdateTestCase][google.cloud.dialogflow.cx.v3beta1.TestCases.UpdateTestCase]. - retry (google.api_core.retry.Retry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. diff --git a/google/cloud/dialogflowcx_v3beta1/services/transition_route_groups/transports/rest.py b/google/cloud/dialogflowcx_v3beta1/services/transition_route_groups/transports/rest.py index 126deb54..edbd0ae7 100644 --- a/google/cloud/dialogflowcx_v3beta1/services/transition_route_groups/transports/rest.py +++ b/google/cloud/dialogflowcx_v3beta1/services/transition_route_groups/transports/rest.py @@ -475,7 +475,6 @@ def __call__( request (~.gcdc_transition_route_group.CreateTransitionRouteGroupRequest): The request object. The request message for [TransitionRouteGroups.CreateTransitionRouteGroup][google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroups.CreateTransitionRouteGroup]. - retry (google.api_core.retry.Retry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. @@ -583,7 +582,6 @@ def __call__( request (~.transition_route_group.DeleteTransitionRouteGroupRequest): The request object. The request message for [TransitionRouteGroups.DeleteTransitionRouteGroup][google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroups.DeleteTransitionRouteGroup]. - retry (google.api_core.retry.Retry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. @@ -664,7 +662,6 @@ def __call__( request (~.transition_route_group.GetTransitionRouteGroupRequest): The request object. The request message for [TransitionRouteGroups.GetTransitionRouteGroup][google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroups.GetTransitionRouteGroup]. - retry (google.api_core.retry.Retry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. @@ -761,7 +758,6 @@ def __call__( request (~.transition_route_group.ListTransitionRouteGroupsRequest): The request object. The request message for [TransitionRouteGroups.ListTransitionRouteGroups][google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroups.ListTransitionRouteGroups]. - retry (google.api_core.retry.Retry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. @@ -856,7 +852,6 @@ def __call__( request (~.gcdc_transition_route_group.UpdateTransitionRouteGroupRequest): The request object. The request message for [TransitionRouteGroups.UpdateTransitionRouteGroup][google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroups.UpdateTransitionRouteGroup]. - retry (google.api_core.retry.Retry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. diff --git a/google/cloud/dialogflowcx_v3beta1/services/versions/transports/rest.py b/google/cloud/dialogflowcx_v3beta1/services/versions/transports/rest.py index b53fc8c0..612fb343 100644 --- a/google/cloud/dialogflowcx_v3beta1/services/versions/transports/rest.py +++ b/google/cloud/dialogflowcx_v3beta1/services/versions/transports/rest.py @@ -568,7 +568,6 @@ def __call__( request (~.version.CompareVersionsRequest): The request object. The request message for [Versions.CompareVersions][google.cloud.dialogflow.cx.v3beta1.Versions.CompareVersions]. - retry (google.api_core.retry.Retry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. @@ -669,7 +668,6 @@ def __call__( request (~.gcdc_version.CreateVersionRequest): The request object. The request message for [Versions.CreateVersion][google.cloud.dialogflow.cx.v3beta1.Versions.CreateVersion]. - retry (google.api_core.retry.Retry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. @@ -767,7 +765,6 @@ def __call__( request (~.version.DeleteVersionRequest): The request object. The request message for [Versions.DeleteVersion][google.cloud.dialogflow.cx.v3beta1.Versions.DeleteVersion]. - retry (google.api_core.retry.Retry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. @@ -843,7 +840,6 @@ def __call__( request (~.version.GetVersionRequest): The request object. The request message for [Versions.GetVersion][google.cloud.dialogflow.cx.v3beta1.Versions.GetVersion]. - retry (google.api_core.retry.Retry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. @@ -931,7 +927,6 @@ def __call__( request (~.version.ListVersionsRequest): The request object. The request message for [Versions.ListVersions][google.cloud.dialogflow.cx.v3beta1.Versions.ListVersions]. - retry (google.api_core.retry.Retry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. @@ -1021,7 +1016,6 @@ def __call__( request (~.version.LoadVersionRequest): The request object. The request message for [Versions.LoadVersion][google.cloud.dialogflow.cx.v3beta1.Versions.LoadVersion]. - retry (google.api_core.retry.Retry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. @@ -1121,7 +1115,6 @@ def __call__( request (~.gcdc_version.UpdateVersionRequest): The request object. The request message for [Versions.UpdateVersion][google.cloud.dialogflow.cx.v3beta1.Versions.UpdateVersion]. - retry (google.api_core.retry.Retry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. diff --git a/google/cloud/dialogflowcx_v3beta1/services/webhooks/transports/rest.py b/google/cloud/dialogflowcx_v3beta1/services/webhooks/transports/rest.py index 232407bf..60a95abb 100644 --- a/google/cloud/dialogflowcx_v3beta1/services/webhooks/transports/rest.py +++ b/google/cloud/dialogflowcx_v3beta1/services/webhooks/transports/rest.py @@ -447,7 +447,6 @@ def __call__( request (~.gcdc_webhook.CreateWebhookRequest): The request object. The request message for [Webhooks.CreateWebhook][google.cloud.dialogflow.cx.v3beta1.Webhooks.CreateWebhook]. - retry (google.api_core.retry.Retry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. @@ -551,7 +550,6 @@ def __call__( request (~.webhook.DeleteWebhookRequest): The request object. The request message for [Webhooks.DeleteWebhook][google.cloud.dialogflow.cx.v3beta1.Webhooks.DeleteWebhook]. - retry (google.api_core.retry.Retry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. @@ -627,7 +625,6 @@ def __call__( request (~.webhook.GetWebhookRequest): The request object. The request message for [Webhooks.GetWebhook][google.cloud.dialogflow.cx.v3beta1.Webhooks.GetWebhook]. - retry (google.api_core.retry.Retry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. @@ -722,7 +719,6 @@ def __call__( request (~.webhook.ListWebhooksRequest): The request object. The request message for [Webhooks.ListWebhooks][google.cloud.dialogflow.cx.v3beta1.Webhooks.ListWebhooks]. - retry (google.api_core.retry.Retry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. @@ -812,7 +808,6 @@ def __call__( request (~.gcdc_webhook.UpdateWebhookRequest): The request object. The request message for [Webhooks.UpdateWebhook][google.cloud.dialogflow.cx.v3beta1.Webhooks.UpdateWebhook]. - retry (google.api_core.retry.Retry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. From 02efcc48994f81d2d13e30d1ebb9240a675c66e2 Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Mon, 27 Mar 2023 12:07:41 -0400 Subject: [PATCH 8/8] chore(main): release 1.20.1 (#512) Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com> --- .release-please-manifest.json | 2 +- CHANGELOG.md | 9 +++++++++ google/cloud/dialogflowcx/gapic_version.py | 2 +- google/cloud/dialogflowcx_v3/gapic_version.py | 2 +- google/cloud/dialogflowcx_v3beta1/gapic_version.py | 2 +- .../snippet_metadata_google.cloud.dialogflow.cx.v3.json | 2 +- ...ppet_metadata_google.cloud.dialogflow.cx.v3beta1.json | 2 +- 7 files changed, 15 insertions(+), 6 deletions(-) diff --git a/.release-please-manifest.json b/.release-please-manifest.json index 6d9e5fc0..1db91d77 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "1.20.0" + ".": "1.20.1" } diff --git a/CHANGELOG.md b/CHANGELOG.md index 71718f6c..68549c78 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,14 @@ # Changelog +## [1.20.1](https://github.com/googleapis/python-dialogflow-cx/compare/v1.20.0...v1.20.1) (2023-03-23) + + +### Documentation + +* Add clarification in AudioInput ([#511](https://github.com/googleapis/python-dialogflow-cx/issues/511)) ([fc0ecdf](https://github.com/googleapis/python-dialogflow-cx/commit/fc0ecdf2f3d29f23de45e6bd44f1c1ec17ddb4ef)) +* Clarified wording around quota usage ([#515](https://github.com/googleapis/python-dialogflow-cx/issues/515)) ([361a359](https://github.com/googleapis/python-dialogflow-cx/commit/361a359e60c8953453a6837e3e5f1916fad76095)) +* Minor formatting changes ([#517](https://github.com/googleapis/python-dialogflow-cx/issues/517)) ([b05b15f](https://github.com/googleapis/python-dialogflow-cx/commit/b05b15f2ac54ffd83a33ee0829cab395f157a42f)) + ## [1.20.0](https://github.com/googleapis/python-dialogflow-cx/compare/v1.19.0...v1.20.0) (2023-03-01) diff --git a/google/cloud/dialogflowcx/gapic_version.py b/google/cloud/dialogflowcx/gapic_version.py index 4d61ace4..e908112c 100644 --- a/google/cloud/dialogflowcx/gapic_version.py +++ b/google/cloud/dialogflowcx/gapic_version.py @@ -13,4 +13,4 @@ # See the License for the specific language governing permissions and # limitations under the License. # -__version__ = "1.20.0" # {x-release-please-version} +__version__ = "1.20.1" # {x-release-please-version} diff --git a/google/cloud/dialogflowcx_v3/gapic_version.py b/google/cloud/dialogflowcx_v3/gapic_version.py index 4d61ace4..e908112c 100644 --- a/google/cloud/dialogflowcx_v3/gapic_version.py +++ b/google/cloud/dialogflowcx_v3/gapic_version.py @@ -13,4 +13,4 @@ # See the License for the specific language governing permissions and # limitations under the License. # -__version__ = "1.20.0" # {x-release-please-version} +__version__ = "1.20.1" # {x-release-please-version} diff --git a/google/cloud/dialogflowcx_v3beta1/gapic_version.py b/google/cloud/dialogflowcx_v3beta1/gapic_version.py index 4d61ace4..e908112c 100644 --- a/google/cloud/dialogflowcx_v3beta1/gapic_version.py +++ b/google/cloud/dialogflowcx_v3beta1/gapic_version.py @@ -13,4 +13,4 @@ # See the License for the specific language governing permissions and # limitations under the License. # -__version__ = "1.20.0" # {x-release-please-version} +__version__ = "1.20.1" # {x-release-please-version} diff --git a/samples/generated_samples/snippet_metadata_google.cloud.dialogflow.cx.v3.json b/samples/generated_samples/snippet_metadata_google.cloud.dialogflow.cx.v3.json index 4fe8e9ba..6826cd66 100644 --- a/samples/generated_samples/snippet_metadata_google.cloud.dialogflow.cx.v3.json +++ b/samples/generated_samples/snippet_metadata_google.cloud.dialogflow.cx.v3.json @@ -8,7 +8,7 @@ ], "language": "PYTHON", "name": "google-cloud-dialogflow-cx", - "version": "0.1.0" + "version": "1.20.1" }, "snippets": [ { diff --git a/samples/generated_samples/snippet_metadata_google.cloud.dialogflow.cx.v3beta1.json b/samples/generated_samples/snippet_metadata_google.cloud.dialogflow.cx.v3beta1.json index bddeff21..2aadce3f 100644 --- a/samples/generated_samples/snippet_metadata_google.cloud.dialogflow.cx.v3beta1.json +++ b/samples/generated_samples/snippet_metadata_google.cloud.dialogflow.cx.v3beta1.json @@ -8,7 +8,7 @@ ], "language": "PYTHON", "name": "google-cloud-dialogflow-cx", - "version": "0.1.0" + "version": "1.20.1" }, "snippets": [ {