diff --git a/packages/google-cloud-dialogflow-cx/google/cloud/dialogflowcx/__init__.py b/packages/google-cloud-dialogflow-cx/google/cloud/dialogflowcx/__init__.py index e320c219e802..179e54612e0f 100644 --- a/packages/google-cloud-dialogflow-cx/google/cloud/dialogflowcx/__init__.py +++ b/packages/google-cloud-dialogflow-cx/google/cloud/dialogflowcx/__init__.py @@ -128,6 +128,7 @@ DataStoreConnection, DataStoreConnectionSignals, DataStoreType, + DocumentProcessingMode, ) from google.cloud.dialogflowcx_v3.types.deployment import ( Deployment, @@ -443,6 +444,7 @@ "DataStoreConnection", "DataStoreConnectionSignals", "DataStoreType", + "DocumentProcessingMode", "Deployment", "GetDeploymentRequest", "ListDeploymentsRequest", diff --git a/packages/google-cloud-dialogflow-cx/google/cloud/dialogflowcx_v3/__init__.py b/packages/google-cloud-dialogflow-cx/google/cloud/dialogflowcx_v3/__init__.py index dfc215af8c85..38f85d451e62 100644 --- a/packages/google-cloud-dialogflow-cx/google/cloud/dialogflowcx_v3/__init__.py +++ b/packages/google-cloud-dialogflow-cx/google/cloud/dialogflowcx_v3/__init__.py @@ -86,6 +86,7 @@ DataStoreConnection, DataStoreConnectionSignals, DataStoreType, + DocumentProcessingMode, ) from .types.deployment import ( Deployment, @@ -407,6 +408,7 @@ "DeploymentsClient", "DetectIntentRequest", "DetectIntentResponse", + "DocumentProcessingMode", "DtmfInput", "EntityType", "EntityTypesClient", diff --git a/packages/google-cloud-dialogflow-cx/google/cloud/dialogflowcx_v3/services/sessions/async_client.py b/packages/google-cloud-dialogflow-cx/google/cloud/dialogflowcx_v3/services/sessions/async_client.py index bd0b66ff562c..6fa46a895a58 100644 --- a/packages/google-cloud-dialogflow-cx/google/cloud/dialogflowcx_v3/services/sessions/async_client.py +++ b/packages/google-cloud-dialogflow-cx/google/cloud/dialogflowcx_v3/services/sessions/async_client.py @@ -615,31 +615,25 @@ def request_generator(): [StreamingDetectIntent][google.cloud.dialogflow.cx.v3.Sessions.StreamingDetectIntent] method. - Multiple response messages (N) can be returned in - order. - - The first (N-1) responses set either the - recognition_result or detect_intent_response field, - depending on the request: + Multiple response messages can be returned in order: - If the StreamingDetectIntentRequest.query_input.audio - field was set, and the - StreamingDetectIntentRequest.enable_partial_response - field was false, the recognition_result field is - populated for each of the (N-1) responses. See the - [StreamingRecognitionResult][google.cloud.dialogflow.cx.v3.StreamingRecognitionResult] - message for details about the result message - sequence. + field was set, the first M messages contain + recognition_result. Each recognition_result + represents a more complete transcript of what the + user said. The last recognition_result has + is_final set to true. - If the StreamingDetectIntentRequest.enable_partial_response field was true, the detect_intent_response field - is populated for each of the (N-1) responses, - where 1 <= N <= 4. These responses set the + is populated for each of the following N + responses, where 0 <= N <= 5. These responses set + the [DetectIntentResponse.response_type][google.cloud.dialogflow.cx.v3.DetectIntentResponse.response_type] field to PARTIAL. - For the final Nth response message, the + For the last response message, the detect_intent_response is fully populated, and [DetectIntentResponse.response_type][google.cloud.dialogflow.cx.v3.DetectIntentResponse.response_type] is set to FINAL. diff --git a/packages/google-cloud-dialogflow-cx/google/cloud/dialogflowcx_v3/services/sessions/client.py b/packages/google-cloud-dialogflow-cx/google/cloud/dialogflowcx_v3/services/sessions/client.py index fe8991d9ade5..430b3f16f04a 100644 --- a/packages/google-cloud-dialogflow-cx/google/cloud/dialogflowcx_v3/services/sessions/client.py +++ b/packages/google-cloud-dialogflow-cx/google/cloud/dialogflowcx_v3/services/sessions/client.py @@ -1238,31 +1238,25 @@ def request_generator(): [StreamingDetectIntent][google.cloud.dialogflow.cx.v3.Sessions.StreamingDetectIntent] method. - Multiple response messages (N) can be returned in - order. - - The first (N-1) responses set either the - recognition_result or detect_intent_response field, - depending on the request: + Multiple response messages can be returned in order: - If the StreamingDetectIntentRequest.query_input.audio - field was set, and the - StreamingDetectIntentRequest.enable_partial_response - field was false, the recognition_result field is - populated for each of the (N-1) responses. See the - [StreamingRecognitionResult][google.cloud.dialogflow.cx.v3.StreamingRecognitionResult] - message for details about the result message - sequence. + field was set, the first M messages contain + recognition_result. Each recognition_result + represents a more complete transcript of what the + user said. The last recognition_result has + is_final set to true. - If the StreamingDetectIntentRequest.enable_partial_response field was true, the detect_intent_response field - is populated for each of the (N-1) responses, - where 1 <= N <= 4. These responses set the + is populated for each of the following N + responses, where 0 <= N <= 5. These responses set + the [DetectIntentResponse.response_type][google.cloud.dialogflow.cx.v3.DetectIntentResponse.response_type] field to PARTIAL. - For the final Nth response message, the + For the last response message, the detect_intent_response is fully populated, and [DetectIntentResponse.response_type][google.cloud.dialogflow.cx.v3.DetectIntentResponse.response_type] is set to FINAL. diff --git a/packages/google-cloud-dialogflow-cx/google/cloud/dialogflowcx_v3/types/__init__.py b/packages/google-cloud-dialogflow-cx/google/cloud/dialogflowcx_v3/types/__init__.py index b4341bee3d0a..360ae7c2d56f 100644 --- a/packages/google-cloud-dialogflow-cx/google/cloud/dialogflowcx_v3/types/__init__.py +++ b/packages/google-cloud-dialogflow-cx/google/cloud/dialogflowcx_v3/types/__init__.py @@ -55,6 +55,7 @@ DataStoreConnection, DataStoreConnectionSignals, DataStoreType, + DocumentProcessingMode, ) from .deployment import ( Deployment, @@ -333,6 +334,7 @@ "DataStoreConnection", "DataStoreConnectionSignals", "DataStoreType", + "DocumentProcessingMode", "Deployment", "GetDeploymentRequest", "ListDeploymentsRequest", diff --git a/packages/google-cloud-dialogflow-cx/google/cloud/dialogflowcx_v3/types/advanced_settings.py b/packages/google-cloud-dialogflow-cx/google/cloud/dialogflowcx_v3/types/advanced_settings.py index 6275811e66fe..a41b56161d7a 100644 --- a/packages/google-cloud-dialogflow-cx/google/cloud/dialogflowcx_v3/types/advanced_settings.py +++ b/packages/google-cloud-dialogflow-cx/google/cloud/dialogflowcx_v3/types/advanced_settings.py @@ -89,7 +89,7 @@ class SpeechSettings(proto.Message): Timeout before detecting no speech. use_timeout_based_endpointing (bool): Use timeout based endpointing, interpreting - endpointer sensitivy as seconds of timeout + endpointer sensitivity as seconds of timeout value. models (MutableMapping[str, str]): Mapping from language to Speech-to-Text model. The mapped diff --git a/packages/google-cloud-dialogflow-cx/google/cloud/dialogflowcx_v3/types/agent.py b/packages/google-cloud-dialogflow-cx/google/cloud/dialogflowcx_v3/types/agent.py index 377328b36af8..ccdc980dace8 100644 --- a/packages/google-cloud-dialogflow-cx/google/cloud/dialogflowcx_v3/types/agent.py +++ b/packages/google-cloud-dialogflow-cx/google/cloud/dialogflowcx_v3/types/agent.py @@ -174,6 +174,18 @@ class Agent(proto.Message): client_certificate_settings (google.cloud.dialogflowcx_v3.types.Agent.ClientCertificateSettings): Optional. Settings for custom client certificates. + satisfies_pzs (bool): + Optional. Output only. A read only boolean + field reflecting Zone Separation status of the + agent. + + This field is a member of `oneof`_ ``_satisfies_pzs``. + satisfies_pzi (bool): + Optional. Output only. A read only boolean + field reflecting Zone Isolation status of the + agent. + + This field is a member of `oneof`_ ``_satisfies_pzi``. """ class GitIntegrationSettings(proto.Message): @@ -416,6 +428,16 @@ class ClientCertificateSettings(proto.Message): number=43, message=ClientCertificateSettings, ) + satisfies_pzs: bool = proto.Field( + proto.BOOL, + number=45, + optional=True, + ) + satisfies_pzi: bool = proto.Field( + proto.BOOL, + number=46, + optional=True, + ) class ListAgentsRequest(proto.Message): diff --git a/packages/google-cloud-dialogflow-cx/google/cloud/dialogflowcx_v3/types/audio_config.py b/packages/google-cloud-dialogflow-cx/google/cloud/dialogflowcx_v3/types/audio_config.py index 355ace1f322a..5a342c7913fc 100644 --- a/packages/google-cloud-dialogflow-cx/google/cloud/dialogflowcx_v3/types/audio_config.py +++ b/packages/google-cloud-dialogflow-cx/google/cloud/dialogflowcx_v3/types/audio_config.py @@ -274,7 +274,7 @@ class BargeInConfig(proto.Message): The client provides this configuration in terms of the durations of those two phases. The durations are measured in terms of the audio - length from the the start of the input audio. + length from the start of the input audio. No-speech event is a response with END_OF_UTTERANCE without any transcript following up. diff --git a/packages/google-cloud-dialogflow-cx/google/cloud/dialogflowcx_v3/types/data_store_connection.py b/packages/google-cloud-dialogflow-cx/google/cloud/dialogflowcx_v3/types/data_store_connection.py index 50ac8cc3cb57..f8e754edccc6 100644 --- a/packages/google-cloud-dialogflow-cx/google/cloud/dialogflowcx_v3/types/data_store_connection.py +++ b/packages/google-cloud-dialogflow-cx/google/cloud/dialogflowcx_v3/types/data_store_connection.py @@ -23,6 +23,7 @@ package="google.cloud.dialogflow.cx.v3", manifest={ "DataStoreType", + "DocumentProcessingMode", "DataStoreConnection", "DataStoreConnectionSignals", }, @@ -54,6 +55,24 @@ class DataStoreType(proto.Enum): STRUCTURED = 3 +class DocumentProcessingMode(proto.Enum): + r"""The document processing mode of the data store. + + Values: + DOCUMENT_PROCESSING_MODE_UNSPECIFIED (0): + Not specified. This should be set for STRUCTURED type data + stores. Due to legacy reasons this is considered as + DOCUMENTS for STRUCTURED and PUBLIC_WEB data stores. + DOCUMENTS (1): + Documents are processed as documents. + CHUNKS (2): + Documents are converted to chunks. + """ + DOCUMENT_PROCESSING_MODE_UNSPECIFIED = 0 + DOCUMENTS = 1 + CHUNKS = 2 + + class DataStoreConnection(proto.Message): r"""A data store connection. It represents a data store in Discovery Engine and the type of the contents it contains. @@ -65,6 +84,11 @@ class DataStoreConnection(proto.Message): The full name of the referenced data store. Formats: ``projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}`` ``projects/{project}/locations/{location}/dataStores/{data_store}`` + document_processing_mode (google.cloud.dialogflowcx_v3.types.DocumentProcessingMode): + The document processing mode for the data store connection. + Should only be set for PUBLIC_WEB and UNSTRUCTURED data + stores. If not set it is considered as DOCUMENTS, as this is + the legacy mode. """ data_store_type: "DataStoreType" = proto.Field( @@ -76,6 +100,11 @@ class DataStoreConnection(proto.Message): proto.STRING, number=2, ) + document_processing_mode: "DocumentProcessingMode" = proto.Field( + proto.ENUM, + number=4, + enum="DocumentProcessingMode", + ) class DataStoreConnectionSignals(proto.Message): diff --git a/packages/google-cloud-dialogflow-cx/google/cloud/dialogflowcx_v3/types/flow.py b/packages/google-cloud-dialogflow-cx/google/cloud/dialogflowcx_v3/types/flow.py index f51cca109145..a8255e3b7801 100644 --- a/packages/google-cloud-dialogflow-cx/google/cloud/dialogflowcx_v3/types/flow.py +++ b/packages/google-cloud-dialogflow-cx/google/cloud/dialogflowcx_v3/types/flow.py @@ -164,7 +164,7 @@ class Flow(proto.Message): of the current page. Transition routes defined in the page have higher priority than those defined in the flow. - TransitionRoutes are evalauted in the following order: + TransitionRoutes are evaluated in the following order: - TransitionRoutes with intent specified. - TransitionRoutes with only condition specified. diff --git a/packages/google-cloud-dialogflow-cx/google/cloud/dialogflowcx_v3/types/page.py b/packages/google-cloud-dialogflow-cx/google/cloud/dialogflowcx_v3/types/page.py index 19a8e64ee66e..8e84e0920350 100644 --- a/packages/google-cloud-dialogflow-cx/google/cloud/dialogflowcx_v3/types/page.py +++ b/packages/google-cloud-dialogflow-cx/google/cloud/dialogflowcx_v3/types/page.py @@ -113,7 +113,7 @@ class Page(proto.Message): flow, or another flow. When we are in a certain page, the TransitionRoutes are - evalauted in the following order: + evaluated in the following order: - TransitionRoutes defined in the page with intent specified. diff --git a/packages/google-cloud-dialogflow-cx/google/cloud/dialogflowcx_v3/types/session.py b/packages/google-cloud-dialogflow-cx/google/cloud/dialogflowcx_v3/types/session.py index 34ba2fe492d4..11e7b6883a93 100644 --- a/packages/google-cloud-dialogflow-cx/google/cloud/dialogflowcx_v3/types/session.py +++ b/packages/google-cloud-dialogflow-cx/google/cloud/dialogflowcx_v3/types/session.py @@ -577,28 +577,23 @@ class StreamingDetectIntentResponse(proto.Message): [StreamingDetectIntent][google.cloud.dialogflow.cx.v3.Sessions.StreamingDetectIntent] method. - Multiple response messages (N) can be returned in order. - - The first (N-1) responses set either the ``recognition_result`` or - ``detect_intent_response`` field, depending on the request: + Multiple response messages can be returned in order: - If the ``StreamingDetectIntentRequest.query_input.audio`` field - was set, and the - ``StreamingDetectIntentRequest.enable_partial_response`` field - was false, the ``recognition_result`` field is populated for each - of the (N-1) responses. See the - [StreamingRecognitionResult][google.cloud.dialogflow.cx.v3.StreamingRecognitionResult] - message for details about the result message sequence. + was set, the first M messages contain ``recognition_result``. + Each ``recognition_result`` represents a more complete transcript + of what the user said. The last ``recognition_result`` has + ``is_final`` set to ``true``. - If the ``StreamingDetectIntentRequest.enable_partial_response`` field was true, the ``detect_intent_response`` field is populated - for each of the (N-1) responses, where 1 <= N <= 4. These + for each of the following N responses, where 0 <= N <= 5. These responses set the [DetectIntentResponse.response_type][google.cloud.dialogflow.cx.v3.DetectIntentResponse.response_type] field to ``PARTIAL``. - For the final Nth response message, the ``detect_intent_response`` - is fully populated, and + For the last response message, the ``detect_intent_response`` is + fully populated, and [DetectIntentResponse.response_type][google.cloud.dialogflow.cx.v3.DetectIntentResponse.response_type] is set to ``FINAL``. @@ -1025,9 +1020,20 @@ class SearchConfig(proto.Message): boost_specs (MutableSequence[google.cloud.dialogflowcx_v3.types.BoostSpecs]): Optional. Boosting configuration for the datastores. + Maps from datastore name to their boost + configuration. Do not specify more than one + BoostSpecs for each datastore name. If multiple + BoostSpecs are provided for the same datastore + name, the behavior is undefined. filter_specs (MutableSequence[google.cloud.dialogflowcx_v3.types.FilterSpecs]): Optional. Filter configuration for the datastores. + Maps from datastore name to the filter + expression for that datastore. Do not specify + more than one FilterSpecs for each datastore + name. If multiple FilterSpecs are provided for + the same datastore name, the behavior is + undefined. """ boost_specs: MutableSequence["BoostSpecs"] = proto.RepeatedField( @@ -1052,7 +1058,7 @@ class BoostSpec(proto.Message): condition_boost_specs (MutableSequence[google.cloud.dialogflowcx_v3.types.BoostSpec.ConditionBoostSpec]): Optional. Condition boost specifications. If a document matches multiple conditions in the - specifictions, boost scores from these + specifications, boost scores from these specifications are all applied and combined in a non-linear way. Maximum number of specifications is 20. @@ -1540,11 +1546,9 @@ class QueryResult(proto.Message): rating controls are need to be shown for the response in the Dialogflow Messenger widget. data_store_connection_signals (google.cloud.dialogflowcx_v3.types.DataStoreConnectionSignals): - Optional. Data store connection feature output signals. - Filled only when data stores are involved in serving the - query and - DetectIntentRequest.populate_data_store_connection_signals - is set to true in the request. + Optional. Data store connection feature + output signals. Filled only when data stores are + involved in serving the query. """ text: str = proto.Field( diff --git a/packages/google-cloud-dialogflow-cx/google/cloud/dialogflowcx_v3beta1/__init__.py b/packages/google-cloud-dialogflow-cx/google/cloud/dialogflowcx_v3beta1/__init__.py index f7e61d55ccfa..cb7463abcbbb 100644 --- a/packages/google-cloud-dialogflow-cx/google/cloud/dialogflowcx_v3beta1/__init__.py +++ b/packages/google-cloud-dialogflow-cx/google/cloud/dialogflowcx_v3beta1/__init__.py @@ -248,6 +248,7 @@ DeletePlaybookVersionRequest, GetPlaybookRequest, GetPlaybookVersionRequest, + Handler, ListPlaybooksRequest, ListPlaybooksResponse, ListPlaybookVersionsRequest, @@ -557,6 +558,7 @@ "GetTransitionRouteGroupRequest", "GetVersionRequest", "GetWebhookRequest", + "Handler", "ImportEntityTypesMetadata", "ImportEntityTypesRequest", "ImportEntityTypesResponse", diff --git a/packages/google-cloud-dialogflow-cx/google/cloud/dialogflowcx_v3beta1/services/playbooks/async_client.py b/packages/google-cloud-dialogflow-cx/google/cloud/dialogflowcx_v3beta1/services/playbooks/async_client.py index 6185ed8a72c0..21324afc24aa 100644 --- a/packages/google-cloud-dialogflow-cx/google/cloud/dialogflowcx_v3beta1/services/playbooks/async_client.py +++ b/packages/google-cloud-dialogflow-cx/google/cloud/dialogflowcx_v3beta1/services/playbooks/async_client.py @@ -98,6 +98,8 @@ class PlaybooksAsyncClient: ) tool_path = staticmethod(PlaybooksClient.tool_path) parse_tool_path = staticmethod(PlaybooksClient.parse_tool_path) + webhook_path = staticmethod(PlaybooksClient.webhook_path) + parse_webhook_path = staticmethod(PlaybooksClient.parse_webhook_path) common_billing_account_path = staticmethod( PlaybooksClient.common_billing_account_path ) diff --git a/packages/google-cloud-dialogflow-cx/google/cloud/dialogflowcx_v3beta1/services/playbooks/client.py b/packages/google-cloud-dialogflow-cx/google/cloud/dialogflowcx_v3beta1/services/playbooks/client.py index cca2e49cbf2e..41477dc45883 100644 --- a/packages/google-cloud-dialogflow-cx/google/cloud/dialogflowcx_v3beta1/services/playbooks/client.py +++ b/packages/google-cloud-dialogflow-cx/google/cloud/dialogflowcx_v3beta1/services/playbooks/client.py @@ -331,6 +331,30 @@ def parse_tool_path(path: str) -> Dict[str, str]: ) return m.groupdict() if m else {} + @staticmethod + def webhook_path( + project: str, + location: str, + agent: str, + webhook: str, + ) -> str: + """Returns a fully-qualified webhook string.""" + return "projects/{project}/locations/{location}/agents/{agent}/webhooks/{webhook}".format( + project=project, + location=location, + agent=agent, + webhook=webhook, + ) + + @staticmethod + def parse_webhook_path(path: str) -> Dict[str, str]: + """Parses a webhook path into its component segments.""" + m = re.match( + r"^projects/(?P.+?)/locations/(?P.+?)/agents/(?P.+?)/webhooks/(?P.+?)$", + path, + ) + return m.groupdict() if m else {} + @staticmethod def common_billing_account_path( billing_account: str, diff --git a/packages/google-cloud-dialogflow-cx/google/cloud/dialogflowcx_v3beta1/types/__init__.py b/packages/google-cloud-dialogflow-cx/google/cloud/dialogflowcx_v3beta1/types/__init__.py index 52a95101010c..a56276755dbd 100644 --- a/packages/google-cloud-dialogflow-cx/google/cloud/dialogflowcx_v3beta1/types/__init__.py +++ b/packages/google-cloud-dialogflow-cx/google/cloud/dialogflowcx_v3beta1/types/__init__.py @@ -210,6 +210,7 @@ DeletePlaybookVersionRequest, GetPlaybookRequest, GetPlaybookVersionRequest, + Handler, ListPlaybooksRequest, ListPlaybooksResponse, ListPlaybookVersionsRequest, @@ -525,6 +526,7 @@ "DeletePlaybookVersionRequest", "GetPlaybookRequest", "GetPlaybookVersionRequest", + "Handler", "ListPlaybooksRequest", "ListPlaybooksResponse", "ListPlaybookVersionsRequest", diff --git a/packages/google-cloud-dialogflow-cx/google/cloud/dialogflowcx_v3beta1/types/playbook.py b/packages/google-cloud-dialogflow-cx/google/cloud/dialogflowcx_v3beta1/types/playbook.py index 6668dff0fc37..494b2e104ce4 100644 --- a/packages/google-cloud-dialogflow-cx/google/cloud/dialogflowcx_v3beta1/types/playbook.py +++ b/packages/google-cloud-dialogflow-cx/google/cloud/dialogflowcx_v3beta1/types/playbook.py @@ -22,11 +22,11 @@ import proto # type: ignore from google.cloud.dialogflowcx_v3beta1.types import ( - advanced_settings, - example, generative_settings, parameter_definition, ) +from google.cloud.dialogflowcx_v3beta1.types import fulfillment as gcdc_fulfillment +from google.cloud.dialogflowcx_v3beta1.types import advanced_settings, example __protobuf__ = proto.module( package="google.cloud.dialogflow.cx.v3beta1", @@ -44,6 +44,7 @@ "ListPlaybookVersionsRequest", "ListPlaybookVersionsResponse", "DeletePlaybookVersionRequest", + "Handler", }, ) @@ -248,6 +249,9 @@ class Playbook(proto.Message): speech_settings (google.cloud.dialogflowcx_v3beta1.types.AdvancedSettings.SpeechSettings): Optional. Playbook level Settings for speech to text detection. + handlers (MutableSequence[google.cloud.dialogflowcx_v3beta1.types.Handler]): + Optional. A list of registered handlers to + execute based on the specified triggers. """ class Step(proto.Message): @@ -368,6 +372,11 @@ class Instruction(proto.Message): number=20, message=advanced_settings.AdvancedSettings.SpeechSettings, ) + handlers: MutableSequence["Handler"] = proto.RepeatedField( + proto.MESSAGE, + number=16, + message="Handler", + ) class CreatePlaybookVersionRequest(proto.Message): @@ -535,4 +544,106 @@ class DeletePlaybookVersionRequest(proto.Message): ) +class Handler(proto.Message): + r"""Handler can be used to define custom logic to be executed + based on the user-specified triggers. + + 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 + members. + + .. _oneof: https://proto-plus-python.readthedocs.io/en/stable/fields.html#oneofs-mutually-exclusive-fields + + Attributes: + event_handler (google.cloud.dialogflowcx_v3beta1.types.Handler.EventHandler): + A handler triggered by event. + + This field is a member of `oneof`_ ``handler``. + lifecycle_handler (google.cloud.dialogflowcx_v3beta1.types.Handler.LifecycleHandler): + A handler triggered during specific lifecycle + of the playbook execution. + + This field is a member of `oneof`_ ``handler``. + """ + + class EventHandler(proto.Message): + r"""A handler that is triggered by the specified + [event][google.cloud.dialogflow.cx.v3beta1.Handler.EventHandler.event]. + + Attributes: + event (str): + Required. The name of the event that triggers + this handler. + condition (str): + Optional. The condition that must be + satisfied to trigger this handler. + fulfillment (google.cloud.dialogflowcx_v3beta1.types.Fulfillment): + Required. The fulfillment to call when the + event occurs. + """ + + event: str = proto.Field( + proto.STRING, + number=1, + ) + condition: str = proto.Field( + proto.STRING, + number=3, + ) + fulfillment: gcdc_fulfillment.Fulfillment = proto.Field( + proto.MESSAGE, + number=2, + message=gcdc_fulfillment.Fulfillment, + ) + + class LifecycleHandler(proto.Message): + r"""A handler that is triggered on the specific + [lifecycle_stage][google.cloud.dialogflow.cx.v3beta1.Handler.LifecycleHandler.lifecycle_stage] + of the playbook execution. + + Attributes: + lifecycle_stage (str): + Required. The name of the lifecycle stage that triggers this + handler. Supported values: + + - ``playbook-start`` + - ``pre-action-selection`` + - ``pre-action-execution`` + condition (str): + Optional. The condition that must be + satisfied to trigger this handler. + fulfillment (google.cloud.dialogflowcx_v3beta1.types.Fulfillment): + Required. The fulfillment to call when this + handler is triggered. + """ + + lifecycle_stage: str = proto.Field( + proto.STRING, + number=1, + ) + condition: str = proto.Field( + proto.STRING, + number=2, + ) + fulfillment: gcdc_fulfillment.Fulfillment = proto.Field( + proto.MESSAGE, + number=3, + message=gcdc_fulfillment.Fulfillment, + ) + + event_handler: EventHandler = proto.Field( + proto.MESSAGE, + number=1, + oneof="handler", + message=EventHandler, + ) + lifecycle_handler: LifecycleHandler = proto.Field( + proto.MESSAGE, + number=3, + oneof="handler", + message=LifecycleHandler, + ) + + __all__ = tuple(sorted(__protobuf__.manifest)) diff --git a/packages/google-cloud-dialogflow-cx/tests/unit/gapic/dialogflowcx_v3/test_agents.py b/packages/google-cloud-dialogflow-cx/tests/unit/gapic/dialogflowcx_v3/test_agents.py index c4139338b971..cc93d6a3ad12 100644 --- a/packages/google-cloud-dialogflow-cx/tests/unit/gapic/dialogflowcx_v3/test_agents.py +++ b/packages/google-cloud-dialogflow-cx/tests/unit/gapic/dialogflowcx_v3/test_agents.py @@ -1621,6 +1621,8 @@ def test_get_agent(request_type, transport: str = "grpc"): enable_spell_correction=True, enable_multi_language_training=True, locked=True, + satisfies_pzs=True, + satisfies_pzi=True, ) response = client.get_agent(request) @@ -1645,6 +1647,8 @@ def test_get_agent(request_type, transport: str = "grpc"): assert response.enable_spell_correction is True assert response.enable_multi_language_training is True assert response.locked is True + assert response.satisfies_pzs is True + assert response.satisfies_pzi is True def test_get_agent_non_empty_request_with_auto_populated_field(): @@ -1781,6 +1785,8 @@ async def test_get_agent_async( enable_spell_correction=True, enable_multi_language_training=True, locked=True, + satisfies_pzs=True, + satisfies_pzi=True, ) ) response = await client.get_agent(request) @@ -1806,6 +1812,8 @@ async def test_get_agent_async( assert response.enable_spell_correction is True assert response.enable_multi_language_training is True assert response.locked is True + assert response.satisfies_pzs is True + assert response.satisfies_pzi is True @pytest.mark.asyncio @@ -1986,6 +1994,8 @@ def test_create_agent(request_type, transport: str = "grpc"): enable_spell_correction=True, enable_multi_language_training=True, locked=True, + satisfies_pzs=True, + satisfies_pzi=True, ) response = client.create_agent(request) @@ -2010,6 +2020,8 @@ def test_create_agent(request_type, transport: str = "grpc"): assert response.enable_spell_correction is True assert response.enable_multi_language_training is True assert response.locked is True + assert response.satisfies_pzs is True + assert response.satisfies_pzi is True def test_create_agent_non_empty_request_with_auto_populated_field(): @@ -2148,6 +2160,8 @@ async def test_create_agent_async( enable_spell_correction=True, enable_multi_language_training=True, locked=True, + satisfies_pzs=True, + satisfies_pzi=True, ) ) response = await client.create_agent(request) @@ -2173,6 +2187,8 @@ async def test_create_agent_async( assert response.enable_spell_correction is True assert response.enable_multi_language_training is True assert response.locked is True + assert response.satisfies_pzs is True + assert response.satisfies_pzi is True @pytest.mark.asyncio @@ -2363,6 +2379,8 @@ def test_update_agent(request_type, transport: str = "grpc"): enable_spell_correction=True, enable_multi_language_training=True, locked=True, + satisfies_pzs=True, + satisfies_pzi=True, ) response = client.update_agent(request) @@ -2387,6 +2405,8 @@ def test_update_agent(request_type, transport: str = "grpc"): assert response.enable_spell_correction is True assert response.enable_multi_language_training is True assert response.locked is True + assert response.satisfies_pzs is True + assert response.satisfies_pzi is True def test_update_agent_non_empty_request_with_auto_populated_field(): @@ -2521,6 +2541,8 @@ async def test_update_agent_async( enable_spell_correction=True, enable_multi_language_training=True, locked=True, + satisfies_pzs=True, + satisfies_pzi=True, ) ) response = await client.update_agent(request) @@ -2546,6 +2568,8 @@ async def test_update_agent_async( assert response.enable_spell_correction is True assert response.enable_multi_language_training is True assert response.locked is True + assert response.satisfies_pzs is True + assert response.satisfies_pzi is True @pytest.mark.asyncio @@ -7132,6 +7156,8 @@ async def test_get_agent_empty_call_grpc_asyncio(): enable_spell_correction=True, enable_multi_language_training=True, locked=True, + satisfies_pzs=True, + satisfies_pzi=True, ) ) await client.get_agent(request=None) @@ -7171,6 +7197,8 @@ async def test_create_agent_empty_call_grpc_asyncio(): enable_spell_correction=True, enable_multi_language_training=True, locked=True, + satisfies_pzs=True, + satisfies_pzi=True, ) ) await client.create_agent(request=None) @@ -7210,6 +7238,8 @@ async def test_update_agent_empty_call_grpc_asyncio(): enable_spell_correction=True, enable_multi_language_training=True, locked=True, + satisfies_pzs=True, + satisfies_pzi=True, ) ) await client.update_agent(request=None) @@ -7595,6 +7625,8 @@ def test_get_agent_rest_call_success(request_type): enable_spell_correction=True, enable_multi_language_training=True, locked=True, + satisfies_pzs=True, + satisfies_pzi=True, ) # Wrap the value into a proper Response obj @@ -7624,6 +7656,8 @@ def test_get_agent_rest_call_success(request_type): assert response.enable_spell_correction is True assert response.enable_multi_language_training is True assert response.locked is True + assert response.satisfies_pzs is True + assert response.satisfies_pzi is True @pytest.mark.parametrize("null_interceptor", [True, False]) @@ -7778,6 +7812,8 @@ def test_create_agent_rest_call_success(request_type): "private_key": "private_key_value", "passphrase": "passphrase_value", }, + "satisfies_pzs": True, + "satisfies_pzi": True, } # The version of a generated dependency at test runtime may differ from the version used during generation. # Delete any fields which are not present in the current runtime dependency @@ -7865,6 +7901,8 @@ def get_message_fields(field): enable_spell_correction=True, enable_multi_language_training=True, locked=True, + satisfies_pzs=True, + satisfies_pzi=True, ) # Wrap the value into a proper Response obj @@ -7894,6 +7932,8 @@ def get_message_fields(field): assert response.enable_spell_correction is True assert response.enable_multi_language_training is True assert response.locked is True + assert response.satisfies_pzs is True + assert response.satisfies_pzi is True @pytest.mark.parametrize("null_interceptor", [True, False]) @@ -8052,6 +8092,8 @@ def test_update_agent_rest_call_success(request_type): "private_key": "private_key_value", "passphrase": "passphrase_value", }, + "satisfies_pzs": True, + "satisfies_pzi": True, } # The version of a generated dependency at test runtime may differ from the version used during generation. # Delete any fields which are not present in the current runtime dependency @@ -8139,6 +8181,8 @@ def get_message_fields(field): enable_spell_correction=True, enable_multi_language_training=True, locked=True, + satisfies_pzs=True, + satisfies_pzi=True, ) # Wrap the value into a proper Response obj @@ -8168,6 +8212,8 @@ def get_message_fields(field): assert response.enable_spell_correction is True assert response.enable_multi_language_training is True assert response.locked is True + assert response.satisfies_pzs is True + assert response.satisfies_pzi is True @pytest.mark.parametrize("null_interceptor", [True, False]) diff --git a/packages/google-cloud-dialogflow-cx/tests/unit/gapic/dialogflowcx_v3/test_flows.py b/packages/google-cloud-dialogflow-cx/tests/unit/gapic/dialogflowcx_v3/test_flows.py index 2fd2b1639881..14da02ab6631 100644 --- a/packages/google-cloud-dialogflow-cx/tests/unit/gapic/dialogflowcx_v3/test_flows.py +++ b/packages/google-cloud-dialogflow-cx/tests/unit/gapic/dialogflowcx_v3/test_flows.py @@ -6822,7 +6822,11 @@ def test_create_flow_rest_call_success(request_type): "target_page": "target_page_value", "target_flow": "target_flow_value", "data_store_connections": [ - {"data_store_type": 1, "data_store": "data_store_value"} + { + "data_store_type": 1, + "data_store": "data_store_value", + "document_processing_mode": 1, + } ], }, "multi_language_settings": { @@ -7526,7 +7530,11 @@ def test_update_flow_rest_call_success(request_type): "target_page": "target_page_value", "target_flow": "target_flow_value", "data_store_connections": [ - {"data_store_type": 1, "data_store": "data_store_value"} + { + "data_store_type": 1, + "data_store": "data_store_value", + "document_processing_mode": 1, + } ], }, "multi_language_settings": { diff --git a/packages/google-cloud-dialogflow-cx/tests/unit/gapic/dialogflowcx_v3/test_pages.py b/packages/google-cloud-dialogflow-cx/tests/unit/gapic/dialogflowcx_v3/test_pages.py index 7125dd9038b0..144893b78fbe 100644 --- a/packages/google-cloud-dialogflow-cx/tests/unit/gapic/dialogflowcx_v3/test_pages.py +++ b/packages/google-cloud-dialogflow-cx/tests/unit/gapic/dialogflowcx_v3/test_pages.py @@ -4701,7 +4701,11 @@ def test_create_page_rest_call_success(request_type): "target_page": "target_page_value", "target_flow": "target_flow_value", "data_store_connections": [ - {"data_store_type": 1, "data_store": "data_store_value"} + { + "data_store_type": 1, + "data_store": "data_store_value", + "document_processing_mode": 1, + } ], }, } @@ -5043,7 +5047,11 @@ def test_update_page_rest_call_success(request_type): "target_page": "target_page_value", "target_flow": "target_flow_value", "data_store_connections": [ - {"data_store_type": 1, "data_store": "data_store_value"} + { + "data_store_type": 1, + "data_store": "data_store_value", + "document_processing_mode": 1, + } ], }, } diff --git a/packages/google-cloud-dialogflow-cx/tests/unit/gapic/dialogflowcx_v3/test_test_cases.py b/packages/google-cloud-dialogflow-cx/tests/unit/gapic/dialogflowcx_v3/test_test_cases.py index be283d09ced4..8d5ef1a53583 100644 --- a/packages/google-cloud-dialogflow-cx/tests/unit/gapic/dialogflowcx_v3/test_test_cases.py +++ b/packages/google-cloud-dialogflow-cx/tests/unit/gapic/dialogflowcx_v3/test_test_cases.py @@ -8603,7 +8603,11 @@ def test_create_test_case_rest_call_success(request_type): "target_page": "target_page_value", "target_flow": "target_flow_value", "data_store_connections": [ - {"data_store_type": 1, "data_store": "data_store_value"} + { + "data_store_type": 1, + "data_store": "data_store_value", + "document_processing_mode": 1, + } ], }, }, @@ -9061,7 +9065,11 @@ def test_update_test_case_rest_call_success(request_type): "target_page": "target_page_value", "target_flow": "target_flow_value", "data_store_connections": [ - {"data_store_type": 1, "data_store": "data_store_value"} + { + "data_store_type": 1, + "data_store": "data_store_value", + "document_processing_mode": 1, + } ], }, }, diff --git a/packages/google-cloud-dialogflow-cx/tests/unit/gapic/dialogflowcx_v3beta1/test_playbooks.py b/packages/google-cloud-dialogflow-cx/tests/unit/gapic/dialogflowcx_v3beta1/test_playbooks.py index 05b39a1db2d4..bb5dd8e18b96 100644 --- a/packages/google-cloud-dialogflow-cx/tests/unit/gapic/dialogflowcx_v3beta1/test_playbooks.py +++ b/packages/google-cloud-dialogflow-cx/tests/unit/gapic/dialogflowcx_v3beta1/test_playbooks.py @@ -67,11 +67,14 @@ from google.cloud.dialogflowcx_v3beta1.types import ( advanced_settings, example, + fulfillment, + gcs, generative_settings, parameter_definition, ) from google.cloud.dialogflowcx_v3beta1.types import playbook from google.cloud.dialogflowcx_v3beta1.types import playbook as gcdc_playbook +from google.cloud.dialogflowcx_v3beta1.types import response_message, tool_call CRED_INFO_JSON = { "credential_source": "/path/to/file", @@ -7001,6 +7004,106 @@ def test_create_playbook_rest_call_success(request_type): "use_timeout_based_endpointing": True, "models": {}, }, + "handlers": [ + { + "event_handler": { + "event": "event_value", + "condition": "condition_value", + "fulfillment": { + "messages": [ + { + "text": { + "text": ["text_value1", "text_value2"], + "allow_playback_interruption": True, + }, + "payload": {"fields": {}}, + "conversation_success": {"metadata": {}}, + "output_audio_text": { + "text": "text_value", + "ssml": "ssml_value", + "allow_playback_interruption": True, + }, + "live_agent_handoff": {"metadata": {}}, + "end_interaction": {}, + "play_audio": { + "audio_uri": "audio_uri_value", + "allow_playback_interruption": True, + }, + "mixed_audio": { + "segments": [ + { + "audio": b"audio_blob", + "uri": "uri_value", + "allow_playback_interruption": True, + } + ] + }, + "telephony_transfer_call": { + "phone_number": "phone_number_value" + }, + "knowledge_info_card": {}, + "tool_call": { + "tool": "tool_value", + "action": "action_value", + "input_parameters": {}, + }, + "channel": "channel_value", + } + ], + "webhook": "webhook_value", + "return_partial_responses": True, + "tag": "tag_value", + "set_parameter_actions": [ + { + "parameter": "parameter_value", + "value": { + "null_value": 0, + "number_value": 0.1285, + "string_value": "string_value_value", + "bool_value": True, + "struct_value": {}, + "list_value": {"values": {}}, + }, + } + ], + "conditional_cases": [ + { + "cases": [ + { + "condition": "condition_value", + "case_content": [ + {"message": {}, "additional_cases": {}} + ], + } + ] + } + ], + "advanced_settings": { + "audio_export_gcs_destination": {"uri": "uri_value"}, + "speech_settings": {}, + "dtmf_settings": { + "enabled": True, + "max_digits": 1065, + "finish_digit": "finish_digit_value", + "interdigit_timeout_duration": {}, + "endpointing_timeout_duration": {}, + }, + "logging_settings": { + "enable_stackdriver_logging": True, + "enable_interaction_logging": True, + "enable_consent_based_redaction": True, + }, + }, + "enable_generative_fallback": True, + }, + }, + "lifecycle_handler": { + "lifecycle_stage": "lifecycle_stage_value", + "condition": "condition_value", + "fulfillment": {}, + }, + } + ], } # The version of a generated dependency at test runtime may differ from the version used during generation. # Delete any fields which are not present in the current runtime dependency @@ -7612,6 +7715,106 @@ def test_update_playbook_rest_call_success(request_type): "use_timeout_based_endpointing": True, "models": {}, }, + "handlers": [ + { + "event_handler": { + "event": "event_value", + "condition": "condition_value", + "fulfillment": { + "messages": [ + { + "text": { + "text": ["text_value1", "text_value2"], + "allow_playback_interruption": True, + }, + "payload": {"fields": {}}, + "conversation_success": {"metadata": {}}, + "output_audio_text": { + "text": "text_value", + "ssml": "ssml_value", + "allow_playback_interruption": True, + }, + "live_agent_handoff": {"metadata": {}}, + "end_interaction": {}, + "play_audio": { + "audio_uri": "audio_uri_value", + "allow_playback_interruption": True, + }, + "mixed_audio": { + "segments": [ + { + "audio": b"audio_blob", + "uri": "uri_value", + "allow_playback_interruption": True, + } + ] + }, + "telephony_transfer_call": { + "phone_number": "phone_number_value" + }, + "knowledge_info_card": {}, + "tool_call": { + "tool": "tool_value", + "action": "action_value", + "input_parameters": {}, + }, + "channel": "channel_value", + } + ], + "webhook": "webhook_value", + "return_partial_responses": True, + "tag": "tag_value", + "set_parameter_actions": [ + { + "parameter": "parameter_value", + "value": { + "null_value": 0, + "number_value": 0.1285, + "string_value": "string_value_value", + "bool_value": True, + "struct_value": {}, + "list_value": {"values": {}}, + }, + } + ], + "conditional_cases": [ + { + "cases": [ + { + "condition": "condition_value", + "case_content": [ + {"message": {}, "additional_cases": {}} + ], + } + ] + } + ], + "advanced_settings": { + "audio_export_gcs_destination": {"uri": "uri_value"}, + "speech_settings": {}, + "dtmf_settings": { + "enabled": True, + "max_digits": 1065, + "finish_digit": "finish_digit_value", + "interdigit_timeout_duration": {}, + "endpointing_timeout_duration": {}, + }, + "logging_settings": { + "enable_stackdriver_logging": True, + "enable_interaction_logging": True, + "enable_consent_based_redaction": True, + }, + }, + "enable_generative_fallback": True, + }, + }, + "lifecycle_handler": { + "lifecycle_stage": "lifecycle_stage_value", + "condition": "condition_value", + "fulfillment": {}, + }, + } + ], } # The version of a generated dependency at test runtime may differ from the version used during generation. # Delete any fields which are not present in the current runtime dependency @@ -7855,13 +8058,113 @@ def test_create_playbook_version_rest_call_success(request_type): "use_timeout_based_endpointing": True, "models": {}, }, + "handlers": [ + { + "event_handler": { + "event": "event_value", + "condition": "condition_value", + "fulfillment": { + "messages": [ + { + "text": { + "text": ["text_value1", "text_value2"], + "allow_playback_interruption": True, + }, + "payload": {"fields": {}}, + "conversation_success": {"metadata": {}}, + "output_audio_text": { + "text": "text_value", + "ssml": "ssml_value", + "allow_playback_interruption": True, + }, + "live_agent_handoff": {"metadata": {}}, + "end_interaction": {}, + "play_audio": { + "audio_uri": "audio_uri_value", + "allow_playback_interruption": True, + }, + "mixed_audio": { + "segments": [ + { + "audio": b"audio_blob", + "uri": "uri_value", + "allow_playback_interruption": True, + } + ] + }, + "telephony_transfer_call": { + "phone_number": "phone_number_value" + }, + "knowledge_info_card": {}, + "tool_call": { + "tool": "tool_value", + "action": "action_value", + "input_parameters": {}, + }, + "channel": "channel_value", + } + ], + "webhook": "webhook_value", + "return_partial_responses": True, + "tag": "tag_value", + "set_parameter_actions": [ + { + "parameter": "parameter_value", + "value": { + "null_value": 0, + "number_value": 0.1285, + "string_value": "string_value_value", + "bool_value": True, + "struct_value": {}, + "list_value": {"values": {}}, + }, + } + ], + "conditional_cases": [ + { + "cases": [ + { + "condition": "condition_value", + "case_content": [ + {"message": {}, "additional_cases": {}} + ], + } + ] + } + ], + "advanced_settings": { + "audio_export_gcs_destination": {"uri": "uri_value"}, + "speech_settings": {}, + "dtmf_settings": { + "enabled": True, + "max_digits": 1065, + "finish_digit": "finish_digit_value", + "interdigit_timeout_duration": {}, + "endpointing_timeout_duration": {}, + }, + "logging_settings": { + "enable_stackdriver_logging": True, + "enable_interaction_logging": True, + "enable_consent_based_redaction": True, + }, + }, + "enable_generative_fallback": True, + }, + }, + "lifecycle_handler": { + "lifecycle_stage": "lifecycle_stage_value", + "condition": "condition_value", + "fulfillment": {}, + }, + } + ], }, "examples": [ { "name": "name_value", "playbook_input": { "preceding_conversation_summary": "preceding_conversation_summary_value", - "action_parameters": {"fields": {}}, + "action_parameters": {}, }, "playbook_output": { "execution_summary": "execution_summary_value", @@ -9554,8 +9857,37 @@ def test_parse_tool_path(): assert expected == actual +def test_webhook_path(): + project = "winkle" + location = "nautilus" + agent = "scallop" + webhook = "abalone" + expected = "projects/{project}/locations/{location}/agents/{agent}/webhooks/{webhook}".format( + project=project, + location=location, + agent=agent, + webhook=webhook, + ) + actual = PlaybooksClient.webhook_path(project, location, agent, webhook) + assert expected == actual + + +def test_parse_webhook_path(): + expected = { + "project": "squid", + "location": "clam", + "agent": "whelk", + "webhook": "octopus", + } + path = PlaybooksClient.webhook_path(**expected) + + # Check that the path construction is reversible. + actual = PlaybooksClient.parse_webhook_path(path) + assert expected == actual + + def test_common_billing_account_path(): - billing_account = "winkle" + billing_account = "oyster" expected = "billingAccounts/{billing_account}".format( billing_account=billing_account, ) @@ -9565,7 +9897,7 @@ def test_common_billing_account_path(): def test_parse_common_billing_account_path(): expected = { - "billing_account": "nautilus", + "billing_account": "nudibranch", } path = PlaybooksClient.common_billing_account_path(**expected) @@ -9575,7 +9907,7 @@ def test_parse_common_billing_account_path(): def test_common_folder_path(): - folder = "scallop" + folder = "cuttlefish" expected = "folders/{folder}".format( folder=folder, ) @@ -9585,7 +9917,7 @@ def test_common_folder_path(): def test_parse_common_folder_path(): expected = { - "folder": "abalone", + "folder": "mussel", } path = PlaybooksClient.common_folder_path(**expected) @@ -9595,7 +9927,7 @@ def test_parse_common_folder_path(): def test_common_organization_path(): - organization = "squid" + organization = "winkle" expected = "organizations/{organization}".format( organization=organization, ) @@ -9605,7 +9937,7 @@ def test_common_organization_path(): def test_parse_common_organization_path(): expected = { - "organization": "clam", + "organization": "nautilus", } path = PlaybooksClient.common_organization_path(**expected) @@ -9615,7 +9947,7 @@ def test_parse_common_organization_path(): def test_common_project_path(): - project = "whelk" + project = "scallop" expected = "projects/{project}".format( project=project, ) @@ -9625,7 +9957,7 @@ def test_common_project_path(): def test_parse_common_project_path(): expected = { - "project": "octopus", + "project": "abalone", } path = PlaybooksClient.common_project_path(**expected) @@ -9635,8 +9967,8 @@ def test_parse_common_project_path(): def test_common_location_path(): - project = "oyster" - location = "nudibranch" + project = "squid" + location = "clam" expected = "projects/{project}/locations/{location}".format( project=project, location=location, @@ -9647,8 +9979,8 @@ def test_common_location_path(): def test_parse_common_location_path(): expected = { - "project": "cuttlefish", - "location": "mussel", + "project": "whelk", + "location": "octopus", } path = PlaybooksClient.common_location_path(**expected)