Skip to content

Commit c58a92e

Browse files
feat: extended CreateAgent timeout to 180 seconds (#519)
* feat: extended CreateAgent timeout to 180 seconds feat: added debug info to StreamingDetectIntent feat: added dtmf digits to WebhookRequest feat: added FLOW as a new DiffType in TestRunDifference PiperOrigin-RevId: 529897408 Source-Link: googleapis/googleapis@4de416f Source-Link: googleapis/googleapis-gen@a9b661f Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiYTliNjYxZjlmZWI3NWUyODAzZmUxYjViNjM1ZTM1Yjg5Y2IxYmM3NiJ9 * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md * feat: extended CreateAgent timeout to 180 seconds feat: added debug info to StreamingDetectIntent feat: added dtmf digits to WebhookRequest feat: added FLOW as a new DiffType in TestRunDifference PiperOrigin-RevId: 530032469 Source-Link: googleapis/googleapis@ff708e3 Source-Link: googleapis/googleapis-gen@0578b38 Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiMDU3OGIzOGM2OGYwMjkzMjhhMjBiYWMyMmIyODgzNTNiZGFhYzRiNyJ9 * 🦉 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 81f2811 commit c58a92e

File tree

25 files changed

+484
-48
lines changed

25 files changed

+484
-48
lines changed

packages/google-cloud-dialogflow-cx/google/cloud/dialogflowcx/__init__.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -219,6 +219,7 @@
219219
UpdateSecuritySettingsRequest,
220220
)
221221
from google.cloud.dialogflowcx_v3.types.session import AudioInput
222+
from google.cloud.dialogflowcx_v3.types.session import CloudConversationDebuggingInfo
222223
from google.cloud.dialogflowcx_v3.types.session import DetectIntentRequest
223224
from google.cloud.dialogflowcx_v3.types.session import DetectIntentResponse
224225
from google.cloud.dialogflowcx_v3.types.session import DtmfInput
@@ -485,6 +486,7 @@
485486
"SecuritySettings",
486487
"UpdateSecuritySettingsRequest",
487488
"AudioInput",
489+
"CloudConversationDebuggingInfo",
488490
"DetectIntentRequest",
489491
"DetectIntentResponse",
490492
"DtmfInput",

packages/google-cloud-dialogflow-cx/google/cloud/dialogflowcx_v3/__init__.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -167,6 +167,7 @@
167167
from .types.security_settings import SecuritySettings
168168
from .types.security_settings import UpdateSecuritySettingsRequest
169169
from .types.session import AudioInput
170+
from .types.session import CloudConversationDebuggingInfo
170171
from .types.session import DetectIntentRequest
171172
from .types.session import DetectIntentResponse
172173
from .types.session import DtmfInput
@@ -289,6 +290,7 @@
289290
"CalculateCoverageResponse",
290291
"Changelog",
291292
"ChangelogsClient",
293+
"CloudConversationDebuggingInfo",
292294
"CompareVersionsRequest",
293295
"CompareVersionsResponse",
294296
"ContinuousTestResult",

packages/google-cloud-dialogflow-cx/google/cloud/dialogflowcx_v3/services/agents/async_client.py

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -573,7 +573,16 @@ async def sample_create_agent():
573573
# and friendly error handling.
574574
rpc = gapic_v1.method_async.wrap_method(
575575
self._client._transport.create_agent,
576-
default_timeout=None,
576+
default_retry=retries.Retry(
577+
initial=0.1,
578+
maximum=60.0,
579+
multiplier=1.3,
580+
predicate=retries.if_exception_type(
581+
core_exceptions.ServiceUnavailable,
582+
),
583+
deadline=180.0,
584+
),
585+
default_timeout=180.0,
577586
client_info=DEFAULT_CLIENT_INFO,
578587
)
579588

packages/google-cloud-dialogflow-cx/google/cloud/dialogflowcx_v3/services/agents/transports/base.py

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,16 @@ def _prep_wrapped_messages(self, client_info):
144144
),
145145
self.create_agent: gapic_v1.method.wrap_method(
146146
self.create_agent,
147-
default_timeout=None,
147+
default_retry=retries.Retry(
148+
initial=0.1,
149+
maximum=60.0,
150+
multiplier=1.3,
151+
predicate=retries.if_exception_type(
152+
core_exceptions.ServiceUnavailable,
153+
),
154+
deadline=180.0,
155+
),
156+
default_timeout=180.0,
148157
client_info=client_info,
149158
),
150159
self.update_agent: gapic_v1.method.wrap_method(

packages/google-cloud-dialogflow-cx/google/cloud/dialogflowcx_v3/types/__init__.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -160,6 +160,7 @@
160160
)
161161
from .session import (
162162
AudioInput,
163+
CloudConversationDebuggingInfo,
163164
DetectIntentRequest,
164165
DetectIntentResponse,
165166
DtmfInput,
@@ -381,6 +382,7 @@
381382
"SecuritySettings",
382383
"UpdateSecuritySettingsRequest",
383384
"AudioInput",
385+
"CloudConversationDebuggingInfo",
384386
"DetectIntentRequest",
385387
"DetectIntentResponse",
386388
"DtmfInput",

packages/google-cloud-dialogflow-cx/google/cloud/dialogflowcx_v3/types/agent.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -430,7 +430,7 @@ class ExportAgentResponse(proto.Message):
430430
Attributes:
431431
agent_uri (str):
432432
The URI to a file containing the exported agent. This field
433-
is populated only if ``agent_uri`` is specified in
433+
is populated if ``agent_uri`` is specified in
434434
[ExportAgentRequest][google.cloud.dialogflow.cx.v3.ExportAgentRequest].
435435
436436
This field is a member of `oneof`_ ``agent``.

packages/google-cloud-dialogflow-cx/google/cloud/dialogflowcx_v3/types/audio_config.py

Lines changed: 21 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -294,7 +294,13 @@ class InputAudioConfig(proto.Message):
294294
using the standard version of the specified model. Refer to
295295
`Cloud Speech API
296296
documentation <https://cloud.google.com/speech-to-text/docs/basics#select-model>`__
297-
for more details.
297+
for more details. If you specify a model, the following
298+
models typically have the best performance:
299+
300+
- phone_call (best for Agent Assist and telephony)
301+
- latest_short (best for Dialogflow non-telephony)
302+
- command_and_search (best for very short utterances and
303+
commands)
298304
model_variant (google.cloud.dialogflowcx_v3.types.SpeechModelVariant):
299305
Optional. Which variant of the [Speech
300306
model][google.cloud.dialogflow.cx.v3.InputAudioConfig.model]
@@ -475,14 +481,24 @@ class OutputAudioConfig(proto.Message):
475481

476482

477483
class TextToSpeechSettings(proto.Message):
478-
r"""Settings related to speech generating.
484+
r"""Settings related to speech synthesizing.
479485
480486
Attributes:
481487
synthesize_speech_configs (MutableMapping[str, google.cloud.dialogflowcx_v3.types.SynthesizeSpeechConfig]):
482-
Configuration of how speech should be
483-
synthesized, mapping from language
484-
(https://dialogflow.com/docs/reference/language)
488+
Configuration of how speech should be synthesized, mapping
489+
from language
490+
(https://cloud.google.com/dialogflow/cx/docs/reference/language)
485491
to SynthesizeSpeechConfig.
492+
493+
These settings affect:
494+
495+
- The synthesize configuration used in `phone
496+
gateway <https://cloud.google.com/dialogflow/cx/docs/concept/integration/phone-gateway>`__.
497+
498+
- You no longer need to specify
499+
[OutputAudioConfig.synthesize_speech_config][google.cloud.dialogflow.cx.v3.OutputAudioConfig.synthesize_speech_config]
500+
when invoking API calls. Your agent will use the
501+
pre-configured options for speech synthesizing.
486502
"""
487503

488504
synthesize_speech_configs: MutableMapping[

packages/google-cloud-dialogflow-cx/google/cloud/dialogflowcx_v3/types/gcs.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -35,11 +35,11 @@ class GcsDestination(proto.Message):
3535
3636
Attributes:
3737
uri (str):
38-
Required. The Google Cloud Storage URI for
39-
the exported objects. A URI is of the form:
40-
gs://bucket/object-name-or-prefix
41-
Whether a full object name, or just a prefix,
42-
its usage depends on the Dialogflow operation.
38+
Required. The Google Cloud Storage URI for the exported
39+
objects. A URI is of the form:
40+
``gs://bucket/object-name-or-prefix`` Whether a full object
41+
name, or just a prefix, its usage depends on the Dialogflow
42+
operation.
4343
"""
4444

4545
uri: str = proto.Field(

packages/google-cloud-dialogflow-cx/google/cloud/dialogflowcx_v3/types/session.py

Lines changed: 169 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@
3636
"DetectIntentRequest",
3737
"DetectIntentResponse",
3838
"StreamingDetectIntentRequest",
39+
"CloudConversationDebuggingInfo",
3940
"StreamingDetectIntentResponse",
4041
"StreamingRecognitionResult",
4142
"QueryParameters",
@@ -259,6 +260,9 @@ class StreamingDetectIntentRequest(proto.Message):
259260
enabled, response stream still contains only one final
260261
``DetectIntentResponse`` even if some ``Fulfillment``\ s in
261262
the agent have been configured to return partial responses.
263+
enable_debugging_info (bool):
264+
If true, ``StreamingDetectIntentResponse.debugging_info``
265+
will get populated.
262266
"""
263267

264268
session: str = proto.Field(
@@ -284,6 +288,157 @@ class StreamingDetectIntentRequest(proto.Message):
284288
proto.BOOL,
285289
number=5,
286290
)
291+
enable_debugging_info: bool = proto.Field(
292+
proto.BOOL,
293+
number=8,
294+
)
295+
296+
297+
class CloudConversationDebuggingInfo(proto.Message):
298+
r"""Cloud conversation info for easier debugging. It will get populated
299+
in ``StreamingDetectIntentResponse`` or
300+
``StreamingAnalyzeContentResponse`` when the flag
301+
``enable_debugging_info`` is set to true in corresponding requests.
302+
303+
Attributes:
304+
audio_data_chunks (int):
305+
Number of input audio data chunks in
306+
streaming requests.
307+
result_end_time_offset (google.protobuf.duration_pb2.Duration):
308+
Time offset of the end of speech utterance
309+
relative to the beginning of the first audio
310+
chunk.
311+
first_audio_duration (google.protobuf.duration_pb2.Duration):
312+
Duration of first audio chunk.
313+
single_utterance (bool):
314+
Whether client used single utterance mode.
315+
speech_partial_results_end_times (MutableSequence[google.protobuf.duration_pb2.Duration]):
316+
Time offsets of the speech partial results
317+
relative to the beginning of the stream.
318+
speech_final_results_end_times (MutableSequence[google.protobuf.duration_pb2.Duration]):
319+
Time offsets of the speech final results (is_final=true)
320+
relative to the beginning of the stream.
321+
partial_responses (int):
322+
Total number of partial responses.
323+
speaker_id_passive_latency_ms_offset (int):
324+
Time offset of Speaker ID stream close time
325+
relative to the Speech stream close time in
326+
milliseconds. Only meaningful for conversations
327+
involving passive verification.
328+
bargein_event_triggered (bool):
329+
Whether a barge-in event is triggered in this
330+
request.
331+
speech_single_utterance (bool):
332+
Whether speech uses single utterance mode.
333+
dtmf_partial_results_times (MutableSequence[google.protobuf.duration_pb2.Duration]):
334+
Time offsets of the DTMF partial results
335+
relative to the beginning of the stream.
336+
dtmf_final_results_times (MutableSequence[google.protobuf.duration_pb2.Duration]):
337+
Time offsets of the DTMF final results
338+
relative to the beginning of the stream.
339+
single_utterance_end_time_offset (google.protobuf.duration_pb2.Duration):
340+
Time offset of the end-of-single-utterance
341+
signal relative to the beginning of the stream.
342+
no_speech_timeout (google.protobuf.duration_pb2.Duration):
343+
No speech timeout settings observed at
344+
runtime.
345+
is_input_text (bool):
346+
Whether the streaming terminates with an
347+
injected text query.
348+
client_half_close_time_offset (google.protobuf.duration_pb2.Duration):
349+
Client half close time in terms of input
350+
audio duration.
351+
client_half_close_streaming_time_offset (google.protobuf.duration_pb2.Duration):
352+
Client half close time in terms of API
353+
streaming duration.
354+
"""
355+
356+
audio_data_chunks: int = proto.Field(
357+
proto.INT32,
358+
number=1,
359+
)
360+
result_end_time_offset: duration_pb2.Duration = proto.Field(
361+
proto.MESSAGE,
362+
number=2,
363+
message=duration_pb2.Duration,
364+
)
365+
first_audio_duration: duration_pb2.Duration = proto.Field(
366+
proto.MESSAGE,
367+
number=3,
368+
message=duration_pb2.Duration,
369+
)
370+
single_utterance: bool = proto.Field(
371+
proto.BOOL,
372+
number=5,
373+
)
374+
speech_partial_results_end_times: MutableSequence[
375+
duration_pb2.Duration
376+
] = proto.RepeatedField(
377+
proto.MESSAGE,
378+
number=6,
379+
message=duration_pb2.Duration,
380+
)
381+
speech_final_results_end_times: MutableSequence[
382+
duration_pb2.Duration
383+
] = proto.RepeatedField(
384+
proto.MESSAGE,
385+
number=7,
386+
message=duration_pb2.Duration,
387+
)
388+
partial_responses: int = proto.Field(
389+
proto.INT32,
390+
number=8,
391+
)
392+
speaker_id_passive_latency_ms_offset: int = proto.Field(
393+
proto.INT32,
394+
number=9,
395+
)
396+
bargein_event_triggered: bool = proto.Field(
397+
proto.BOOL,
398+
number=10,
399+
)
400+
speech_single_utterance: bool = proto.Field(
401+
proto.BOOL,
402+
number=11,
403+
)
404+
dtmf_partial_results_times: MutableSequence[
405+
duration_pb2.Duration
406+
] = proto.RepeatedField(
407+
proto.MESSAGE,
408+
number=12,
409+
message=duration_pb2.Duration,
410+
)
411+
dtmf_final_results_times: MutableSequence[
412+
duration_pb2.Duration
413+
] = proto.RepeatedField(
414+
proto.MESSAGE,
415+
number=13,
416+
message=duration_pb2.Duration,
417+
)
418+
single_utterance_end_time_offset: duration_pb2.Duration = proto.Field(
419+
proto.MESSAGE,
420+
number=14,
421+
message=duration_pb2.Duration,
422+
)
423+
no_speech_timeout: duration_pb2.Duration = proto.Field(
424+
proto.MESSAGE,
425+
number=15,
426+
message=duration_pb2.Duration,
427+
)
428+
is_input_text: bool = proto.Field(
429+
proto.BOOL,
430+
number=16,
431+
)
432+
client_half_close_time_offset: duration_pb2.Duration = proto.Field(
433+
proto.MESSAGE,
434+
number=17,
435+
message=duration_pb2.Duration,
436+
)
437+
client_half_close_streaming_time_offset: duration_pb2.Duration = proto.Field(
438+
proto.MESSAGE,
439+
number=18,
440+
message=duration_pb2.Duration,
441+
)
287442

288443

289444
class StreamingDetectIntentResponse(proto.Message):
@@ -332,6 +487,10 @@ class StreamingDetectIntentResponse(proto.Message):
332487
The response from detect intent.
333488
334489
This field is a member of `oneof`_ ``response``.
490+
debugging_info (google.cloud.dialogflowcx_v3.types.CloudConversationDebuggingInfo):
491+
Debugging info that would get populated when
492+
``StreamingDetectIntentRequest.enable_debugging_info`` is
493+
set to true.
335494
"""
336495

337496
recognition_result: "StreamingRecognitionResult" = proto.Field(
@@ -346,6 +505,11 @@ class StreamingDetectIntentResponse(proto.Message):
346505
oneof="response",
347506
message="DetectIntentResponse",
348507
)
508+
debugging_info: "CloudConversationDebuggingInfo" = proto.Field(
509+
proto.MESSAGE,
510+
number=4,
511+
message="CloudConversationDebuggingInfo",
512+
)
349513

350514

351515
class StreamingRecognitionResult(proto.Message):
@@ -679,6 +843,8 @@ class QueryInput(proto.Message):
679843
680844
4. An event to be triggered.
681845
846+
5. DTMF digits to invoke an intent and fill in parameter value.
847+
682848
This message has `oneof`_ fields (mutually exclusive fields).
683849
For each oneof, at most one member field can be set at the same time.
684850
Setting any member of the oneof automatically clears all other
@@ -790,8 +956,9 @@ class QueryResult(proto.Message):
790956
791957
This field is a member of `oneof`_ ``query``.
792958
dtmf (google.cloud.dialogflowcx_v3.types.DtmfInput):
793-
If a [DTMF][DTMFInput] was provided as input, this field
794-
will contain a copy of the [DTMFInput][].
959+
If a [DTMF][google.cloud.dialogflow.cx.v3.DtmfInput] was
960+
provided as input, this field will contain a copy of the
961+
[DtmfInput][google.cloud.dialogflow.cx.v3.DtmfInput].
795962
796963
This field is a member of `oneof`_ ``query``.
797964
language_code (str):

0 commit comments

Comments
 (0)