Skip to content

Commit d5147b8

Browse files
chore: use gapic-generator-python 0.63.1 (#245)
- [x] Regenerate this pull request now. docs: add autogenerated code snippets PiperOrigin-RevId: 426256923 Source-Link: googleapis/googleapis@9ebabfa Source-Link: https://github.com/googleapis/googleapis-gen/commit/a88175263e60a1d45d3a447848652b0f670b2cb8 Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiYTg4MTc1MjYzZTYwYTFkNDVkM2E0NDc4NDg2NTJiMGY2NzBiMmNiOCJ9 Fixes #229
1 parent 9d3154f commit d5147b8

File tree

6 files changed

+24
-11
lines changed

6 files changed

+24
-11
lines changed

Dialogflow-CX/create_agent.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,4 +35,6 @@ def create_agent(project_id, display_name):
3535
response = agents_client.create_agent(request={"agent": agent, "parent": parent})
3636

3737
return response
38+
39+
3840
## [END dialogflow_cx_create_agent_sample]

Dialogflow-CX/detect_intent_stream.py

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -79,17 +79,23 @@ def request_generator():
7979

8080
# Sets the voice name and gender
8181
voice_selection.name = "en-GB-Standard-A"
82-
voice_selection.ssml_gender = audio_config.SsmlVoiceGender.SSML_VOICE_GENDER_FEMALE
82+
voice_selection.ssml_gender = (
83+
audio_config.SsmlVoiceGender.SSML_VOICE_GENDER_FEMALE
84+
)
8385

8486
synthesize_speech_config.voice = voice_selection
8587

8688
# Sets the audio encoding
87-
output_audio_config.audio_encoding = audio_config.OutputAudioEncoding.OUTPUT_AUDIO_ENCODING_UNSPECIFIED
89+
output_audio_config.audio_encoding = (
90+
audio_config.OutputAudioEncoding.OUTPUT_AUDIO_ENCODING_UNSPECIFIED
91+
)
8892
output_audio_config.synthesize_speech_config = synthesize_speech_config
8993

9094
# The first request contains the configuration.
9195
yield session.StreamingDetectIntentRequest(
92-
session=session_path, query_input=query_input, output_audio_config=output_audio_config
96+
session=session_path,
97+
query_input=query_input,
98+
output_audio_config=output_audio_config,
9399
)
94100

95101
# Here we are reading small chunks of audio data from a local

Dialogflow-CX/long_running_operation.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,18 +22,22 @@
2222

2323
def export_long_running_agent(project_id, agent_id, location):
2424

25-
api_endpoint = f'{location}-dialogflow.googleapis.com:443'
25+
api_endpoint = f"{location}-dialogflow.googleapis.com:443"
2626
client_options = {"api_endpoint": api_endpoint}
2727

2828
agents_client = AgentsClient(client_options=client_options)
2929

3030
export_request = ExportAgentRequest()
3131

32-
export_request.name = f'projects/{project_id}/locations/{location}/agents/{agent_id}'
32+
export_request.name = (
33+
f"projects/{project_id}/locations/{location}/agents/{agent_id}"
34+
)
3335

3436
# export_agent returns a long running operation
3537
operation = agents_client.export_agent(request=export_request)
3638

3739
# Returns the result of the operation when the operation is done
3840
return operation.result()
41+
42+
3943
## [END dialogflow_cx_long_running_snippet]

Dialogflow-CX/update_intent.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,4 +28,6 @@ def update_intent(project_id, agent_id, intent_id, location, displayName):
2828
update_mask = field_mask_pb2.FieldMask(paths=["display_name"])
2929
response = intents_client.update_intent(intent=intent, update_mask=update_mask)
3030
return response
31+
32+
3133
# [END dialogflow_cx_update_intent]

Dialogflow-CX/webhook.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
# See the License for the specific language governing permissions and
1212
# limitations under the License.
1313

14-
''' handle_webhook will return the correct fullfilment response dependong the tag that is sent in the request'''
14+
""" handle_webhook will return the correct fullfilment response dependong the tag that is sent in the request"""
1515

1616
# [START dialogflow_cx_webhook]
1717

@@ -56,4 +56,5 @@ def handle_webhook(request):
5656
# Returns json
5757
return res
5858

59+
5960
# [END dialogflow_cx_webhook]

Dialogflow-CX/webhook_test.py

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,17 +20,15 @@
2020

2121
# Create a fake 'app' for generating test request contexts.
2222

23-
request = {
24-
"fulfillmentInfo": {"tag": "Default Welcome Intent"}
25-
}
23+
request = {"fulfillmentInfo": {"tag": "Default Welcome Intent"}}
2624

2725

28-
@pytest.fixture(scope='module')
26+
@pytest.fixture(scope="module")
2927
def app():
3028
return flask.Flask(__name__)
3129

3230

3331
def test_handle_webhook(app):
3432
with app.test_request_context(json=request):
3533
res = handle_webhook(flask.request)
36-
assert 'Hi from a GCF Webhook' in str(res)
34+
assert "Hi from a GCF Webhook" in str(res)

0 commit comments

Comments
 (0)