Skip to content

Commit a6ac419

Browse files
Stepan Rasputnygcf-owl-bot[bot]
andauthored
fix: moving imports inside functions (#11422)
* fix: moving imports inside functions * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md --------- Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
1 parent bb8b4c8 commit a6ac419

File tree

2 files changed

+11
-4
lines changed

2 files changed

+11
-4
lines changed

dialogflow/participant_management.py

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,14 +16,13 @@
1616
"""Dialogflow API Python sample showing how to manage Participants.
1717
"""
1818

19-
import google.auth
20-
from google.cloud import dialogflow_v2beta1 as dialogflow
21-
2219
ROLES = ["HUMAN_AGENT", "AUTOMATED_AGENT", "END_USER"]
2320

2421

2522
# [START dialogflow_create_participant]
2623
def create_participant(project_id: str, conversation_id: str, role: str):
24+
from google.cloud import dialogflow_v2beta1 as dialogflow
25+
2726
"""Creates a participant in a given conversation.
2827
2928
Args:
@@ -53,6 +52,8 @@ def create_participant(project_id: str, conversation_id: str, role: str):
5352
def analyze_content_text(
5453
project_id: str, conversation_id: str, participant_id: str, text: str
5554
):
55+
from google.cloud import dialogflow_v2beta1 as dialogflow
56+
5657
"""Analyze text message content from a participant.
5758
5859
Args:
@@ -118,6 +119,9 @@ def analyze_content_text(
118119
def analyze_content_audio(
119120
conversation_id: str, participant_id: str, audio_file_path: str
120121
):
122+
import google.auth
123+
from google.cloud import dialogflow_v2beta1 as dialogflow
124+
121125
"""Analyze audio content for END_USER with audio files.
122126
123127
Args:
@@ -193,6 +197,9 @@ def analyze_content_audio_stream(
193197
language_code: str,
194198
single_utterance=False,
195199
):
200+
import google.auth
201+
from google.cloud import dialogflow_v2beta1 as dialogflow
202+
196203
"""Stream audio streams to Dialogflow and receive transcripts and
197204
suggestions.
198205

dialogflow/requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
google-cloud-dialogflow==2.22.0
22
Flask==2.2.5
3-
pyaudio==0.2.13
3+
pyaudio==0.2.14
44
termcolor==2.4.0
55
functions-framework==3.5.0
66
Werkzeug==3.0.1

0 commit comments

Comments
 (0)