Skip to content

Commit 0cb5b51

Browse files
gcf-owl-bot[bot]pearigeeshivanee-p
authored
chore: [texttospeech] migrate generator to google-cloud-node (#7937)
* feat: Support safety settings for Gemini voices and deprecate `relax_safety_filters` feat: Support `enable_textnorm` for Gemini voices. feat: Mark `advanced_voice_options` as optional. docs: A comment for field `relax_safety_filters` in message `.google.cloud.texttospeech.v1beta1.AdvancedVoiceOptions` is changed docs: A comment for field `advanced_voice_options` in message `.google.cloud.texttospeech.v1beta1.SynthesizeSpeechRequest` is changed docs: A comment for field `markup` in message `.google.cloud.texttospeech.v1beta1.SynthesisInput` is changed docs: A comment for field `markup` in message `.google.cloud.texttospeech.v1beta1.StreamingSynthesisInput` is changed PiperOrigin-RevId: 892460024 Source-Link: googleapis/googleapis@a481d8b Source-Link: googleapis/googleapis-gen@8034761 Copy-Tag: eyJwIjoicGFja2FnZXMvZ29vZ2xlLWNsb3VkLXRleHR0b3NwZWVjaC8uT3dsQm90LnlhbWwiLCJoIjoiODAzNDc2MThjMzhlMmU5OGU1YTA4ZmJjZjI1NWU2YzViZTIwNTEyNCJ9 * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md * feat: Support safety settings for Gemini voices and deprecate `relax_safety_filters` feat: Support `enable_textnorm` for Gemini voices. feat: Mark `advanced_voice_options` as optional. docs: A comment for field `relax_safety_filters` in message `.google.cloud.texttospeech.v1beta1.AdvancedVoiceOptions` is changed docs: A comment for field `advanced_voice_options` in message `.google.cloud.texttospeech.v1beta1.SynthesizeSpeechRequest` is changed docs: A comment for field `markup` in message `.google.cloud.texttospeech.v1beta1.SynthesisInput` is changed docs: A comment for field `markup` in message `.google.cloud.texttospeech.v1beta1.StreamingSynthesisInput` is changed PiperOrigin-RevId: 892462011 Source-Link: googleapis/googleapis@e38f6d2 Source-Link: googleapis/googleapis-gen@95f8e47 Copy-Tag: eyJwIjoicGFja2FnZXMvZ29vZ2xlLWNsb3VkLXRleHR0b3NwZWVjaC8uT3dsQm90LnlhbWwiLCJoIjoiOTVmOGU0NzBmNDMyZDRiZTJiYzg0OTM1NmQ2OGU1OTkxYjZhYjNmNiJ9 * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md * chore: migrate generator to google-cloud-node chore: update generator system tests PiperOrigin-RevId: 896174961 Source-Link: googleapis/googleapis@2233f63 Source-Link: googleapis/googleapis-gen@c4a8c4e Copy-Tag: eyJwIjoicGFja2FnZXMvZ29vZ2xlLWNsb3VkLXRleHR0b3NwZWVjaC8uT3dsQm90LnlhbWwiLCJoIjoiYzRhOGM0ZWVmOTU5YWE3NDRmYjFjNjcxNDg3NWZhMjk1ZTA2YWFkMyJ9 * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md --------- Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com> Co-authored-by: Gabe Pearhill <86282859+pearigee@users.noreply.github.com> Co-authored-by: Shivanee <46910562+shivanee-p@users.noreply.github.com>
1 parent 5d85291 commit 0cb5b51

13 files changed

Lines changed: 2852 additions & 719 deletions

File tree

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
{
2-
"extends": "./node_modules/gts"
2+
"extends": "./node_modules/gts",
3+
"root": true
34
}

packages/google-cloud-texttospeech/protos/google/cloud/texttospeech/v1/cloud_tts.proto

Lines changed: 83 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright 2025 Google LLC
1+
// Copyright 2026 Google LLC
22
//
33
// Licensed under the Apache License, Version 2.0 (the "License");
44
// you may not use this file except in compliance with the License.
@@ -161,18 +161,85 @@ message Voice {
161161

162162
// Used for advanced voice options.
163163
message AdvancedVoiceOptions {
164+
// Safety setting for a single harm category.
165+
message SafetySetting {
166+
// The harm category to apply the safety setting to.
167+
HarmCategory category = 1;
168+
169+
// The harm block threshold for the safety setting.
170+
HarmBlockThreshold threshold = 2;
171+
}
172+
173+
// Safety settings for the request.
174+
message SafetySettings {
175+
// The safety settings for the request.
176+
repeated SafetySetting settings = 1;
177+
}
178+
179+
// Harm categories that will block the content.
180+
enum HarmCategory {
181+
// Default value. This value is unused.
182+
HARM_CATEGORY_UNSPECIFIED = 0;
183+
184+
// Content that promotes violence or incites hatred against individuals or
185+
// groups based on certain attributes.
186+
HARM_CATEGORY_HATE_SPEECH = 1;
187+
188+
// Content that promotes, facilitates, or enables dangerous activities.
189+
HARM_CATEGORY_DANGEROUS_CONTENT = 2;
190+
191+
// Abusive, threatening, or content intended to bully, torment, or ridicule.
192+
HARM_CATEGORY_HARASSMENT = 3;
193+
194+
// Content that contains sexually explicit material.
195+
HARM_CATEGORY_SEXUALLY_EXPLICIT = 4;
196+
}
197+
198+
// Harm block thresholds for the safety settings.
199+
enum HarmBlockThreshold {
200+
// The harm block threshold is unspecified.
201+
HARM_BLOCK_THRESHOLD_UNSPECIFIED = 0;
202+
203+
// Block content with a low harm probability or higher.
204+
BLOCK_LOW_AND_ABOVE = 1;
205+
206+
// Block content with a medium harm probability or higher.
207+
BLOCK_MEDIUM_AND_ABOVE = 2;
208+
209+
// Block content with a high harm probability.
210+
BLOCK_ONLY_HIGH = 3;
211+
212+
// Do not block any content, regardless of its harm probability.
213+
BLOCK_NONE = 4;
214+
215+
// Turn off the safety filter entirely.
216+
OFF = 5;
217+
}
218+
164219
// Only for Journey voices. If false, the synthesis is context aware
165220
// and has a higher latency.
166221
optional bool low_latency_journey_synthesis = 1;
167222

168-
// Optional. Input only. If true, relaxes safety filters for Gemini TTS. Only
169-
// supported for accounts linked to Invoiced (Offline) Cloud billing accounts.
170-
// Otherwise, will return result
171-
// [google.rpc.Code.INVALID_ARGUMENT][google.rpc.Code.INVALID_ARGUMENT].
223+
// Optional. Input only. Deprecated, use safety_settings instead.
224+
// If true, relaxes safety filters for Gemini TTS.
172225
bool relax_safety_filters = 8 [
226+
deprecated = true,
173227
(google.api.field_behavior) = INPUT_ONLY,
174228
(google.api.field_behavior) = OPTIONAL
175229
];
230+
231+
// Optional. Input only. This applies to Gemini TTS only. If set, the category
232+
// specified in the safety setting will be blocked if the harm probability is
233+
// above the threshold. Otherwise, the safety filter will be disabled by
234+
// default.
235+
SafetySettings safety_settings = 9 [
236+
(google.api.field_behavior) = INPUT_ONLY,
237+
(google.api.field_behavior) = OPTIONAL
238+
];
239+
240+
// Optional. If true, textnorm will be applied to text input. This feature is
241+
// enabled by default. Only applies for Gemini TTS.
242+
optional bool enable_textnorm = 2 [(google.api.field_behavior) = OPTIONAL];
176243
}
177244

178245
// The top-level message sent by the client for the `SynthesizeSpeech` method.
@@ -186,8 +253,9 @@ message SynthesizeSpeechRequest {
186253
// Required. The configuration of the synthesized audio.
187254
AudioConfig audio_config = 3 [(google.api.field_behavior) = REQUIRED];
188255

189-
// Advanced voice options.
190-
optional AdvancedVoiceOptions advanced_voice_options = 8;
256+
// Optional. Advanced voice options.
257+
optional AdvancedVoiceOptions advanced_voice_options = 8
258+
[(google.api.field_behavior) = OPTIONAL];
191259
}
192260

193261
// Pronunciation customization for a phrase.
@@ -296,8 +364,8 @@ message SynthesisInput {
296364
// The raw text to be synthesized.
297365
string text = 1;
298366

299-
// Markup for HD voices specifically. This field may not be used with any
300-
// other voices.
367+
// Markup for Chirp 3: HD voices specifically. This field may not be used
368+
// with any other voices.
301369
string markup = 5;
302370

303371
// The SSML document to be synthesized. The SSML document must be valid
@@ -522,6 +590,10 @@ message StreamingSynthesizeConfig {
522590
// be inside a phoneme tag.
523591
CustomPronunciations custom_pronunciations = 5
524592
[(google.api.field_behavior) = OPTIONAL];
593+
594+
// Optional. Advanced voice options.
595+
optional AdvancedVoiceOptions advanced_voice_options = 7
596+
[(google.api.field_behavior) = OPTIONAL];
525597
}
526598

527599
// Input to be synthesized.
@@ -532,8 +604,8 @@ message StreamingSynthesisInput {
532604
// in the output audio.
533605
string text = 1;
534606

535-
// Markup for HD voices specifically. This field may not be used with any
536-
// other voices.
607+
// Markup for Chirp 3: HD voices specifically. This field may not be used
608+
// with any other voices.
537609
string markup = 5;
538610

539611
// Multi-speaker markup for Gemini TTS. This field may not

packages/google-cloud-texttospeech/protos/google/cloud/texttospeech/v1/cloud_tts_lrs.proto

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright 2025 Google LLC
1+
// Copyright 2026 Google LLC
22
//
33
// Licensed under the Apache License, Version 2.0 (the "License");
44
// you may not use this file except in compliance with the License.

packages/google-cloud-texttospeech/protos/google/cloud/texttospeech/v1beta1/cloud_tts.proto

Lines changed: 83 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright 2025 Google LLC
1+
// Copyright 2026 Google LLC
22
//
33
// Licensed under the Apache License, Version 2.0 (the "License");
44
// you may not use this file except in compliance with the License.
@@ -164,18 +164,85 @@ message Voice {
164164

165165
// Used for advanced voice options.
166166
message AdvancedVoiceOptions {
167+
// Safety setting for a single harm category.
168+
message SafetySetting {
169+
// The harm category to apply the safety setting to.
170+
HarmCategory category = 1;
171+
172+
// The harm block threshold for the safety setting.
173+
HarmBlockThreshold threshold = 2;
174+
}
175+
176+
// Safety settings for the request.
177+
message SafetySettings {
178+
// The safety settings for the request.
179+
repeated SafetySetting settings = 1;
180+
}
181+
182+
// Harm categories that will block the content.
183+
enum HarmCategory {
184+
// Default value. This value is unused.
185+
HARM_CATEGORY_UNSPECIFIED = 0;
186+
187+
// Content that promotes violence or incites hatred against individuals or
188+
// groups based on certain attributes.
189+
HARM_CATEGORY_HATE_SPEECH = 1;
190+
191+
// Content that promotes, facilitates, or enables dangerous activities.
192+
HARM_CATEGORY_DANGEROUS_CONTENT = 2;
193+
194+
// Abusive, threatening, or content intended to bully, torment, or ridicule.
195+
HARM_CATEGORY_HARASSMENT = 3;
196+
197+
// Content that contains sexually explicit material.
198+
HARM_CATEGORY_SEXUALLY_EXPLICIT = 4;
199+
}
200+
201+
// Harm block thresholds for the safety settings.
202+
enum HarmBlockThreshold {
203+
// The harm block threshold is unspecified.
204+
HARM_BLOCK_THRESHOLD_UNSPECIFIED = 0;
205+
206+
// Block content with a low harm probability or higher.
207+
BLOCK_LOW_AND_ABOVE = 1;
208+
209+
// Block content with a medium harm probability or higher.
210+
BLOCK_MEDIUM_AND_ABOVE = 2;
211+
212+
// Block content with a high harm probability.
213+
BLOCK_ONLY_HIGH = 3;
214+
215+
// Do not block any content, regardless of its harm probability.
216+
BLOCK_NONE = 4;
217+
218+
// Turn off the safety filter entirely.
219+
OFF = 5;
220+
}
221+
167222
// Only for Journey voices. If false, the synthesis is context aware
168223
// and has a higher latency.
169224
optional bool low_latency_journey_synthesis = 1;
170225

171-
// Optional. Input only. If true, relaxes safety filters for Gemini TTS. Only
172-
// supported for accounts linked to Invoiced (Offline) Cloud billing accounts.
173-
// Otherwise, will return result
174-
// [google.rpc.Code.INVALID_ARGUMENT][google.rpc.Code.INVALID_ARGUMENT].
226+
// Optional. Input only. Deprecated, use safety_settings instead.
227+
// If true, relaxes safety filters for Gemini TTS.
175228
bool relax_safety_filters = 8 [
229+
deprecated = true,
176230
(google.api.field_behavior) = INPUT_ONLY,
177231
(google.api.field_behavior) = OPTIONAL
178232
];
233+
234+
// Optional. Input only. This applies to Gemini TTS only. If set, the category
235+
// specified in the safety setting will be blocked if the harm probability is
236+
// above the threshold. Otherwise, the safety filter will be disabled by
237+
// default.
238+
SafetySettings safety_settings = 9 [
239+
(google.api.field_behavior) = INPUT_ONLY,
240+
(google.api.field_behavior) = OPTIONAL
241+
];
242+
243+
// Optional. If true, textnorm will be applied to text input. This feature is
244+
// enabled by default. Only applies for Gemini TTS.
245+
optional bool enable_textnorm = 2 [(google.api.field_behavior) = OPTIONAL];
179246
}
180247

181248
// The top-level message sent by the client for the `SynthesizeSpeech` method.
@@ -201,8 +268,9 @@ message SynthesizeSpeechRequest {
201268
// Whether and what timepoints are returned in the response.
202269
repeated TimepointType enable_time_pointing = 4;
203270

204-
// Advanced voice options.
205-
optional AdvancedVoiceOptions advanced_voice_options = 8;
271+
// Optional. Advanced voice options.
272+
optional AdvancedVoiceOptions advanced_voice_options = 8
273+
[(google.api.field_behavior) = OPTIONAL];
206274
}
207275

208276
// Pronunciation customization for a phrase.
@@ -311,8 +379,8 @@ message SynthesisInput {
311379
// The raw text to be synthesized.
312380
string text = 1;
313381

314-
// Markup for HD voices specifically. This field may not be used with any
315-
// other voices.
382+
// Markup for Chirp 3: HD voices specifically. This field may not be used
383+
// with any other voices.
316384
string markup = 5;
317385

318386
// The SSML document to be synthesized. The SSML document must be valid
@@ -554,6 +622,10 @@ message StreamingSynthesizeConfig {
554622
// be inside a phoneme tag.
555623
CustomPronunciations custom_pronunciations = 5
556624
[(google.api.field_behavior) = OPTIONAL];
625+
626+
// Optional. Advanced voice options.
627+
optional AdvancedVoiceOptions advanced_voice_options = 7
628+
[(google.api.field_behavior) = OPTIONAL];
557629
}
558630

559631
// Input to be synthesized.
@@ -564,8 +636,8 @@ message StreamingSynthesisInput {
564636
// in the output audio.
565637
string text = 1;
566638

567-
// Markup for HD voices specifically. This field may not be used with any
568-
// other voices.
639+
// Markup for Chirp 3: HD voices specifically. This field may not be used
640+
// with any other voices.
569641
string markup = 5;
570642

571643
// Multi-speaker markup for Gemini TTS. This field may not

packages/google-cloud-texttospeech/protos/google/cloud/texttospeech/v1beta1/cloud_tts_lrs.proto

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright 2025 Google LLC
1+
// Copyright 2026 Google LLC
22
//
33
// Licensed under the Apache License, Version 2.0 (the "License");
44
// you may not use this file except in compliance with the License.

0 commit comments

Comments
 (0)