diff --git a/.github/.OwlBot.lock.yaml b/.github/.OwlBot.lock.yaml index b8edda51..32b3c486 100644 --- a/.github/.OwlBot.lock.yaml +++ b/.github/.OwlBot.lock.yaml @@ -13,4 +13,5 @@ # limitations under the License. docker: image: gcr.io/cloud-devrel-public-resources/owlbot-python:latest - digest: sha256:2e247c7bf5154df7f98cce087a20ca7605e236340c7d6d1a14447e5c06791bd6 + digest: sha256:9bc5fa3b62b091f60614c08a7fb4fd1d3e1678e326f34dd66ce1eefb5dc3267b +# created: 2023-05-25T14:56:16.294623272Z diff --git a/.kokoro/requirements.txt b/.kokoro/requirements.txt index 66a2172a..3b8d7ee8 100644 --- a/.kokoro/requirements.txt +++ b/.kokoro/requirements.txt @@ -419,9 +419,9 @@ readme-renderer==37.3 \ --hash=sha256:cd653186dfc73055656f090f227f5cb22a046d7f71a841dfa305f55c9a513273 \ --hash=sha256:f67a16caedfa71eef48a31b39708637a6f4664c4394801a7b0d6432d13907343 # via twine -requests==2.28.1 \ - --hash=sha256:7c5599b102feddaa661c826c56ab4fee28bfd17f5abca1ebbe3e7f19d7c97983 \ - --hash=sha256:8fefa2a1a1365bf5520aac41836fbee479da67864514bdb821f31ce07ce65349 +requests==2.31.0 \ + --hash=sha256:58cd2187c01e70e6e26505bca751777aa9f2ee0b7f4300988b709f44e013003f \ + --hash=sha256:942c5a758f98d790eaed1a29cb6eefc7ffb0d1cf7af05c3d2791656dbd6ad1e1 # via # gcp-releasetool # google-api-core diff --git a/.release-please-manifest.json b/.release-please-manifest.json index 1db91d77..2c543c4d 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "1.20.1" + ".": "1.21.0" } diff --git a/CHANGELOG.md b/CHANGELOG.md index 68549c78..0be2276d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,15 @@ # Changelog +## [1.21.0](https://github.com/googleapis/python-dialogflow-cx/compare/v1.20.1...v1.21.0) (2023-05-25) + + +### Features + +* Added debug info to StreamingDetectIntent ([6da4342](https://github.com/googleapis/python-dialogflow-cx/commit/6da4342f5f835f1dd36570d7243852ba9d8afde5)) +* Added dtmf digits to WebhookRequest ([6da4342](https://github.com/googleapis/python-dialogflow-cx/commit/6da4342f5f835f1dd36570d7243852ba9d8afde5)) +* Added FLOW as a new DiffType in TestRunDifference ([6da4342](https://github.com/googleapis/python-dialogflow-cx/commit/6da4342f5f835f1dd36570d7243852ba9d8afde5)) +* Extended CreateAgent timeout to 180 seconds ([6da4342](https://github.com/googleapis/python-dialogflow-cx/commit/6da4342f5f835f1dd36570d7243852ba9d8afde5)) + ## [1.20.1](https://github.com/googleapis/python-dialogflow-cx/compare/v1.20.0...v1.20.1) (2023-03-23) diff --git a/google/cloud/dialogflowcx/__init__.py b/google/cloud/dialogflowcx/__init__.py index 54a45abc..29c0c4ec 100644 --- a/google/cloud/dialogflowcx/__init__.py +++ b/google/cloud/dialogflowcx/__init__.py @@ -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 @@ -485,6 +486,7 @@ "SecuritySettings", "UpdateSecuritySettingsRequest", "AudioInput", + "CloudConversationDebuggingInfo", "DetectIntentRequest", "DetectIntentResponse", "DtmfInput", diff --git a/google/cloud/dialogflowcx/gapic_version.py b/google/cloud/dialogflowcx/gapic_version.py index e908112c..6c9024e0 100644 --- a/google/cloud/dialogflowcx/gapic_version.py +++ b/google/cloud/dialogflowcx/gapic_version.py @@ -13,4 +13,4 @@ # See the License for the specific language governing permissions and # limitations under the License. # -__version__ = "1.20.1" # {x-release-please-version} +__version__ = "1.21.0" # {x-release-please-version} diff --git a/google/cloud/dialogflowcx_v3/__init__.py b/google/cloud/dialogflowcx_v3/__init__.py index ab1eb164..92d7ab49 100644 --- a/google/cloud/dialogflowcx_v3/__init__.py +++ b/google/cloud/dialogflowcx_v3/__init__.py @@ -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 @@ -289,6 +290,7 @@ "CalculateCoverageResponse", "Changelog", "ChangelogsClient", + "CloudConversationDebuggingInfo", "CompareVersionsRequest", "CompareVersionsResponse", "ContinuousTestResult", diff --git a/google/cloud/dialogflowcx_v3/gapic_version.py b/google/cloud/dialogflowcx_v3/gapic_version.py index e908112c..6c9024e0 100644 --- a/google/cloud/dialogflowcx_v3/gapic_version.py +++ b/google/cloud/dialogflowcx_v3/gapic_version.py @@ -13,4 +13,4 @@ # See the License for the specific language governing permissions and # limitations under the License. # -__version__ = "1.20.1" # {x-release-please-version} +__version__ = "1.21.0" # {x-release-please-version} diff --git a/google/cloud/dialogflowcx_v3/services/agents/async_client.py b/google/cloud/dialogflowcx_v3/services/agents/async_client.py index 9b9d606a..77637f6c 100644 --- a/google/cloud/dialogflowcx_v3/services/agents/async_client.py +++ b/google/cloud/dialogflowcx_v3/services/agents/async_client.py @@ -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, ) diff --git a/google/cloud/dialogflowcx_v3/services/agents/transports/base.py b/google/cloud/dialogflowcx_v3/services/agents/transports/base.py index 0128bca3..c783f7b9 100644 --- a/google/cloud/dialogflowcx_v3/services/agents/transports/base.py +++ b/google/cloud/dialogflowcx_v3/services/agents/transports/base.py @@ -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( diff --git a/google/cloud/dialogflowcx_v3/types/__init__.py b/google/cloud/dialogflowcx_v3/types/__init__.py index 6f53c3e8..4f4732e2 100644 --- a/google/cloud/dialogflowcx_v3/types/__init__.py +++ b/google/cloud/dialogflowcx_v3/types/__init__.py @@ -160,6 +160,7 @@ ) from .session import ( AudioInput, + CloudConversationDebuggingInfo, DetectIntentRequest, DetectIntentResponse, DtmfInput, @@ -381,6 +382,7 @@ "SecuritySettings", "UpdateSecuritySettingsRequest", "AudioInput", + "CloudConversationDebuggingInfo", "DetectIntentRequest", "DetectIntentResponse", "DtmfInput", diff --git a/google/cloud/dialogflowcx_v3/types/agent.py b/google/cloud/dialogflowcx_v3/types/agent.py index 85ee687d..74acb5ea 100644 --- a/google/cloud/dialogflowcx_v3/types/agent.py +++ b/google/cloud/dialogflowcx_v3/types/agent.py @@ -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``. diff --git a/google/cloud/dialogflowcx_v3/types/audio_config.py b/google/cloud/dialogflowcx_v3/types/audio_config.py index 64f80bb6..0dee41e2 100644 --- a/google/cloud/dialogflowcx_v3/types/audio_config.py +++ b/google/cloud/dialogflowcx_v3/types/audio_config.py @@ -294,7 +294,13 @@ class InputAudioConfig(proto.Message): using the standard version of the specified model. Refer to `Cloud Speech API documentation `__ - 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] @@ -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 `__. + + - 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[ diff --git a/google/cloud/dialogflowcx_v3/types/gcs.py b/google/cloud/dialogflowcx_v3/types/gcs.py index ed80ec06..57ad5210 100644 --- a/google/cloud/dialogflowcx_v3/types/gcs.py +++ b/google/cloud/dialogflowcx_v3/types/gcs.py @@ -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( diff --git a/google/cloud/dialogflowcx_v3/types/session.py b/google/cloud/dialogflowcx_v3/types/session.py index 7c2be730..3814368a 100644 --- a/google/cloud/dialogflowcx_v3/types/session.py +++ b/google/cloud/dialogflowcx_v3/types/session.py @@ -36,6 +36,7 @@ "DetectIntentRequest", "DetectIntentResponse", "StreamingDetectIntentRequest", + "CloudConversationDebuggingInfo", "StreamingDetectIntentResponse", "StreamingRecognitionResult", "QueryParameters", @@ -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( @@ -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): @@ -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( @@ -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): @@ -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 @@ -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): diff --git a/google/cloud/dialogflowcx_v3/types/test_case.py b/google/cloud/dialogflowcx_v3/types/test_case.py index 05377871..f746eb47 100644 --- a/google/cloud/dialogflowcx_v3/types/test_case.py +++ b/google/cloud/dialogflowcx_v3/types/test_case.py @@ -413,12 +413,15 @@ class DiffType(proto.Enum): The parameters. UTTERANCE (4): The message utterance. + FLOW (5): + The flow. """ DIFF_TYPE_UNSPECIFIED = 0 INTENT = 1 PAGE = 2 PARAMETERS = 3 UTTERANCE = 4 + FLOW = 5 type_: DiffType = proto.Field( proto.ENUM, @@ -502,8 +505,8 @@ class Transition(proto.Message): target (google.cloud.dialogflowcx_v3.types.TransitionCoverage.TransitionNode): The end node of a transition. covered (bool): - Whether or not the transition is covered by - at least one of the agent's test cases. + Whether the transition is covered by at least + one of the agent's test cases. transition_route (google.cloud.dialogflowcx_v3.types.TransitionRoute): Intent route or condition route. @@ -592,9 +595,8 @@ class Transition(proto.Message): transition_route (google.cloud.dialogflowcx_v3.types.TransitionRoute): Intent route or condition route. covered (bool): - Whether or not the transition route is - covered by at least one of the agent's test - cases. + Whether the transition route is covered by at + least one of the agent's test cases. """ transition_route: gcdc_page.TransitionRoute = proto.Field( @@ -655,8 +657,8 @@ class Intent(proto.Message): intent (str): The intent full resource name covered (bool): - Whether or not the intent is covered by at - least one of the agent's test cases. + Whether the intent is covered by at least one + of the agent's test cases. """ intent: str = proto.Field( diff --git a/google/cloud/dialogflowcx_v3/types/webhook.py b/google/cloud/dialogflowcx_v3/types/webhook.py index c3a35dd4..5a2c2cb7 100644 --- a/google/cloud/dialogflowcx_v3/types/webhook.py +++ b/google/cloud/dialogflowcx_v3/types/webhook.py @@ -399,6 +399,11 @@ class WebhookRequest(proto.Message): provided as input, this field will contain the name of the event. + This field is a member of `oneof`_ ``query``. + dtmf_digits (str): + If [DTMF][google.cloud.dialogflow.cx.v3.DtmfInput] was + provided as input, this field will contain the DTMF digits. + This field is a member of `oneof`_ ``query``. language_code (str): The language code specified in the [original @@ -558,6 +563,11 @@ class SentimentAnalysisResult(proto.Message): number=14, oneof="query", ) + dtmf_digits: str = proto.Field( + proto.STRING, + number=17, + oneof="query", + ) language_code: str = proto.Field( proto.STRING, number=15, diff --git a/google/cloud/dialogflowcx_v3beta1/__init__.py b/google/cloud/dialogflowcx_v3beta1/__init__.py index a1833057..2268db31 100644 --- a/google/cloud/dialogflowcx_v3beta1/__init__.py +++ b/google/cloud/dialogflowcx_v3beta1/__init__.py @@ -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 @@ -289,6 +290,7 @@ "CalculateCoverageResponse", "Changelog", "ChangelogsClient", + "CloudConversationDebuggingInfo", "CompareVersionsRequest", "CompareVersionsResponse", "ContinuousTestResult", diff --git a/google/cloud/dialogflowcx_v3beta1/gapic_version.py b/google/cloud/dialogflowcx_v3beta1/gapic_version.py index e908112c..6c9024e0 100644 --- a/google/cloud/dialogflowcx_v3beta1/gapic_version.py +++ b/google/cloud/dialogflowcx_v3beta1/gapic_version.py @@ -13,4 +13,4 @@ # See the License for the specific language governing permissions and # limitations under the License. # -__version__ = "1.20.1" # {x-release-please-version} +__version__ = "1.21.0" # {x-release-please-version} diff --git a/google/cloud/dialogflowcx_v3beta1/services/agents/async_client.py b/google/cloud/dialogflowcx_v3beta1/services/agents/async_client.py index c7dc989f..ccfbbd6e 100644 --- a/google/cloud/dialogflowcx_v3beta1/services/agents/async_client.py +++ b/google/cloud/dialogflowcx_v3beta1/services/agents/async_client.py @@ -575,7 +575,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, ) diff --git a/google/cloud/dialogflowcx_v3beta1/services/agents/transports/base.py b/google/cloud/dialogflowcx_v3beta1/services/agents/transports/base.py index a38c1daa..4b02f90e 100644 --- a/google/cloud/dialogflowcx_v3beta1/services/agents/transports/base.py +++ b/google/cloud/dialogflowcx_v3beta1/services/agents/transports/base.py @@ -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( diff --git a/google/cloud/dialogflowcx_v3beta1/types/__init__.py b/google/cloud/dialogflowcx_v3beta1/types/__init__.py index 6f53c3e8..4f4732e2 100644 --- a/google/cloud/dialogflowcx_v3beta1/types/__init__.py +++ b/google/cloud/dialogflowcx_v3beta1/types/__init__.py @@ -160,6 +160,7 @@ ) from .session import ( AudioInput, + CloudConversationDebuggingInfo, DetectIntentRequest, DetectIntentResponse, DtmfInput, @@ -381,6 +382,7 @@ "SecuritySettings", "UpdateSecuritySettingsRequest", "AudioInput", + "CloudConversationDebuggingInfo", "DetectIntentRequest", "DetectIntentResponse", "DtmfInput", diff --git a/google/cloud/dialogflowcx_v3beta1/types/agent.py b/google/cloud/dialogflowcx_v3beta1/types/agent.py index 579022f4..f649c5e8 100644 --- a/google/cloud/dialogflowcx_v3beta1/types/agent.py +++ b/google/cloud/dialogflowcx_v3beta1/types/agent.py @@ -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.v3beta1.ExportAgentRequest]. This field is a member of `oneof`_ ``agent``. diff --git a/google/cloud/dialogflowcx_v3beta1/types/audio_config.py b/google/cloud/dialogflowcx_v3beta1/types/audio_config.py index 83d630fd..c3d81c65 100644 --- a/google/cloud/dialogflowcx_v3beta1/types/audio_config.py +++ b/google/cloud/dialogflowcx_v3beta1/types/audio_config.py @@ -295,7 +295,13 @@ class InputAudioConfig(proto.Message): using the standard version of the specified model. Refer to `Cloud Speech API documentation `__ - 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_v3beta1.types.SpeechModelVariant): Optional. Which variant of the [Speech model][google.cloud.dialogflow.cx.v3beta1.InputAudioConfig.model] @@ -476,14 +482,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_v3beta1.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 `__. + + - You no longer need to specify + [OutputAudioConfig.synthesize_speech_config][google.cloud.dialogflow.cx.v3beta1.OutputAudioConfig.synthesize_speech_config] + when invoking API calls. Your agent will use the + pre-configured options for speech synthesizing. """ synthesize_speech_configs: MutableMapping[ diff --git a/google/cloud/dialogflowcx_v3beta1/types/gcs.py b/google/cloud/dialogflowcx_v3beta1/types/gcs.py index 54e0e48e..81128f52 100644 --- a/google/cloud/dialogflowcx_v3beta1/types/gcs.py +++ b/google/cloud/dialogflowcx_v3beta1/types/gcs.py @@ -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( diff --git a/google/cloud/dialogflowcx_v3beta1/types/session.py b/google/cloud/dialogflowcx_v3beta1/types/session.py index 87a84e84..60c8178f 100644 --- a/google/cloud/dialogflowcx_v3beta1/types/session.py +++ b/google/cloud/dialogflowcx_v3beta1/types/session.py @@ -36,6 +36,7 @@ "DetectIntentRequest", "DetectIntentResponse", "StreamingDetectIntentRequest", + "CloudConversationDebuggingInfo", "StreamingDetectIntentResponse", "StreamingRecognitionResult", "QueryParameters", @@ -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( @@ -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): @@ -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_v3beta1.types.CloudConversationDebuggingInfo): + Debugging info that would get populated when + ``StreamingDetectIntentRequest.enable_debugging_info`` is + set to true. """ recognition_result: "StreamingRecognitionResult" = proto.Field( @@ -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): @@ -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 @@ -792,8 +958,9 @@ class QueryResult(proto.Message): This field is a member of `oneof`_ ``query``. dtmf (google.cloud.dialogflowcx_v3beta1.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.v3beta1.DtmfInput] + was provided as input, this field will contain a copy of the + [DtmfInput][google.cloud.dialogflow.cx.v3beta1.DtmfInput]. This field is a member of `oneof`_ ``query``. language_code (str): diff --git a/google/cloud/dialogflowcx_v3beta1/types/test_case.py b/google/cloud/dialogflowcx_v3beta1/types/test_case.py index e24a1259..3e136aaf 100644 --- a/google/cloud/dialogflowcx_v3beta1/types/test_case.py +++ b/google/cloud/dialogflowcx_v3beta1/types/test_case.py @@ -415,12 +415,15 @@ class DiffType(proto.Enum): The parameters. UTTERANCE (4): The message utterance. + FLOW (5): + The flow. """ DIFF_TYPE_UNSPECIFIED = 0 INTENT = 1 PAGE = 2 PARAMETERS = 3 UTTERANCE = 4 + FLOW = 5 type_: DiffType = proto.Field( proto.ENUM, @@ -504,8 +507,8 @@ class Transition(proto.Message): target (google.cloud.dialogflowcx_v3beta1.types.TransitionCoverage.TransitionNode): The end node of a transition. covered (bool): - Whether or not the transition is covered by - at least one of the agent's test cases. + Whether the transition is covered by at least + one of the agent's test cases. transition_route (google.cloud.dialogflowcx_v3beta1.types.TransitionRoute): Intent route or condition route. @@ -594,9 +597,8 @@ class Transition(proto.Message): transition_route (google.cloud.dialogflowcx_v3beta1.types.TransitionRoute): Intent route or condition route. covered (bool): - Whether or not the transition route is - covered by at least one of the agent's test - cases. + Whether the transition route is covered by at + least one of the agent's test cases. """ transition_route: gcdc_page.TransitionRoute = proto.Field( @@ -657,8 +659,8 @@ class Intent(proto.Message): intent (str): The intent full resource name covered (bool): - Whether or not the intent is covered by at - least one of the agent's test cases. + Whether the intent is covered by at least one + of the agent's test cases. """ intent: str = proto.Field( diff --git a/google/cloud/dialogflowcx_v3beta1/types/webhook.py b/google/cloud/dialogflowcx_v3beta1/types/webhook.py index c6230740..8881fce9 100644 --- a/google/cloud/dialogflowcx_v3beta1/types/webhook.py +++ b/google/cloud/dialogflowcx_v3beta1/types/webhook.py @@ -401,6 +401,11 @@ class WebhookRequest(proto.Message): was provided as input, this field will contain the name of the event. + This field is a member of `oneof`_ ``query``. + dtmf_digits (str): + If [DTMF][google.cloud.dialogflow.cx.v3beta1.DtmfInput] was + provided as input, this field will contain the DTMF digits. + This field is a member of `oneof`_ ``query``. language_code (str): The language code specified in the [original @@ -560,6 +565,11 @@ class SentimentAnalysisResult(proto.Message): number=14, oneof="query", ) + dtmf_digits: str = proto.Field( + proto.STRING, + number=17, + oneof="query", + ) language_code: str = proto.Field( proto.STRING, number=15, diff --git a/samples/generated_samples/snippet_metadata_google.cloud.dialogflow.cx.v3.json b/samples/generated_samples/snippet_metadata_google.cloud.dialogflow.cx.v3.json index 6826cd66..2644ecad 100644 --- a/samples/generated_samples/snippet_metadata_google.cloud.dialogflow.cx.v3.json +++ b/samples/generated_samples/snippet_metadata_google.cloud.dialogflow.cx.v3.json @@ -8,7 +8,7 @@ ], "language": "PYTHON", "name": "google-cloud-dialogflow-cx", - "version": "1.20.1" + "version": "1.21.0" }, "snippets": [ { diff --git a/samples/generated_samples/snippet_metadata_google.cloud.dialogflow.cx.v3beta1.json b/samples/generated_samples/snippet_metadata_google.cloud.dialogflow.cx.v3beta1.json index 2aadce3f..f4b63fb1 100644 --- a/samples/generated_samples/snippet_metadata_google.cloud.dialogflow.cx.v3beta1.json +++ b/samples/generated_samples/snippet_metadata_google.cloud.dialogflow.cx.v3beta1.json @@ -8,7 +8,7 @@ ], "language": "PYTHON", "name": "google-cloud-dialogflow-cx", - "version": "1.20.1" + "version": "1.21.0" }, "snippets": [ { diff --git a/scripts/fixup_dialogflowcx_v3_keywords.py b/scripts/fixup_dialogflowcx_v3_keywords.py index a86e407c..9c3ff068 100644 --- a/scripts/fixup_dialogflowcx_v3_keywords.py +++ b/scripts/fixup_dialogflowcx_v3_keywords.py @@ -119,7 +119,7 @@ class dialogflowcxCallTransformer(cst.CSTTransformer): 'run_test_case': ('name', 'environment', ), 'start_experiment': ('name', ), 'stop_experiment': ('name', ), - 'streaming_detect_intent': ('query_input', 'session', 'query_params', 'output_audio_config', 'enable_partial_response', ), + 'streaming_detect_intent': ('query_input', 'session', 'query_params', 'output_audio_config', 'enable_partial_response', 'enable_debugging_info', ), 'train_flow': ('name', ), 'update_agent': ('agent', 'update_mask', ), 'update_entity_type': ('entity_type', 'language_code', 'update_mask', ), diff --git a/scripts/fixup_dialogflowcx_v3beta1_keywords.py b/scripts/fixup_dialogflowcx_v3beta1_keywords.py index a86e407c..9c3ff068 100644 --- a/scripts/fixup_dialogflowcx_v3beta1_keywords.py +++ b/scripts/fixup_dialogflowcx_v3beta1_keywords.py @@ -119,7 +119,7 @@ class dialogflowcxCallTransformer(cst.CSTTransformer): 'run_test_case': ('name', 'environment', ), 'start_experiment': ('name', ), 'stop_experiment': ('name', ), - 'streaming_detect_intent': ('query_input', 'session', 'query_params', 'output_audio_config', 'enable_partial_response', ), + 'streaming_detect_intent': ('query_input', 'session', 'query_params', 'output_audio_config', 'enable_partial_response', 'enable_debugging_info', ), 'train_flow': ('name', ), 'update_agent': ('agent', 'update_mask', ), 'update_entity_type': ('entity_type', 'language_code', 'update_mask', ),