Skip to content
This repository has been archived by the owner on Jan 6, 2024. It is now read-only.

Commit

Permalink
feat: extended CreateAgent timeout to 180 seconds (#519)
Browse files Browse the repository at this point in the history
* 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>
  • Loading branch information
gcf-owl-bot[bot] and gcf-owl-bot[bot] committed May 8, 2023
1 parent 02efcc4 commit 6da4342
Show file tree
Hide file tree
Showing 25 changed files with 484 additions and 48 deletions.
2 changes: 2 additions & 0 deletions google/cloud/dialogflowcx/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -219,6 +219,7 @@
UpdateSecuritySettingsRequest,
)
from google.cloud.dialogflowcx_v3.types.session import AudioInput
from google.cloud.dialogflowcx_v3.types.session import CloudConversationDebuggingInfo
from google.cloud.dialogflowcx_v3.types.session import DetectIntentRequest
from google.cloud.dialogflowcx_v3.types.session import DetectIntentResponse
from google.cloud.dialogflowcx_v3.types.session import DtmfInput
Expand Down Expand Up @@ -485,6 +486,7 @@
"SecuritySettings",
"UpdateSecuritySettingsRequest",
"AudioInput",
"CloudConversationDebuggingInfo",
"DetectIntentRequest",
"DetectIntentResponse",
"DtmfInput",
Expand Down
2 changes: 2 additions & 0 deletions google/cloud/dialogflowcx_v3/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,7 @@
from .types.security_settings import SecuritySettings
from .types.security_settings import UpdateSecuritySettingsRequest
from .types.session import AudioInput
from .types.session import CloudConversationDebuggingInfo
from .types.session import DetectIntentRequest
from .types.session import DetectIntentResponse
from .types.session import DtmfInput
Expand Down Expand Up @@ -289,6 +290,7 @@
"CalculateCoverageResponse",
"Changelog",
"ChangelogsClient",
"CloudConversationDebuggingInfo",
"CompareVersionsRequest",
"CompareVersionsResponse",
"ContinuousTestResult",
Expand Down
11 changes: 10 additions & 1 deletion google/cloud/dialogflowcx_v3/services/agents/async_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -573,7 +573,16 @@ async def sample_create_agent():
# and friendly error handling.
rpc = gapic_v1.method_async.wrap_method(
self._client._transport.create_agent,
default_timeout=None,
default_retry=retries.Retry(
initial=0.1,
maximum=60.0,
multiplier=1.3,
predicate=retries.if_exception_type(
core_exceptions.ServiceUnavailable,
),
deadline=180.0,
),
default_timeout=180.0,
client_info=DEFAULT_CLIENT_INFO,
)

Expand Down
11 changes: 10 additions & 1 deletion google/cloud/dialogflowcx_v3/services/agents/transports/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,16 @@ def _prep_wrapped_messages(self, client_info):
),
self.create_agent: gapic_v1.method.wrap_method(
self.create_agent,
default_timeout=None,
default_retry=retries.Retry(
initial=0.1,
maximum=60.0,
multiplier=1.3,
predicate=retries.if_exception_type(
core_exceptions.ServiceUnavailable,
),
deadline=180.0,
),
default_timeout=180.0,
client_info=client_info,
),
self.update_agent: gapic_v1.method.wrap_method(
Expand Down
2 changes: 2 additions & 0 deletions google/cloud/dialogflowcx_v3/types/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,7 @@
)
from .session import (
AudioInput,
CloudConversationDebuggingInfo,
DetectIntentRequest,
DetectIntentResponse,
DtmfInput,
Expand Down Expand Up @@ -381,6 +382,7 @@
"SecuritySettings",
"UpdateSecuritySettingsRequest",
"AudioInput",
"CloudConversationDebuggingInfo",
"DetectIntentRequest",
"DetectIntentResponse",
"DtmfInput",
Expand Down
2 changes: 1 addition & 1 deletion google/cloud/dialogflowcx_v3/types/agent.py
Original file line number Diff line number Diff line change
Expand Up @@ -430,7 +430,7 @@ class ExportAgentResponse(proto.Message):
Attributes:
agent_uri (str):
The URI to a file containing the exported agent. This field
is populated only if ``agent_uri`` is specified in
is populated if ``agent_uri`` is specified in
[ExportAgentRequest][google.cloud.dialogflow.cx.v3.ExportAgentRequest].
This field is a member of `oneof`_ ``agent``.
Expand Down
26 changes: 21 additions & 5 deletions google/cloud/dialogflowcx_v3/types/audio_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -294,7 +294,13 @@ class InputAudioConfig(proto.Message):
using the standard version of the specified model. Refer to
`Cloud Speech API
documentation <https://cloud.google.com/speech-to-text/docs/basics#select-model>`__
for more details.
for more details. If you specify a model, the following
models typically have the best performance:
- phone_call (best for Agent Assist and telephony)
- latest_short (best for Dialogflow non-telephony)
- command_and_search (best for very short utterances and
commands)
model_variant (google.cloud.dialogflowcx_v3.types.SpeechModelVariant):
Optional. Which variant of the [Speech
model][google.cloud.dialogflow.cx.v3.InputAudioConfig.model]
Expand Down Expand Up @@ -475,14 +481,24 @@ class OutputAudioConfig(proto.Message):


class TextToSpeechSettings(proto.Message):
r"""Settings related to speech generating.
r"""Settings related to speech synthesizing.
Attributes:
synthesize_speech_configs (MutableMapping[str, google.cloud.dialogflowcx_v3.types.SynthesizeSpeechConfig]):
Configuration of how speech should be
synthesized, mapping from language
(https://dialogflow.com/docs/reference/language)
Configuration of how speech should be synthesized, mapping
from language
(https://cloud.google.com/dialogflow/cx/docs/reference/language)
to SynthesizeSpeechConfig.
These settings affect:
- The synthesize configuration used in `phone
gateway <https://cloud.google.com/dialogflow/cx/docs/concept/integration/phone-gateway>`__.
- You no longer need to specify
[OutputAudioConfig.synthesize_speech_config][google.cloud.dialogflow.cx.v3.OutputAudioConfig.synthesize_speech_config]
when invoking API calls. Your agent will use the
pre-configured options for speech synthesizing.
"""

synthesize_speech_configs: MutableMapping[
Expand Down
10 changes: 5 additions & 5 deletions google/cloud/dialogflowcx_v3/types/gcs.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,11 @@ class GcsDestination(proto.Message):
Attributes:
uri (str):
Required. The Google Cloud Storage URI for
the exported objects. A URI is of the form:
gs://bucket/object-name-or-prefix
Whether a full object name, or just a prefix,
its usage depends on the Dialogflow operation.
Required. The Google Cloud Storage URI for the exported
objects. A URI is of the form:
``gs://bucket/object-name-or-prefix`` Whether a full object
name, or just a prefix, its usage depends on the Dialogflow
operation.
"""

uri: str = proto.Field(
Expand Down
171 changes: 169 additions & 2 deletions google/cloud/dialogflowcx_v3/types/session.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
"DetectIntentRequest",
"DetectIntentResponse",
"StreamingDetectIntentRequest",
"CloudConversationDebuggingInfo",
"StreamingDetectIntentResponse",
"StreamingRecognitionResult",
"QueryParameters",
Expand Down Expand Up @@ -259,6 +260,9 @@ class StreamingDetectIntentRequest(proto.Message):
enabled, response stream still contains only one final
``DetectIntentResponse`` even if some ``Fulfillment``\ s in
the agent have been configured to return partial responses.
enable_debugging_info (bool):
If true, ``StreamingDetectIntentResponse.debugging_info``
will get populated.
"""

session: str = proto.Field(
Expand All @@ -284,6 +288,157 @@ class StreamingDetectIntentRequest(proto.Message):
proto.BOOL,
number=5,
)
enable_debugging_info: bool = proto.Field(
proto.BOOL,
number=8,
)


class CloudConversationDebuggingInfo(proto.Message):
r"""Cloud conversation info for easier debugging. It will get populated
in ``StreamingDetectIntentResponse`` or
``StreamingAnalyzeContentResponse`` when the flag
``enable_debugging_info`` is set to true in corresponding requests.
Attributes:
audio_data_chunks (int):
Number of input audio data chunks in
streaming requests.
result_end_time_offset (google.protobuf.duration_pb2.Duration):
Time offset of the end of speech utterance
relative to the beginning of the first audio
chunk.
first_audio_duration (google.protobuf.duration_pb2.Duration):
Duration of first audio chunk.
single_utterance (bool):
Whether client used single utterance mode.
speech_partial_results_end_times (MutableSequence[google.protobuf.duration_pb2.Duration]):
Time offsets of the speech partial results
relative to the beginning of the stream.
speech_final_results_end_times (MutableSequence[google.protobuf.duration_pb2.Duration]):
Time offsets of the speech final results (is_final=true)
relative to the beginning of the stream.
partial_responses (int):
Total number of partial responses.
speaker_id_passive_latency_ms_offset (int):
Time offset of Speaker ID stream close time
relative to the Speech stream close time in
milliseconds. Only meaningful for conversations
involving passive verification.
bargein_event_triggered (bool):
Whether a barge-in event is triggered in this
request.
speech_single_utterance (bool):
Whether speech uses single utterance mode.
dtmf_partial_results_times (MutableSequence[google.protobuf.duration_pb2.Duration]):
Time offsets of the DTMF partial results
relative to the beginning of the stream.
dtmf_final_results_times (MutableSequence[google.protobuf.duration_pb2.Duration]):
Time offsets of the DTMF final results
relative to the beginning of the stream.
single_utterance_end_time_offset (google.protobuf.duration_pb2.Duration):
Time offset of the end-of-single-utterance
signal relative to the beginning of the stream.
no_speech_timeout (google.protobuf.duration_pb2.Duration):
No speech timeout settings observed at
runtime.
is_input_text (bool):
Whether the streaming terminates with an
injected text query.
client_half_close_time_offset (google.protobuf.duration_pb2.Duration):
Client half close time in terms of input
audio duration.
client_half_close_streaming_time_offset (google.protobuf.duration_pb2.Duration):
Client half close time in terms of API
streaming duration.
"""

audio_data_chunks: int = proto.Field(
proto.INT32,
number=1,
)
result_end_time_offset: duration_pb2.Duration = proto.Field(
proto.MESSAGE,
number=2,
message=duration_pb2.Duration,
)
first_audio_duration: duration_pb2.Duration = proto.Field(
proto.MESSAGE,
number=3,
message=duration_pb2.Duration,
)
single_utterance: bool = proto.Field(
proto.BOOL,
number=5,
)
speech_partial_results_end_times: MutableSequence[
duration_pb2.Duration
] = proto.RepeatedField(
proto.MESSAGE,
number=6,
message=duration_pb2.Duration,
)
speech_final_results_end_times: MutableSequence[
duration_pb2.Duration
] = proto.RepeatedField(
proto.MESSAGE,
number=7,
message=duration_pb2.Duration,
)
partial_responses: int = proto.Field(
proto.INT32,
number=8,
)
speaker_id_passive_latency_ms_offset: int = proto.Field(
proto.INT32,
number=9,
)
bargein_event_triggered: bool = proto.Field(
proto.BOOL,
number=10,
)
speech_single_utterance: bool = proto.Field(
proto.BOOL,
number=11,
)
dtmf_partial_results_times: MutableSequence[
duration_pb2.Duration
] = proto.RepeatedField(
proto.MESSAGE,
number=12,
message=duration_pb2.Duration,
)
dtmf_final_results_times: MutableSequence[
duration_pb2.Duration
] = proto.RepeatedField(
proto.MESSAGE,
number=13,
message=duration_pb2.Duration,
)
single_utterance_end_time_offset: duration_pb2.Duration = proto.Field(
proto.MESSAGE,
number=14,
message=duration_pb2.Duration,
)
no_speech_timeout: duration_pb2.Duration = proto.Field(
proto.MESSAGE,
number=15,
message=duration_pb2.Duration,
)
is_input_text: bool = proto.Field(
proto.BOOL,
number=16,
)
client_half_close_time_offset: duration_pb2.Duration = proto.Field(
proto.MESSAGE,
number=17,
message=duration_pb2.Duration,
)
client_half_close_streaming_time_offset: duration_pb2.Duration = proto.Field(
proto.MESSAGE,
number=18,
message=duration_pb2.Duration,
)


class StreamingDetectIntentResponse(proto.Message):
Expand Down Expand Up @@ -332,6 +487,10 @@ class StreamingDetectIntentResponse(proto.Message):
The response from detect intent.
This field is a member of `oneof`_ ``response``.
debugging_info (google.cloud.dialogflowcx_v3.types.CloudConversationDebuggingInfo):
Debugging info that would get populated when
``StreamingDetectIntentRequest.enable_debugging_info`` is
set to true.
"""

recognition_result: "StreamingRecognitionResult" = proto.Field(
Expand All @@ -346,6 +505,11 @@ class StreamingDetectIntentResponse(proto.Message):
oneof="response",
message="DetectIntentResponse",
)
debugging_info: "CloudConversationDebuggingInfo" = proto.Field(
proto.MESSAGE,
number=4,
message="CloudConversationDebuggingInfo",
)


class StreamingRecognitionResult(proto.Message):
Expand Down Expand Up @@ -679,6 +843,8 @@ class QueryInput(proto.Message):
4. An event to be triggered.
5. DTMF digits to invoke an intent and fill in parameter value.
This message has `oneof`_ fields (mutually exclusive fields).
For each oneof, at most one member field can be set at the same time.
Setting any member of the oneof automatically clears all other
Expand Down Expand Up @@ -790,8 +956,9 @@ class QueryResult(proto.Message):
This field is a member of `oneof`_ ``query``.
dtmf (google.cloud.dialogflowcx_v3.types.DtmfInput):
If a [DTMF][DTMFInput] was provided as input, this field
will contain a copy of the [DTMFInput][].
If a [DTMF][google.cloud.dialogflow.cx.v3.DtmfInput] was
provided as input, this field will contain a copy of the
[DtmfInput][google.cloud.dialogflow.cx.v3.DtmfInput].
This field is a member of `oneof`_ ``query``.
language_code (str):
Expand Down
Loading

0 comments on commit 6da4342

Please sign in to comment.