From 018eb4dc6343cb425a6a4813494fbf5ee3216083 Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Wed, 14 Dec 2022 11:37:27 -0500 Subject: [PATCH] fix(deps): Require google-api-core >=1.34.0, >=2.11.0 (#591) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * chore: update to gapic-generator-python 1.5.0 feat: add support for `google.cloud..__version__` PiperOrigin-RevId: 484665853 Source-Link: https://github.com/googleapis/googleapis/commit/8eb249a19db926c2fbc4ecf1dc09c0e521a88b22 Source-Link: https://github.com/googleapis/googleapis-gen/commit/c8aa327b5f478865fc3fd91e3c2768e54e26ad44 Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiYzhhYTMyN2I1ZjQ3ODg2NWZjM2ZkOTFlM2MyNzY4ZTU0ZTI2YWQ0NCJ9 * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md * update version in gapic_version.py * add .release-please-manifest.json with correct version * set manifest to true in .github/release-please.yml * add release-please-config.json * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md * chore: Update to gapic-generator-python 1.6.0 feat(python): Add typing to proto.Message based class attributes feat(python): Snippetgen handling of repeated enum field PiperOrigin-RevId: 487326846 Source-Link: https://github.com/googleapis/googleapis/commit/da380c77bb87ba0f752baf07605dd1db30e1f7e1 Source-Link: https://github.com/googleapis/googleapis-gen/commit/61ef5762ee6731a0cbbfea22fd0eecee51ab1c8e Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiNjFlZjU3NjJlZTY3MzFhMGNiYmZlYTIyZmQwZWVjZWU1MWFiMWM4ZSJ9 * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md * feat: new APIs added to reflect updates to the filestore service - Add ENTERPRISE Tier - Add snapshot APIs: RevertInstance, ListSnapshots, CreateSnapshot, DeleteSnapshot, UpdateSnapshot - Add multi-share APIs: ListShares, GetShare, CreateShare, DeleteShare, UpdateShare - Add ConnectMode to NetworkConfig (for Private Service Access support) - New status codes (SUSPENDED/SUSPENDING, REVERTING/RESUMING) - Add SuspensionReason (for KMS related suspension) - Add new fields to Instance information: max_capacity_gb, capacity_step_size_gb, max_share_count, capacity_gb, multi_share_enabled PiperOrigin-RevId: 487492758 Source-Link: https://github.com/googleapis/googleapis/commit/5be5981f50322cf0c7388595e0f31ac5d0693469 Source-Link: https://github.com/googleapis/googleapis-gen/commit/ab0e217f560cc2c1afc11441c2eab6b6950efd2b Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiYWIwZTIxN2Y1NjBjYzJjMWFmYzExNDQxYzJlYWI2YjY5NTBlZmQyYiJ9 * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md * update path to snippet metadata json * chore: Update gapic-generator-python to v1.6.1 PiperOrigin-RevId: 488036204 Source-Link: https://github.com/googleapis/googleapis/commit/08f275f5c1c0d99056e1cb68376323414459ee19 Source-Link: https://github.com/googleapis/googleapis-gen/commit/555c0945e60649e38739ae64bc45719cdf72178f Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiNTU1YzA5NDVlNjA2NDllMzg3MzlhZTY0YmM0NTcxOWNkZjcyMTc4ZiJ9 * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md * feat: added cx_current_page field to AutomatedAgentReply docs: clarified docs for Sentiment PiperOrigin-RevId: 489494136 Source-Link: https://github.com/googleapis/googleapis/commit/813e2fa430c3e13227529573cfe3f5c852abb559 Source-Link: https://github.com/googleapis/googleapis-gen/commit/dcf495943f59026b392927c19c652f61bd1f9869 Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiZGNmNDk1OTQzZjU5MDI2YjM5MjkyN2MxOWM2NTJmNjFiZDFmOTg2OSJ9 * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md * feat: added cx_current_page field to AutomatedAgentReply docs: clarified docs for Sentiment PiperOrigin-RevId: 490103678 Source-Link: https://github.com/googleapis/googleapis/commit/8f95a5f2d5032f040d93874bf8e63b33d135d11d Source-Link: https://github.com/googleapis/googleapis-gen/commit/fed1c108dbe9291c14f7f305ca1e8bf2830c9c60 Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiZmVkMWMxMDhkYmU5MjkxYzE0ZjdmMzA1Y2ExZThiZjI4MzBjOWM2MCJ9 * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md * use templated owlbot.py and setup.py * run nox format session * fix(deps): Require google-api-core >=1.34.0, >=2.11.0 fix: Drop usage of pkg_resources fix: Fix timeout default values docs(samples): Snippetgen should call await on the operation coroutine before calling result PiperOrigin-RevId: 493260409 Source-Link: https://github.com/googleapis/googleapis/commit/fea43879f83a8d0dacc9353b3f75f8f46d37162f Source-Link: https://github.com/googleapis/googleapis-gen/commit/387b7344c7529ee44be84e613b19a820508c612b Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiMzg3YjczNDRjNzUyOWVlNDRiZTg0ZTYxM2IxOWE4MjA1MDhjNjEyYiJ9 * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md * add gapic_version.py Co-authored-by: Owl Bot Co-authored-by: Anthonios Partheniou --- dialogflow/analyze_content_stream_test.py | 10 +++++----- dialogflow/answer_record_management_test.py | 3 +-- dialogflow/conversation_profile_management.py | 5 ++++- dialogflow/create_document_test.py | 1 - dialogflow/detect_intent_audio.py | 4 +++- dialogflow/document_management.py | 1 - dialogflow/list_training_phrases_test.py | 4 ++-- dialogflow/noxfile.py | 16 ++++++++-------- dialogflow/participant_management.py | 11 +++++++---- dialogflow/participant_management_test.py | 3 +-- dialogflow/set_agent.py | 3 +-- dialogflow/set_agent_test.py | 1 - dialogflow/update_intent_test.py | 1 - dialogflow/webhook.py | 1 + 14 files changed, 33 insertions(+), 31 deletions(-) diff --git a/dialogflow/analyze_content_stream_test.py b/dialogflow/analyze_content_stream_test.py index e9e226a2fe22..29aa40b0fa13 100644 --- a/dialogflow/analyze_content_stream_test.py +++ b/dialogflow/analyze_content_stream_test.py @@ -21,7 +21,6 @@ import conversation_profile_management import participant_management - PROJECT_ID = os.getenv("GOOGLE_CLOUD_PROJECT") AUDIO_FILE_PATH = "{0}/resources/book_a_room.wav".format( os.path.realpath(os.path.dirname(__file__)), @@ -37,8 +36,7 @@ def conversation_profile_display_name(): def conversation_profile_id(conversation_profile_display_name): # Create conversation profile. response = conversation_profile_management.create_conversation_profile_article_faq( - project_id=PROJECT_ID, - display_name=conversation_profile_display_name + project_id=PROJECT_ID, display_name=conversation_profile_display_name ) conversation_profile_id = response.name.split("conversationProfiles/")[1].rstrip() @@ -61,7 +59,9 @@ def conversation_id(conversation_profile_id): yield conversation_id # Complete the conversation. - conversation_management.complete_conversation(project_id=PROJECT_ID, conversation_id=conversation_id) + conversation_management.complete_conversation( + project_id=PROJECT_ID, conversation_id=conversation_id + ) @pytest.fixture @@ -79,7 +79,7 @@ def test_analyze_content_audio_stream(capsys, conversation_id, participant_id): participant_management.analyze_content_audio_stream( project_id=PROJECT_ID, conversation_id=conversation_id, - participant_id=participant_id , + participant_id=participant_id, audio_file_path=AUDIO_FILE_PATH, ) out, _ = capsys.readouterr() diff --git a/dialogflow/answer_record_management_test.py b/dialogflow/answer_record_management_test.py index 5008c077dd57..51d109f99ecf 100644 --- a/dialogflow/answer_record_management_test.py +++ b/dialogflow/answer_record_management_test.py @@ -26,8 +26,7 @@ def test_smart_reply(capsys): - """Test smart reply feature. - """ + """Test smart reply feature.""" # Create conversation profile. conversation_profile_management.create_conversation_profile_smart_reply( diff --git a/dialogflow/conversation_profile_management.py b/dialogflow/conversation_profile_management.py index 1316ceab12ae..aed0ce6ddae5 100644 --- a/dialogflow/conversation_profile_management.py +++ b/dialogflow/conversation_profile_management.py @@ -139,7 +139,10 @@ def create_conversation_profile_smart_reply( } feature_config = { "suggestion_feature": {"type_": "SMART_REPLY"}, - "suggestion_trigger_settings": {"no_small_talk": True, "only_end_user": True, }, + "suggestion_trigger_settings": { + "no_small_talk": True, + "only_end_user": True, + }, "query_config": { "document_query_source": {"documents": [smart_reply_allowlist_name]}, "max_results": 3, diff --git a/dialogflow/create_document_test.py b/dialogflow/create_document_test.py index db4c4ea9c47f..fed3c914e035 100644 --- a/dialogflow/create_document_test.py +++ b/dialogflow/create_document_test.py @@ -18,7 +18,6 @@ import uuid from google.cloud import dialogflow_v2beta1 as dialogflow - import pytest import document_management diff --git a/dialogflow/detect_intent_audio.py b/dialogflow/detect_intent_audio.py index e0cbd78fc899..6c398168713e 100644 --- a/dialogflow/detect_intent_audio.py +++ b/dialogflow/detect_intent_audio.py @@ -58,7 +58,9 @@ def detect_intent_audio(project_id, session_id, audio_file_path, language_code): query_input = dialogflow.QueryInput(audio_config=audio_config) request = dialogflow.DetectIntentRequest( - session=session, query_input=query_input, input_audio=input_audio, + session=session, + query_input=query_input, + input_audio=input_audio, ) response = session_client.detect_intent(request=request) diff --git a/dialogflow/document_management.py b/dialogflow/document_management.py index 8957ee034040..33697862edf6 100644 --- a/dialogflow/document_management.py +++ b/dialogflow/document_management.py @@ -35,7 +35,6 @@ import argparse - KNOWLEDGE_TYPES = [ "KNOWLEDGE_TYPE_UNSPECIFIED", "FAQ", diff --git a/dialogflow/list_training_phrases_test.py b/dialogflow/list_training_phrases_test.py index 871a94fc683c..820441bfde46 100644 --- a/dialogflow/list_training_phrases_test.py +++ b/dialogflow/list_training_phrases_test.py @@ -18,13 +18,13 @@ import list_training_phrases - _, PROJECT_ID = google.auth.default() INTENT_ID = "7b5bd47e-6dd9-4b45-8624-565862bd2d85" def test_list_training_phrases(capsys): training_phrases = list_training_phrases.list_training_phrases( - PROJECT_ID, INTENT_ID, + PROJECT_ID, + INTENT_ID, ) assert len(training_phrases) >= 9 # Number of training phrases at this point. diff --git a/dialogflow/noxfile.py b/dialogflow/noxfile.py index f5c32b22789b..0577084695fc 100644 --- a/dialogflow/noxfile.py +++ b/dialogflow/noxfile.py @@ -22,7 +22,6 @@ import nox - # WARNING - WARNING - WARNING - WARNING - WARNING # WARNING - WARNING - WARNING - WARNING - WARNING # DO NOT EDIT THIS FILE EVER! @@ -160,6 +159,7 @@ def blacken(session: nox.sessions.Session) -> None: # format = isort + black # + @nox.session def format(session: nox.sessions.Session) -> None: """ @@ -187,7 +187,9 @@ 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 = 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: @@ -209,9 +211,7 @@ def _session_tests( if os.path.exists("requirements-test.txt"): if os.path.exists("constraints-test.txt"): - session.install( - "-r", "requirements-test.txt", "-c", "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: @@ -224,9 +224,9 @@ def _session_tests( post_install(session) if "pytest-parallel" in packages: - concurrent_args.extend(['--workers', 'auto', '--tests-per-worker', 'auto']) + concurrent_args.extend(["--workers", "auto", "--tests-per-worker", "auto"]) elif "pytest-xdist" in packages: - concurrent_args.extend(['-n', 'auto']) + concurrent_args.extend(["-n", "auto"]) session.run( "pytest", @@ -256,7 +256,7 @@ def py(session: nox.sessions.Session) -> None: def _get_repo_root() -> Optional[str]: - """ Returns the root folder of the project. """ + """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): diff --git a/dialogflow/participant_management.py b/dialogflow/participant_management.py index 7df3ae99c134..e2bf6169f433 100644 --- a/dialogflow/participant_management.py +++ b/dialogflow/participant_management.py @@ -111,7 +111,9 @@ def analyze_content_text(project_id, conversation_id, participant_id, text): # [END dialogflow_analyze_content_text] # [START dialogflow_analyze_content_audio_stream] -def analyze_content_audio_stream(project_id, conversation_id, participant_id, audio_file_path): +def analyze_content_audio_stream( + project_id, conversation_id, participant_id, audio_file_path +): """Analyze audio content for END_USER Args: @@ -156,12 +158,12 @@ def request_generator(audio_config, audio_file_path): audio_config = dialogflow.InputAudioConfig( audio_encoding=audio_encoding, - language_code='en-US', + language_code="en-US", sample_rate_hertz=sample_rate_hertz, single_utterance=True, - model='phone_call', + model="phone_call", # Make sure your project is Dialogflow ES ENTERPRISE_TIER in order to "USE_ENHANCED" model. - model_variant='USE_ENHANCED' + model_variant="USE_ENHANCED", ) requests = request_generator(audio_config, audio_file_path) responses = client.streaming_analyze_content(requests=requests) @@ -171,4 +173,5 @@ def request_generator(audio_config, audio_file_path): print("=" * 20) + # [END dialogflow_analyze_content_audio_stream] diff --git a/dialogflow/participant_management_test.py b/dialogflow/participant_management_test.py index fc2754790969..6e4fd7e78f1e 100644 --- a/dialogflow/participant_management_test.py +++ b/dialogflow/participant_management_test.py @@ -27,8 +27,7 @@ def test_analyze_content_text(capsys): - """Test analyze content api with text only messages. - """ + """Test analyze content api with text only messages.""" # Create knowledge base. knowledge_base_management.create_knowledge_base( PROJECT_ID, KNOWLEDGE_BASE_DISPLAY_NAME diff --git a/dialogflow/set_agent.py b/dialogflow/set_agent.py index f1b993d1526f..c252a131a000 100644 --- a/dialogflow/set_agent.py +++ b/dialogflow/set_agent.py @@ -14,8 +14,7 @@ # [START dialogflow_set_agent_sample] -from google.cloud.dialogflow_v2 import Agent -from google.cloud.dialogflow_v2 import AgentsClient +from google.cloud.dialogflow_v2 import Agent, AgentsClient def set_agent(project_id, display_name): diff --git a/dialogflow/set_agent_test.py b/dialogflow/set_agent_test.py index 98b0eeb7fef4..aff0dcdf2a70 100644 --- a/dialogflow/set_agent_test.py +++ b/dialogflow/set_agent_test.py @@ -15,7 +15,6 @@ import os from google.api_core.exceptions import InvalidArgument - import pytest from set_agent import set_agent diff --git a/dialogflow/update_intent_test.py b/dialogflow/update_intent_test.py index 432c0531f201..f28f4b304aec 100644 --- a/dialogflow/update_intent_test.py +++ b/dialogflow/update_intent_test.py @@ -18,7 +18,6 @@ from google.cloud.dialogflow_v2.services.agents.client import AgentsClient from google.cloud.dialogflow_v2.services.intents.client import IntentsClient from google.cloud.dialogflow_v2.types.intent import Intent - import pytest from update_intent import update_intent diff --git a/dialogflow/webhook.py b/dialogflow/webhook.py index 0299170ca823..b3cdbe35dbe7 100644 --- a/dialogflow/webhook.py +++ b/dialogflow/webhook.py @@ -17,6 +17,7 @@ # TODO: change the default Entry Point text to handleWebhook + def handleWebhook(request): req = request.get_json()