Skip to content

Commit

Permalink
feat: [google-cloud-dialogflow-cx] added support for playbook level s…
Browse files Browse the repository at this point in the history
…peech settings (#13560)

- [ ] Regenerate this pull request now.

BEGIN_COMMIT_OVERRIDE
feat(v3beta1): added support for playbook level speech settings
feat(v3beta1): added support for answer feedback & latency metrics in
conversation history
feat(v3beta1): added DocumentProcessingMode & BoostSpec for data stores
END_COMMIT_OVERRIDE



PiperOrigin-RevId: 730930887

Source-Link:
googleapis/googleapis@fbbbf50

Source-Link:
googleapis/googleapis-gen@e56f45e
Copy-Tag:
eyJwIjoicGFja2FnZXMvZ29vZ2xlLWNsb3VkLWRpYWxvZ2Zsb3ctY3gvLk93bEJvdC55YW1sIiwiaCI6ImU1NmY0NWUxYjQyNTQ5MGE4ZWQ0M2I1ZTkyMDAzMWNiOTJiMzVmOGQifQ==

---------

Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
  • Loading branch information
gcf-owl-bot[bot] and gcf-owl-bot[bot] authored Feb 25, 2025
1 parent 2c83cbc commit 8a86dba
Show file tree
Hide file tree
Showing 30 changed files with 402 additions and 81 deletions.
4 changes: 2 additions & 2 deletions packages/google-cloud-dialogflow-cx/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,12 @@ In order to use this library, you first need to go through the following steps:
1. `Select or create a Cloud Platform project.`_
2. `Enable billing for your project.`_
3. `Enable the Dialogflow CX.`_
4. `Setup Authentication.`_
4. `Set up Authentication.`_

.. _Select or create a Cloud Platform project.: https://console.cloud.google.com/project
.. _Enable billing for your project.: https://cloud.google.com/billing/docs/how-to/modify-project#enable_billing_for_a_project
.. _Enable the Dialogflow CX.: https://cloud.google.com/dialogflow/cx/docs
.. _Setup Authentication.: https://googleapis.dev/python/google-api-core/latest/auth.html
.. _Set up Authentication.: https://googleapis.dev/python/google-api-core/latest/auth.html

Installation
~~~~~~~~~~~~
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@
# See the License for the specific language governing permissions and
# limitations under the License.
#
__version__ = "1.39.0" # {x-release-please-version}
__version__ = "0.0.0" # {x-release-please-version}
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@
# See the License for the specific language governing permissions and
# limitations under the License.
#
__version__ = "1.39.0" # {x-release-please-version}
__version__ = "0.0.0" # {x-release-please-version}
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,7 @@
DataStoreConnection,
DataStoreConnectionSignals,
DataStoreType,
DocumentProcessingMode,
)
from .types.deployment import (
Deployment,
Expand Down Expand Up @@ -488,6 +489,7 @@
"DeploymentsClient",
"DetectIntentRequest",
"DetectIntentResponse",
"DocumentProcessingMode",
"DtmfInput",
"EntityType",
"EntityTypesClient",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@
# See the License for the specific language governing permissions and
# limitations under the License.
#
__version__ = "1.39.0" # {x-release-please-version}
__version__ = "0.0.0" # {x-release-please-version}
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@

from google.cloud.dialogflowcx_v3beta1.services.playbooks import pagers
from google.cloud.dialogflowcx_v3beta1.types import (
advanced_settings,
example,
generative_settings,
parameter_definition,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@

from google.cloud.dialogflowcx_v3beta1.services.playbooks import pagers
from google.cloud.dialogflowcx_v3beta1.types import (
advanced_settings,
example,
generative_settings,
parameter_definition,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -621,31 +621,25 @@ def request_generator():
[StreamingDetectIntent][google.cloud.dialogflow.cx.v3beta1.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.v3beta1.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.v3beta1.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.v3beta1.DetectIntentResponse.response_type]
is set to FINAL.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1312,31 +1312,25 @@ def request_generator():
[StreamingDetectIntent][google.cloud.dialogflow.cx.v3beta1.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.v3beta1.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.v3beta1.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.v3beta1.DetectIntentResponse.response_type]
is set to FINAL.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@
DataStoreConnection,
DataStoreConnectionSignals,
DataStoreType,
DocumentProcessingMode,
)
from .deployment import (
Deployment,
Expand Down Expand Up @@ -395,6 +396,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 @@ -197,6 +197,18 @@ class Agent(proto.Message):
client_certificate_settings (google.cloud.dialogflowcx_v3beta1.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 @@ -450,6 +462,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 @@ -275,7 +275,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 @@ -431,10 +431,16 @@ class Interaction(proto.Message):
concatenated into one.
create_time (google.protobuf.timestamp_pb2.Timestamp):
The time that the interaction was created.
answer_feedback (google.cloud.dialogflowcx_v3beta1.types.AnswerFeedback):
Answer feedback for the final response.
missing_transition (google.cloud.dialogflowcx_v3beta1.types.Conversation.Interaction.MissingTransition):
Missing transition predicted for the
interaction. This field is set only if the
interaction match type was no-match.
step_metrics (MutableSequence[google.cloud.dialogflowcx_v3beta1.types.Conversation.Interaction.StepMetrics]):
Metrics associated with different processing
steps. Names and number of steps depend on the
request and can change without a notice.
"""

class MissingTransition(proto.Message):
Expand All @@ -460,6 +466,26 @@ class MissingTransition(proto.Message):
number=2,
)

class StepMetrics(proto.Message):
r"""Metrics of each processing step.
Attributes:
name (str):
Name of the request processing step.
latency (google.protobuf.duration_pb2.Duration):
Processing latency of the step.
"""

name: str = proto.Field(
proto.STRING,
number=1,
)
latency: duration_pb2.Duration = proto.Field(
proto.MESSAGE,
number=2,
message=duration_pb2.Duration,
)

request: session.DetectIntentRequest = proto.Field(
proto.MESSAGE,
number=1,
Expand Down Expand Up @@ -490,11 +516,23 @@ class MissingTransition(proto.Message):
number=6,
message=timestamp_pb2.Timestamp,
)
answer_feedback: session.AnswerFeedback = proto.Field(
proto.MESSAGE,
number=7,
message=session.AnswerFeedback,
)
missing_transition: "Conversation.Interaction.MissingTransition" = proto.Field(
proto.MESSAGE,
number=8,
message="Conversation.Interaction.MissingTransition",
)
step_metrics: MutableSequence[
"Conversation.Interaction.StepMetrics"
] = proto.RepeatedField(
proto.MESSAGE,
number=9,
message="Conversation.Interaction.StepMetrics",
)

name: str = proto.Field(
proto.STRING,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
package="google.cloud.dialogflow.cx.v3beta1",
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_v3beta1.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
Loading

0 comments on commit 8a86dba

Please sign in to comment.