Skip to content

Commit aa99816

Browse files
feat: [google-cloud-dialogflow] add new fields for delivering intermediate transcriptions through PubSub (#13358)
- [ ] Regenerate this pull request now. PiperOrigin-RevId: 705999588 Source-Link: googleapis/googleapis@35c27e3 Source-Link: googleapis/googleapis-gen@fb8444e Copy-Tag: eyJwIjoicGFja2FnZXMvZ29vZ2xlLWNsb3VkLWRpYWxvZ2Zsb3cvLk93bEJvdC55YW1sIiwiaCI6ImZiODQ0NGVlMmQxMzY0ZTJlNmE4NGUxMTIyMDZlODg2ZTAwM2I4ZTYifQ== BEGIN_NESTED_COMMIT feat: [google-cloud-dialogflow] add new fields for delivering intermediate transcriptions through PubSub PiperOrigin-RevId: 705962694 Source-Link: googleapis/googleapis@d140b51 Source-Link: googleapis/googleapis-gen@8fc7ff9 Copy-Tag: eyJwIjoicGFja2FnZXMvZ29vZ2xlLWNsb3VkLWRpYWxvZ2Zsb3cvLk93bEJvdC55YW1sIiwiaCI6IjhmYzdmZjkxY2E2OWI3NjJhZTNjMzc4NGI2ODRkYzQ1ZDhkNGM4ZWIifQ== END_NESTED_COMMIT --------- Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
1 parent 20b8aaf commit aa99816

File tree

11 files changed

+85
-7
lines changed

11 files changed

+85
-7
lines changed

packages/google-cloud-dialogflow/google/cloud/dialogflow/gapic_version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,4 @@
1313
# See the License for the specific language governing permissions and
1414
# limitations under the License.
1515
#
16-
__version__ = "2.37.0" # {x-release-please-version}
16+
__version__ = "0.0.0" # {x-release-please-version}

packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/gapic_version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,4 @@
1313
# See the License for the specific language governing permissions and
1414
# limitations under the License.
1515
#
16-
__version__ = "2.37.0" # {x-release-please-version}
16+
__version__ = "0.0.0" # {x-release-please-version}

packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/types/conversation_event.py

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
from google.rpc import status_pb2 # type: ignore
2121
import proto # type: ignore
2222

23-
from google.cloud.dialogflow_v2.types import participant
23+
from google.cloud.dialogflow_v2.types import participant, session
2424

2525
__protobuf__ = proto.module(
2626
package="google.cloud.dialogflow.v2",
@@ -34,6 +34,10 @@ class ConversationEvent(proto.Message):
3434
r"""Represents a notification sent to Pub/Sub subscribers for
3535
conversation lifecycle events.
3636
37+
This message has `oneof`_ fields (mutually exclusive fields).
38+
For each oneof, at most one member field can be set at the same time.
39+
Setting any member of the oneof automatically clears all other
40+
members.
3741
3842
.. _oneof: https://proto-plus-python.readthedocs.io/en/stable/fields.html#oneofs-mutually-exclusive-fields
3943
@@ -51,6 +55,10 @@ class ConversationEvent(proto.Message):
5155
new_message_payload (google.cloud.dialogflow_v2.types.Message):
5256
Payload of NEW_MESSAGE event.
5357
58+
This field is a member of `oneof`_ ``payload``.
59+
new_recognition_result_payload (google.cloud.dialogflow_v2.types.StreamingRecognitionResult):
60+
Payload of NEW_RECOGNITION_RESULT event.
61+
5462
This field is a member of `oneof`_ ``payload``.
5563
"""
5664

@@ -76,6 +84,11 @@ class Type(proto.Enum):
7684
An existing conversation has received a new message, either
7785
from API or telephony. It is configured in
7886
[ConversationProfile.new_message_event_notification_config][google.cloud.dialogflow.v2.ConversationProfile.new_message_event_notification_config]
87+
NEW_RECOGNITION_RESULT (7):
88+
An existing conversation has received a new speech
89+
recognition result. This is mainly for delivering
90+
intermediate transcripts. The notification is configured in
91+
[ConversationProfile.new_recognition_event_notification_config][].
7992
UNRECOVERABLE_ERROR (4):
8093
Unrecoverable error during a telephone call.
8194
@@ -95,6 +108,7 @@ class Type(proto.Enum):
95108
CONVERSATION_FINISHED = 2
96109
HUMAN_INTERVENTION_NEEDED = 3
97110
NEW_MESSAGE = 5
111+
NEW_RECOGNITION_RESULT = 7
98112
UNRECOVERABLE_ERROR = 4
99113

100114
conversation: str = proto.Field(
@@ -117,6 +131,12 @@ class Type(proto.Enum):
117131
oneof="payload",
118132
message=participant.Message,
119133
)
134+
new_recognition_result_payload: session.StreamingRecognitionResult = proto.Field(
135+
proto.MESSAGE,
136+
number=5,
137+
oneof="payload",
138+
message=session.StreamingRecognitionResult,
139+
)
120140

121141

122142
__all__ = tuple(sorted(__protobuf__.manifest))

packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/types/conversation_profile.py

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,18 @@ class ConversationProfile(proto.Message):
8686
Configuration for publishing new message events. Event will
8787
be sent in format of
8888
[ConversationEvent][google.cloud.dialogflow.v2.ConversationEvent]
89+
new_recognition_result_notification_config (google.cloud.dialogflow_v2.types.NotificationConfig):
90+
Optional. Configuration for publishing transcription
91+
intermediate results. Event will be sent in format of
92+
[ConversationEvent][google.cloud.dialogflow.v2.ConversationEvent].
93+
If configured, the following information will be populated
94+
as
95+
[ConversationEvent][google.cloud.dialogflow.v2.ConversationEvent]
96+
Pub/Sub message attributes:
97+
98+
- "participant_id"
99+
- "participant_role"
100+
- "message_id".
89101
stt_config (google.cloud.dialogflow_v2.types.SpeechToTextConfig):
90102
Settings for speech transcription.
91103
language_code (str):
@@ -161,6 +173,11 @@ class ConversationProfile(proto.Message):
161173
number=8,
162174
message="NotificationConfig",
163175
)
176+
new_recognition_result_notification_config: "NotificationConfig" = proto.Field(
177+
proto.MESSAGE,
178+
number=21,
179+
message="NotificationConfig",
180+
)
164181
stt_config: audio_config.SpeechToTextConfig = proto.Field(
165182
proto.MESSAGE,
166183
number=9,

packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/gapic_version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,4 @@
1313
# See the License for the specific language governing permissions and
1414
# limitations under the License.
1515
#
16-
__version__ = "2.37.0" # {x-release-please-version}
16+
__version__ = "0.0.0" # {x-release-please-version}

packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/types/conversation_event.py

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
from google.rpc import status_pb2 # type: ignore
2121
import proto # type: ignore
2222

23-
from google.cloud.dialogflow_v2beta1.types import participant
23+
from google.cloud.dialogflow_v2beta1.types import participant, session
2424

2525
__protobuf__ = proto.module(
2626
package="google.cloud.dialogflow.v2beta1",
@@ -34,6 +34,10 @@ class ConversationEvent(proto.Message):
3434
r"""Represents a notification sent to Pub/Sub subscribers for
3535
conversation lifecycle events.
3636
37+
This message has `oneof`_ fields (mutually exclusive fields).
38+
For each oneof, at most one member field can be set at the same time.
39+
Setting any member of the oneof automatically clears all other
40+
members.
3741
3842
.. _oneof: https://proto-plus-python.readthedocs.io/en/stable/fields.html#oneofs-mutually-exclusive-fields
3943
@@ -51,6 +55,10 @@ class ConversationEvent(proto.Message):
5155
new_message_payload (google.cloud.dialogflow_v2beta1.types.Message):
5256
Payload of NEW_MESSAGE event.
5357
58+
This field is a member of `oneof`_ ``payload``.
59+
new_recognition_result_payload (google.cloud.dialogflow_v2beta1.types.StreamingRecognitionResult):
60+
Payload of NEW_RECOGNITION_RESULT event.
61+
5462
This field is a member of `oneof`_ ``payload``.
5563
"""
5664

@@ -76,6 +84,11 @@ class Type(proto.Enum):
7684
An existing conversation has received a new message, either
7785
from API or telephony. It is configured in
7886
[ConversationProfile.new_message_event_notification_config][google.cloud.dialogflow.v2beta1.ConversationProfile.new_message_event_notification_config]
87+
NEW_RECOGNITION_RESULT (7):
88+
An existing conversation has received a new speech
89+
recognition result. This is mainly for delivering
90+
intermediate transcripts. The notification is configured in
91+
[ConversationProfile.new_recognition_event_notification_config][].
7992
UNRECOVERABLE_ERROR (4):
8093
Unrecoverable error during a telephone call.
8194
@@ -95,6 +108,7 @@ class Type(proto.Enum):
95108
CONVERSATION_FINISHED = 2
96109
HUMAN_INTERVENTION_NEEDED = 3
97110
NEW_MESSAGE = 5
111+
NEW_RECOGNITION_RESULT = 7
98112
UNRECOVERABLE_ERROR = 4
99113

100114
conversation: str = proto.Field(
@@ -117,6 +131,12 @@ class Type(proto.Enum):
117131
oneof="payload",
118132
message=participant.Message,
119133
)
134+
new_recognition_result_payload: session.StreamingRecognitionResult = proto.Field(
135+
proto.MESSAGE,
136+
number=5,
137+
oneof="payload",
138+
message=session.StreamingRecognitionResult,
139+
)
120140

121141

122142
__all__ = tuple(sorted(__protobuf__.manifest))

packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/types/conversation_profile.py

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,18 @@ class ConversationProfile(proto.Message):
8585
Configuration for publishing new message events. Event will
8686
be sent in format of
8787
[ConversationEvent][google.cloud.dialogflow.v2beta1.ConversationEvent]
88+
new_recognition_result_notification_config (google.cloud.dialogflow_v2beta1.types.NotificationConfig):
89+
Optional. Configuration for publishing transcription
90+
intermediate results. Event will be sent in format of
91+
[ConversationEvent][google.cloud.dialogflow.v2beta1.ConversationEvent].
92+
If configured, the following information will be populated
93+
as
94+
[ConversationEvent][google.cloud.dialogflow.v2beta1.ConversationEvent]
95+
Pub/Sub message attributes:
96+
97+
- "participant_id"
98+
- "participant_role"
99+
- "message_id".
88100
stt_config (google.cloud.dialogflow_v2beta1.types.SpeechToTextConfig):
89101
Settings for speech transcription.
90102
language_code (str):
@@ -160,6 +172,11 @@ class ConversationProfile(proto.Message):
160172
number=8,
161173
message="NotificationConfig",
162174
)
175+
new_recognition_result_notification_config: "NotificationConfig" = proto.Field(
176+
proto.MESSAGE,
177+
number=21,
178+
message="NotificationConfig",
179+
)
163180
stt_config: audio_config.SpeechToTextConfig = proto.Field(
164181
proto.MESSAGE,
165182
number=9,

packages/google-cloud-dialogflow/samples/generated_samples/snippet_metadata_google.cloud.dialogflow.v2.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
],
99
"language": "PYTHON",
1010
"name": "google-cloud-dialogflow",
11-
"version": "2.37.0"
11+
"version": "0.1.0"
1212
},
1313
"snippets": [
1414
{

packages/google-cloud-dialogflow/samples/generated_samples/snippet_metadata_google.cloud.dialogflow.v2beta1.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
],
99
"language": "PYTHON",
1010
"name": "google-cloud-dialogflow",
11-
"version": "2.37.0"
11+
"version": "0.1.0"
1212
},
1313
"snippets": [
1414
{

packages/google-cloud-dialogflow/tests/unit/gapic/dialogflow_v2/test_conversation_profiles.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6193,6 +6193,7 @@ def test_create_conversation_profile_rest_call_success(request_type):
61936193
"notification_config": {},
61946194
"logging_config": {"enable_stackdriver_logging": True},
61956195
"new_message_event_notification_config": {},
6196+
"new_recognition_result_notification_config": {},
61966197
"stt_config": {
61976198
"speech_model_variant": 1,
61986199
"model": "model_value",
@@ -6507,6 +6508,7 @@ def test_update_conversation_profile_rest_call_success(request_type):
65076508
"notification_config": {},
65086509
"logging_config": {"enable_stackdriver_logging": True},
65096510
"new_message_event_notification_config": {},
6511+
"new_recognition_result_notification_config": {},
65106512
"stt_config": {
65116513
"speech_model_variant": 1,
65126514
"model": "model_value",

0 commit comments

Comments
 (0)