1616"""Dialogflow API Python sample showing how to manage Participants.
1717"""
1818
19+ import google .auth
1920from google .cloud import dialogflow_v2beta1 as dialogflow
2021
2122ROLES = ["HUMAN_AGENT" , "AUTOMATED_AGENT" , "END_USER" ]
@@ -112,12 +113,11 @@ def analyze_content_text(project_id, conversation_id, participant_id, text):
112113
113114# [START dialogflow_analyze_content_audio_stream]
114115def analyze_content_audio_stream (
115- project_id , conversation_id , participant_id , audio_file_path
116+ conversation_id , participant_id , audio_file_path
116117):
117118 """Analyze audio content for END_USER
118119
119120 Args:
120- project_id: The GCP project linked with the conversation profile.
121121 conversation_id: Id of the conversation.
122122 participant_id: Id of the participant.
123123 audio_file_path: audio file in wav/mp3 format contains utterances of END_USER."""
@@ -127,7 +127,8 @@ def analyze_content_audio_stream(
127127 # After completing all of your requests, call the "__exit__()" method to safely
128128 # clean up any remaining background resources. Alternatively, use the client as
129129 # a context manager.
130- client = dialogflow .ParticipantsClient ()
130+ credentials , project_id = google .auth .default ()
131+ client = dialogflow .ParticipantsClient (credentials = credentials )
131132
132133 participant_path = client .participant_path (
133134 project_id , conversation_id , participant_id
0 commit comments