Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: [google-cloud-dialogflow-cx] exposed Zone Separation & Zone Isolation status of an agent #13561

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,7 @@
DataStoreConnection,
DataStoreConnectionSignals,
DataStoreType,
DocumentProcessingMode,
)
from google.cloud.dialogflowcx_v3.types.deployment import (
Deployment,
Expand Down Expand Up @@ -443,6 +444,7 @@
"DataStoreConnection",
"DataStoreConnectionSignals",
"DataStoreType",
"DocumentProcessingMode",
"Deployment",
"GetDeploymentRequest",
"ListDeploymentsRequest",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@
DataStoreConnection,
DataStoreConnectionSignals,
DataStoreType,
DocumentProcessingMode,
)
from .types.deployment import (
Deployment,
Expand Down Expand Up @@ -407,6 +408,7 @@
"DeploymentsClient",
"DetectIntentRequest",
"DetectIntentResponse",
"DocumentProcessingMode",
"DtmfInput",
"EntityType",
"EntityTypesClient",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@
DataStoreConnection,
DataStoreConnectionSignals,
DataStoreType,
DocumentProcessingMode,
)
from .deployment import (
Deployment,
Expand Down Expand Up @@ -333,6 +334,7 @@
"DataStoreConnection",
"DataStoreConnectionSignals",
"DataStoreType",
"DocumentProcessingMode",
"Deployment",
"GetDeploymentRequest",
"ListDeploymentsRequest",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down Expand Up @@ -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):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
package="google.cloud.dialogflow.cx.v3",
manifest={
"DataStoreType",
"DocumentProcessingMode",
"DataStoreConnection",
"DataStoreConnectionSignals",
},
Expand Down Expand Up @@ -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.
Expand All @@ -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(
Expand All @@ -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):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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``.

Expand Down Expand Up @@ -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(
Expand All @@ -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.
Expand Down Expand Up @@ -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(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -248,6 +248,7 @@
DeletePlaybookVersionRequest,
GetPlaybookRequest,
GetPlaybookVersionRequest,
Handler,
ListPlaybooksRequest,
ListPlaybooksResponse,
ListPlaybookVersionsRequest,
Expand Down Expand Up @@ -557,6 +558,7 @@
"GetTransitionRouteGroupRequest",
"GetVersionRequest",
"GetWebhookRequest",
"Handler",
"ImportEntityTypesMetadata",
"ImportEntityTypesRequest",
"ImportEntityTypesResponse",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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<project>.+?)/locations/(?P<location>.+?)/agents/(?P<agent>.+?)/webhooks/(?P<webhook>.+?)$",
path,
)
return m.groupdict() if m else {}

@staticmethod
def common_billing_account_path(
billing_account: str,
Expand Down
Loading
Loading