Skip to content

Commit bfc25b7

Browse files
feat: add optional SpeechConfig to UploadConversationRequest (#11750)
BEGIN_COMMIT_OVERRIDE feat: add optional SpeechConfig to UploadConversationRequest END_COMMIT_OVERRIDE - [ ] Regenerate this pull request now. PiperOrigin-RevId: 567616394 Source-Link: googleapis/googleapis@37b45d1 Source-Link: googleapis/googleapis-gen@fa3a564 Copy-Tag: eyJwIjoicGFja2FnZXMvZ29vZ2xlLWNsb3VkLWNvbnRhY3QtY2VudGVyLWluc2lnaHRzLy5Pd2xCb3QueWFtbCIsImgiOiJmYTNhNTY0OGQzMjY3YTUyZmY4NzQyYzZiY2E0NjVkMzA2ZmNmNGE1In0= --------- Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com> Co-authored-by: ohmayr <omairnaveed@ymail.com>
1 parent 8147cff commit bfc25b7

File tree

14 files changed

+130
-50
lines changed

14 files changed

+130
-50
lines changed

packages/google-cloud-contact-center-insights/CONTRIBUTING.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -143,12 +143,12 @@ Running System Tests
143143
$ nox -s system
144144

145145
# Run a single system test
146-
$ nox -s system- -- -k <name of test>
146+
$ nox -s system-3.11 -- -k <name of test>
147147

148148

149149
.. note::
150150

151-
System tests are only configured to run under Python.
151+
System tests are only configured to run under Python 3.8, 3.9, 3.10 and 3.11.
152152
For expediency, we do not run them in older versions of Python 3.
153153

154154
This alone will not run the tests. You'll need to change some local

packages/google-cloud-contact-center-insights/google/cloud/contact_center_insights/__init__.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,7 @@
130130
SilenceData,
131131
SmartComposeSuggestionData,
132132
SmartReplyData,
133+
SpeechConfig,
133134
View,
134135
)
135136

@@ -239,5 +240,6 @@
239240
"SilenceData",
240241
"SmartComposeSuggestionData",
241242
"SmartReplyData",
243+
"SpeechConfig",
242244
"View",
243245
)

packages/google-cloud-contact-center-insights/google/cloud/contact_center_insights/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__ = "1.12.1" # {x-release-please-version}
16+
__version__ = "0.0.0" # {x-release-please-version}

packages/google-cloud-contact-center-insights/google/cloud/contact_center_insights_v1/__init__.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,7 @@
128128
SilenceData,
129129
SmartComposeSuggestionData,
130130
SmartReplyData,
131+
SpeechConfig,
131132
View,
132133
)
133134

@@ -226,6 +227,7 @@
226227
"SilenceData",
227228
"SmartComposeSuggestionData",
228229
"SmartReplyData",
230+
"SpeechConfig",
229231
"UndeployIssueModelMetadata",
230232
"UndeployIssueModelRequest",
231233
"UndeployIssueModelResponse",

packages/google-cloud-contact-center-insights/google/cloud/contact_center_insights_v1/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__ = "1.12.1" # {x-release-please-version}
16+
__version__ = "0.0.0" # {x-release-please-version}

packages/google-cloud-contact-center-insights/google/cloud/contact_center_insights_v1/services/contact_center_insights/async_client.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,10 @@ class ContactCenterInsightsAsyncClient:
9999
parse_phrase_matcher_path = staticmethod(
100100
ContactCenterInsightsClient.parse_phrase_matcher_path
101101
)
102+
recognizer_path = staticmethod(ContactCenterInsightsClient.recognizer_path)
103+
parse_recognizer_path = staticmethod(
104+
ContactCenterInsightsClient.parse_recognizer_path
105+
)
102106
settings_path = staticmethod(ContactCenterInsightsClient.settings_path)
103107
parse_settings_path = staticmethod(ContactCenterInsightsClient.parse_settings_path)
104108
view_path = staticmethod(ContactCenterInsightsClient.view_path)

packages/google-cloud-contact-center-insights/google/cloud/contact_center_insights_v1/services/contact_center_insights/client.py

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -352,6 +352,30 @@ def parse_phrase_matcher_path(path: str) -> Dict[str, str]:
352352
)
353353
return m.groupdict() if m else {}
354354

355+
@staticmethod
356+
def recognizer_path(
357+
project: str,
358+
location: str,
359+
recognizer: str,
360+
) -> str:
361+
"""Returns a fully-qualified recognizer string."""
362+
return (
363+
"projects/{project}/locations/{location}/recognizers/{recognizer}".format(
364+
project=project,
365+
location=location,
366+
recognizer=recognizer,
367+
)
368+
)
369+
370+
@staticmethod
371+
def parse_recognizer_path(path: str) -> Dict[str, str]:
372+
"""Parses a recognizer path into its component segments."""
373+
m = re.match(
374+
r"^projects/(?P<project>.+?)/locations/(?P<location>.+?)/recognizers/(?P<recognizer>.+?)$",
375+
path,
376+
)
377+
return m.groupdict() if m else {}
378+
355379
@staticmethod
356380
def settings_path(
357381
project: str,

packages/google-cloud-contact-center-insights/google/cloud/contact_center_insights_v1/types/__init__.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,7 @@
119119
SilenceData,
120120
SmartComposeSuggestionData,
121121
SmartReplyData,
122+
SpeechConfig,
122123
View,
123124
)
124125

@@ -226,5 +227,6 @@
226227
"SilenceData",
227228
"SmartComposeSuggestionData",
228229
"SmartReplyData",
230+
"SpeechConfig",
229231
"View",
230232
)

packages/google-cloud-contact-center-insights/google/cloud/contact_center_insights_v1/types/contact_center_insights.py

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -360,6 +360,10 @@ class UploadConversationRequest(proto.Message):
360360
Optional. DLP settings for transcript
361361
redaction. Optional, will default to the config
362362
specified in Settings.
363+
speech_config (google.cloud.contact_center_insights_v1.types.SpeechConfig):
364+
Optional. Default Speech-to-Text
365+
configuration. Optional, will default to the
366+
config specified in Settings.
363367
"""
364368

365369
parent: str = proto.Field(
@@ -380,6 +384,11 @@ class UploadConversationRequest(proto.Message):
380384
number=4,
381385
message=resources.RedactionConfig,
382386
)
387+
speech_config: resources.SpeechConfig = proto.Field(
388+
proto.MESSAGE,
389+
number=11,
390+
message=resources.SpeechConfig,
391+
)
383392

384393

385394
class UploadConversationMetadata(proto.Message):
@@ -584,7 +593,9 @@ class IngestConversationsRequest(proto.Message):
584593
585594
Attributes:
586595
gcs_source (google.cloud.contact_center_insights_v1.types.IngestConversationsRequest.GcsSource):
587-
A cloud storage bucket source.
596+
A cloud storage bucket source. Note that any
597+
previously ingested objects from the source will
598+
be skipped to avoid duplication.
588599
589600
This field is a member of `oneof`_ ``source``.
590601
transcript_object_config (google.cloud.contact_center_insights_v1.types.IngestConversationsRequest.TranscriptObjectConfig):

packages/google-cloud-contact-center-insights/google/cloud/contact_center_insights_v1/types/resources.py

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@
5656
"ExactMatchConfig",
5757
"Settings",
5858
"RedactionConfig",
59+
"SpeechConfig",
5960
"RuntimeAnnotation",
6061
"AnswerFeedback",
6162
"ArticleSuggestionData",
@@ -1735,6 +1736,11 @@ class Settings(proto.Message):
17351736
redaction_config (google.cloud.contact_center_insights_v1.types.RedactionConfig):
17361737
Default DLP redaction resources to be applied
17371738
while ingesting conversations.
1739+
speech_config (google.cloud.contact_center_insights_v1.types.SpeechConfig):
1740+
Optional. Default Speech-to-Text resources to
1741+
be used while ingesting audio files. Optional,
1742+
CCAI Insights will create a default if not
1743+
provided.
17381744
"""
17391745

17401746
class AnalysisConfig(proto.Message):
@@ -1806,6 +1812,11 @@ class AnalysisConfig(proto.Message):
18061812
number=10,
18071813
message="RedactionConfig",
18081814
)
1815+
speech_config: "SpeechConfig" = proto.Field(
1816+
proto.MESSAGE,
1817+
number=11,
1818+
message="SpeechConfig",
1819+
)
18091820

18101821

18111822
class RedactionConfig(proto.Message):
@@ -1833,6 +1844,21 @@ class RedactionConfig(proto.Message):
18331844
)
18341845

18351846

1847+
class SpeechConfig(proto.Message):
1848+
r"""Speech-to-Text configuration.
1849+
1850+
Attributes:
1851+
speech_recognizer (str):
1852+
The fully-qualified Speech Recognizer resource name. Format:
1853+
``projects/{project_id}/locations/{location}/recognizer/{recognizer}``
1854+
"""
1855+
1856+
speech_recognizer: str = proto.Field(
1857+
proto.STRING,
1858+
number=1,
1859+
)
1860+
1861+
18361862
class RuntimeAnnotation(proto.Message):
18371863
r"""An annotation that was generated during the customer and
18381864
agent interaction.

0 commit comments

Comments
 (0)