Skip to content

Commit 9f939a6

Browse files
fix(deps): Require google-api-core >=1.34.0, >=2.11.0 (#469)
* chore: update to gapic-generator-python 1.5.0 feat: add support for `google.cloud.<api>.__version__` PiperOrigin-RevId: 484665853 Source-Link: googleapis/googleapis@8eb249a 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 * docs: Clarify interactive logging TTL behavior PiperOrigin-RevId: 485069403 Source-Link: googleapis/googleapis@63cd62a Source-Link: https://github.com/googleapis/googleapis-gen/commit/d4f928e8aa29d03051428f8661827a534de6e1f6 Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiZDRmOTI4ZThhYTI5ZDAzMDUxNDI4Zjg2NjE4MjdhNTM0ZGU2ZTFmNiJ9 * 🦉 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 * 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: googleapis/googleapis@5be5981 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 * feat: Add files field to finding's list of attributes PiperOrigin-RevId: 488290111 Source-Link: googleapis/googleapis@7349e1c Source-Link: https://github.com/googleapis/googleapis-gen/commit/721049d512deebaa96d438aa23e970299d97712b Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiNzIxMDQ5ZDUxMmRlZWJhYTk2ZDQzOGFhMjNlOTcwMjk5ZDk3NzEyYiJ9 * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md * docs: Clarified Agent Assist max retention is 30 days PiperOrigin-RevId: 489241089 Source-Link: googleapis/googleapis@e795029 Source-Link: https://github.com/googleapis/googleapis-gen/commit/4380bee60092cd1aaf2be81b6c08bb76f8c12a66 Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiNDM4MGJlZTYwMDkyY2QxYWFmMmJlODFiNmMwOGJiNzZmOGMxMmE2NiJ9 * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md * docs: Clarified Agent Assist max retention is 30 days PiperOrigin-RevId: 489494670 Source-Link: googleapis/googleapis@e35c0d3 Source-Link: https://github.com/googleapis/googleapis-gen/commit/4c3848551a76fdf190533292127211a4ad8fee8b Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiNGMzODQ4NTUxYTc2ZmRmMTkwNTMzMjkyMTI3MjExYTRhZDhmZWU4YiJ9 * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md * chore: use templated setup.py and owlbot.py * chore(python): fix warehouse-package-name for dialogflow/cx v3 and v3beta1 PiperOrigin-RevId: 492185983 Source-Link: googleapis/googleapis@ac614c7 Source-Link: https://github.com/googleapis/googleapis-gen/commit/ce0d078339e501a500a28fdc4836a8dcccbb7e3b Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiY2UwZDA3ODMzOWU1MDFhNTAwYTI4ZmRjNDgzNmE4ZGNjY2JiN2UzYiJ9 * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md * 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: googleapis/googleapis@fea4387 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 <gcf-owl-bot[bot]@users.noreply.github.com> Co-authored-by: Anthonios Partheniou <[email protected]>
1 parent c16781a commit 9f939a6

19 files changed

+349
-241
lines changed

Dialogflow-CX/detect_intent_disabled_webhook.py

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -66,12 +66,9 @@ def detect_intent_disabled_webhook(
6666

6767
# Prepare request
6868
text_input = session.TextInput(text=text)
69-
query_input = session.QueryInput(
70-
text=text_input,
71-
language_code=language_code
72-
)
69+
query_input = session.QueryInput(text=text_input, language_code=language_code)
7370
query_params = session.QueryParameters(
74-
disable_webhook=True,
71+
disable_webhook=True,
7572
)
7673
request = session.DetectIntentRequest(
7774
session=session_path,
@@ -80,14 +77,16 @@ def detect_intent_disabled_webhook(
8077
)
8178

8279
response = session_client.detect_intent(request=request)
83-
print(f'Detect Intent Request: {request.query_params.disable_webhook}')
80+
print(f"Detect Intent Request: {request.query_params.disable_webhook}")
8481
response_text = []
8582
for message in response.query_result.response_messages:
8683
if message.text:
8784
curr_response_text = message.text.text
88-
print(f'Agent Response: {curr_response_text}')
85+
print(f"Agent Response: {curr_response_text}")
8986
response_text.append(curr_response_text)
9087
return response_text
88+
89+
9190
# [END dialogflow_cx_detect_intent_with_disabled_webhook]
9291

9392

Dialogflow-CX/detect_intent_disabled_webhook_test.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -27,16 +27,16 @@
2727
def test_detect_intent_positive():
2828
response_text_list = detect_intent_disabled_webhook(
2929
PROJECT_ID,
30-
'global',
30+
"global",
3131
AGENT_ID,
32-
'Perfect!',
33-
'en-us',
32+
"Perfect!",
33+
"en-us",
3434
)
3535
for response_text in response_text_list:
3636
assert response_text[0] in [
37-
'You are welcome!',
38-
'It\'s my pleasure.',
39-
'Anytime.',
40-
'Of course.',
41-
'It\'s my pleasure to serve you.',
37+
"You are welcome!",
38+
"It's my pleasure.",
39+
"Anytime.",
40+
"Of course.",
41+
"It's my pleasure to serve you.",
4242
]

Dialogflow-CX/detect_intent_event.py

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -32,11 +32,11 @@ def run_sample():
3232
# event = "YOUR-EVENT"
3333
# language_code = "YOUR-LANGUAGE-CODE"
3434

35-
project_id = 'dialogflow-cx-demo-1-348717'
36-
location = 'global'
37-
agent_id = '8caa6b47-5dd7-4380-b86e-ea4301d565b0'
38-
event = 'sys.no-match-default'
39-
language_code = 'en-us'
35+
project_id = "dialogflow-cx-demo-1-348717"
36+
location = "global"
37+
agent_id = "8caa6b47-5dd7-4380-b86e-ea4301d565b0"
38+
event = "sys.no-match-default"
39+
language_code = "en-us"
4040

4141
detect_intent_with_event_input(
4242
project_id,
@@ -71,19 +71,18 @@ def detect_intent_with_event_input(
7171

7272
# Construct detect intent request:
7373
event = session.EventInput(event=event)
74-
query_input = session.QueryInput(
75-
event=event,
76-
language_code=language_code
77-
)
74+
query_input = session.QueryInput(event=event, language_code=language_code)
7875
request = session.DetectIntentRequest(
79-
session=session_path,
80-
query_input=query_input,
76+
session=session_path,
77+
query_input=query_input,
8178
)
8279

8380
response = session_client.detect_intent(request=request)
8481
response_text = response.query_result.response_messages[0].text.text[0]
85-
print(f'Response: {response_text}')
82+
print(f"Response: {response_text}")
8683
return response_text
84+
85+
8786
# [END dialogflow_cx_v3_detect_intent_event_input_async]
8887

8988

Dialogflow-CX/detect_intent_event_test.py

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -27,22 +27,22 @@
2727
def test_detect_intent_positive():
2828
response_text = detect_intent_with_event_input(
2929
PROJECT_ID,
30-
'global',
30+
"global",
3131
AGENT_ID,
32-
'sys.no-match-default',
33-
'en-us',
32+
"sys.no-match-default",
33+
"en-us",
3434
)
3535
assert response_text in [
36-
'Can you say that again?',
37-
'I didn\'t get that. Can you repeat?',
38-
'I didn\'t get that. Can you say it again?',
39-
'I missed that, say that again?',
40-
'I missed what you said. What was that?',
41-
'One more time?',
42-
'Say that one more time?',
43-
'Sorry, can you say that again?',
44-
'Sorry, could you say that again?',
45-
'Sorry, I didn\'t get that. Can you rephrase?',
46-
'Sorry, what was that?',
47-
'What was that?',
36+
"Can you say that again?",
37+
"I didn't get that. Can you repeat?",
38+
"I didn't get that. Can you say it again?",
39+
"I missed that, say that again?",
40+
"I missed what you said. What was that?",
41+
"One more time?",
42+
"Say that one more time?",
43+
"Sorry, can you say that again?",
44+
"Sorry, could you say that again?",
45+
"Sorry, I didn't get that. Can you rephrase?",
46+
"Sorry, what was that?",
47+
"What was that?",
4848
]

Dialogflow-CX/detect_intent_synthesize_tts_response.py

Lines changed: 13 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -71,18 +71,14 @@ def detect_intent_synthesize_tts_response(
7171
session=session_id,
7272
)
7373
text_input = session.TextInput(text=text)
74-
query_input = session.QueryInput(
75-
text=text_input,
76-
language_code=language_code
77-
)
74+
query_input = session.QueryInput(text=text_input, language_code=language_code)
7875
synthesize_speech_config = audio_config.SynthesizeSpeechConfig(
79-
speaking_rate=1.25,
80-
pitch=10.0,
76+
speaking_rate=1.25,
77+
pitch=10.0,
8178
)
8279
output_audio_config = audio_config.OutputAudioConfig(
83-
synthesize_speech_config=synthesize_speech_config,
84-
audio_encoding=audio_config.OutputAudioEncoding[
85-
audio_encoding],
80+
synthesize_speech_config=synthesize_speech_config,
81+
audio_encoding=audio_config.OutputAudioEncoding[audio_encoding],
8682
)
8783
request = session.DetectIntentRequest(
8884
session=session_path,
@@ -92,14 +88,15 @@ def detect_intent_synthesize_tts_response(
9288

9389
response = session_client.detect_intent(request=request)
9490
print(
95-
'Speaking Rate: '
96-
f'{response.output_audio_config.synthesize_speech_config.speaking_rate}')
97-
print(
98-
'Pitch: '
99-
f'{response.output_audio_config.synthesize_speech_config.pitch}')
100-
with open(output_file, 'wb') as fout:
91+
"Speaking Rate: "
92+
f"{response.output_audio_config.synthesize_speech_config.speaking_rate}"
93+
)
94+
print("Pitch: " f"{response.output_audio_config.synthesize_speech_config.pitch}")
95+
with open(output_file, "wb") as fout:
10196
fout.write(response.output_audio)
102-
print(f'Audio content written to file: {output_file}')
97+
print(f"Audio content written to file: {output_file}")
98+
99+
103100
# [END dialogflow_cx_v3_detect_intent_synthesize_tts_response_async]
104101

105102

Dialogflow-CX/detect_intent_synthesize_tts_response_test.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,12 +30,12 @@ def test_detect_intent_positive(capsys, tmp_path_factory):
3030

3131
detect_intent_synthesize_tts_response(
3232
PROJECT_ID,
33-
'global',
33+
"global",
3434
AGENT_ID,
3535
"Perfect!",
36-
'OUTPUT_AUDIO_ENCODING_LINEAR_16',
36+
"OUTPUT_AUDIO_ENCODING_LINEAR_16",
3737
"en-us",
3838
output_file,
3939
)
4040
out, _ = capsys.readouterr()
41-
assert f'Audio content written to file: {output_file}' in out
41+
assert f"Audio content written to file: {output_file}" in out

Dialogflow-CX/detect_intent_with_intent_input.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -73,10 +73,7 @@ def detect_intent_with_intent_input(
7373
)
7474

7575
intent = session.IntentInput(intent=intent_path)
76-
query_input = session.QueryInput(
77-
intent=intent,
78-
language_code=language_code
79-
)
76+
query_input = session.QueryInput(intent=intent, language_code=language_code)
8077
request = session.DetectIntentRequest(
8178
session=session_path,
8279
query_input=query_input,
@@ -88,6 +85,8 @@ def detect_intent_with_intent_input(
8885
response_text.append(response_message.text.text)
8986
print(response_message.text.text)
9087
return response_text
88+
89+
9190
# [END dialogflow_cx_v3_detect_intent_with_intent_input_async]
9291

9392

Dialogflow-CX/detect_intent_with_intent_input_test.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
def test_detect_intent_with_intent_input():
2929
response_text = detect_intent_with_intent_input(
3030
PROJECT_ID,
31-
'global',
31+
"global",
3232
AGENT_ID,
3333
INTENT_ID,
3434
"en-us",

Dialogflow-CX/detect_intent_with_sentiment_analysis.py

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -66,12 +66,9 @@ def detect_intent_with_sentiment_analysis(
6666
)
6767

6868
text_input = session.TextInput(text=text)
69-
query_input = session.QueryInput(
70-
text=text_input,
71-
language_code=language_code
72-
)
69+
query_input = session.QueryInput(text=text_input, language_code=language_code)
7370
query_params = session.QueryParameters(
74-
analyze_query_text_sentiment=True,
71+
analyze_query_text_sentiment=True,
7572
)
7673
request = session.DetectIntentRequest(
7774
session=session_path,
@@ -81,9 +78,10 @@ def detect_intent_with_sentiment_analysis(
8178

8279
response = session_client.detect_intent(request=request)
8380
score = response.query_result.sentiment_analysis_result.score
84-
print('Sentiment Score: {score}')
81+
print("Sentiment Score: {score}")
8582
return score
8683

84+
8785
# [END dialogflow_cx_v3_detect_intent_sentiment_analysis_async]
8886

8987

Dialogflow-CX/detect_intent_with_sentiment_analysis_test.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,13 +28,13 @@
2828

2929
@pytest.mark.parametrize(
3030
"text, expected_score_min, expected_score_max",
31-
(['Perfect', .5, 1], ['I am not happy', -1, -.5])
31+
(["Perfect", 0.5, 1], ["I am not happy", -1, -0.5]),
3232
)
3333
def test_detect_intent_positive(text, expected_score_min, expected_score_max):
3434

3535
score = detect_intent_with_sentiment_analysis(
3636
PROJECT_ID,
37-
'global',
37+
"global",
3838
AGENT_ID,
3939
text,
4040
"en-us",

Dialogflow-CX/noxfile.py

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -160,6 +160,7 @@ def blacken(session: nox.sessions.Session) -> None:
160160
# format = isort + black
161161
#
162162

163+
163164
@nox.session
164165
def format(session: nox.sessions.Session) -> None:
165166
"""
@@ -187,7 +188,9 @@ def _session_tests(
187188
session: nox.sessions.Session, post_install: Callable = None
188189
) -> None:
189190
# check for presence of tests
190-
test_list = glob.glob("**/*_test.py", recursive=True) + glob.glob("**/test_*.py", recursive=True)
191+
test_list = glob.glob("**/*_test.py", recursive=True) + glob.glob(
192+
"**/test_*.py", recursive=True
193+
)
191194
test_list.extend(glob.glob("**/tests", recursive=True))
192195

193196
if len(test_list) == 0:
@@ -209,9 +212,7 @@ def _session_tests(
209212

210213
if os.path.exists("requirements-test.txt"):
211214
if os.path.exists("constraints-test.txt"):
212-
session.install(
213-
"-r", "requirements-test.txt", "-c", "constraints-test.txt"
214-
)
215+
session.install("-r", "requirements-test.txt", "-c", "constraints-test.txt")
215216
else:
216217
session.install("-r", "requirements-test.txt")
217218
with open("requirements-test.txt") as rtfile:
@@ -224,9 +225,9 @@ def _session_tests(
224225
post_install(session)
225226

226227
if "pytest-parallel" in packages:
227-
concurrent_args.extend(['--workers', 'auto', '--tests-per-worker', 'auto'])
228+
concurrent_args.extend(["--workers", "auto", "--tests-per-worker", "auto"])
228229
elif "pytest-xdist" in packages:
229-
concurrent_args.extend(['-n', 'auto'])
230+
concurrent_args.extend(["-n", "auto"])
230231

231232
session.run(
232233
"pytest",
@@ -256,7 +257,7 @@ def py(session: nox.sessions.Session) -> None:
256257

257258

258259
def _get_repo_root() -> Optional[str]:
259-
""" Returns the root folder of the project. """
260+
"""Returns the root folder of the project."""
260261
# Get root of this repository. Assume we don't have directories nested deeper than 10 items.
261262
p = Path(os.getcwd())
262263
for i in range(10):

Dialogflow-CX/streaming_detect_intent_partial_response.py

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,9 @@ def run_sample():
2929
location = "YOUR-LOCATION-ID"
3030
agent_id = "YOUR-AGENT-ID"
3131
audio_file_name = "YOUR-AUDIO-FILE-PATH"
32-
encoding = 'AUDIO_ENCODING_LINEAR_16'
32+
encoding = "AUDIO_ENCODING_LINEAR_16"
3333
sample_rate_hertz = 16000
34-
language_code = 'en'
34+
language_code = "en"
3535

3636
streaming_detect_intent_partial_response(
3737
project_id,
@@ -93,16 +93,16 @@ def request_generator():
9393
break
9494
# The later requests contains audio data.
9595
audio_input = session.AudioInput(audio=chunk, config=config)
96-
query_input = session.QueryInput(audio=audio_input, language_code=language_code)
96+
query_input = session.QueryInput(
97+
audio=audio_input, language_code=language_code
98+
)
9799
yield session.StreamingDetectIntentRequest(
98100
session=session_path,
99101
query_input=query_input,
100102
enable_partial_response=True,
101103
)
102104

103-
responses = session_client.streaming_detect_intent(
104-
requests=request_generator()
105-
)
105+
responses = session_client.streaming_detect_intent(requests=request_generator())
106106

107107
print("=" * 20)
108108
for response in responses:
@@ -116,6 +116,8 @@ def request_generator():
116116
" ".join(msg.text.text) for msg in response.query_result.response_messages
117117
]
118118
print(f"Response text: {' '.join(response_messages)}\n")
119+
120+
119121
# [END dialogflow_cx_streaming_detect_intent_enable_partial_response]
120122

121123

0 commit comments

Comments
 (0)