Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 10 additions & 3 deletions dialogflow/participant_management.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,13 @@
"""Dialogflow API Python sample showing how to manage Participants.
"""

import google.auth
from google.cloud import dialogflow_v2beta1 as dialogflow

ROLES = ["HUMAN_AGENT", "AUTOMATED_AGENT", "END_USER"]


# [START dialogflow_create_participant]
def create_participant(project_id: str, conversation_id: str, role: str):
from google.cloud import dialogflow_v2beta1 as dialogflow

"""Creates a participant in a given conversation.

Args:
Expand Down Expand Up @@ -53,6 +52,8 @@ def create_participant(project_id: str, conversation_id: str, role: str):
def analyze_content_text(
project_id: str, conversation_id: str, participant_id: str, text: str
):
from google.cloud import dialogflow_v2beta1 as dialogflow

"""Analyze text message content from a participant.

Args:
Expand Down Expand Up @@ -118,6 +119,9 @@ def analyze_content_text(
def analyze_content_audio(
conversation_id: str, participant_id: str, audio_file_path: str
):
import google.auth
from google.cloud import dialogflow_v2beta1 as dialogflow

"""Analyze audio content for END_USER with audio files.

Args:
Expand Down Expand Up @@ -193,6 +197,9 @@ def analyze_content_audio_stream(
language_code: str,
single_utterance=False,
):
import google.auth
from google.cloud import dialogflow_v2beta1 as dialogflow

"""Stream audio streams to Dialogflow and receive transcripts and
suggestions.

Expand Down
2 changes: 1 addition & 1 deletion dialogflow/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
google-cloud-dialogflow==2.22.0
Flask==2.2.5
pyaudio==0.2.13
pyaudio==0.2.14
termcolor==2.4.0
functions-framework==3.5.0
Werkzeug==3.0.1