blob: 5dee9f4049e8c9237b7abf06e047cba4ac045fdb [file] [edit]
<html><body>
<style>
body, h1, h2, h3, div, span, p, pre, a {
margin: 0;
padding: 0;
border: 0;
font-weight: inherit;
font-style: inherit;
font-size: 100%;
font-family: inherit;
vertical-align: baseline;
}
body {
font-size: 13px;
padding: 1em;
}
h1 {
font-size: 26px;
margin-bottom: 1em;
}
h2 {
font-size: 24px;
margin-bottom: 1em;
}
h3 {
font-size: 20px;
margin-bottom: 1em;
margin-top: 1em;
}
pre, code {
line-height: 1.5;
font-family: Monaco, 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Lucida Console', monospace;
}
pre {
margin-top: 0.5em;
}
h1, h2, h3, p {
font-family: Arial, sans serif;
}
h1, h2, h3 {
border-bottom: solid #CCC 1px;
}
.toc_element {
margin-top: 0.5em;
}
.firstline {
margin-left: 2 em;
}
.method {
margin-top: 1em;
border: solid 1px #CCC;
padding: 1em;
background: #EEE;
}
.details {
font-weight: bold;
font-size: 14px;
}
</style>
<h1><a href="aiplatform_v1beta1.html">Agent Platform API</a> . <a href="aiplatform_v1beta1.projects.html">projects</a> . <a href="aiplatform_v1beta1.projects.locations.html">locations</a> . <a href="aiplatform_v1beta1.projects.locations.voices.html">voices</a></h1>
<h2>Instance Methods</h2>
<p class="toc_element">
<code><a href="#close">close()</a></code></p>
<p class="firstline">Close httplib2 connections.</p>
<p class="toc_element">
<code><a href="#create">create(parent, body=None, x__xgafv=None)</a></code></p>
<p class="firstline">Creates a custom voice from a natural-language prompt (`VOICE_TYPE_PROMPTED`) or from reference and consent audio recordings (`VOICE_TYPE_REPLICATED`).</p>
<p class="toc_element">
<code><a href="#delete">delete(name, x__xgafv=None)</a></code></p>
<p class="firstline">Deletes a custom stored voice (`store = true`) by resource name. Prebuilt catalog voices (`"prebuilt"`) cannot be deleted.</p>
<p class="toc_element">
<code><a href="#get">get(name, x__xgafv=None)</a></code></p>
<p class="firstline">Gets a custom stored voice (`store = true`) by resource name. Prebuilt catalog voices (`VOICE_TYPE_PREBUILT`) cannot be retrieved via `GetVoice`; use `ListVoices` instead.</p>
<p class="toc_element">
<code><a href="#list">list(parent, accent=None, context=None, gender=None, languageCode=None, pageSize=None, pageToken=None, persona=None, pitch=None, regionCode=None, search=None, type=None, x__xgafv=None)</a></code></p>
<p class="firstline">Lists custom stored voices owned by the caller as well as prebuilt system voices from Google's voice catalog.</p>
<p class="toc_element">
<code><a href="#list_next">list_next(previous_request, previous_response)</a></code></p>
<p class="firstline">Retrieves the next page of results.</p>
<h3>Method Details</h3>
<div class="method">
<code class="details" id="close">close()</code>
<pre>Close httplib2 connections.</pre>
</div>
<div class="method">
<code class="details" id="create">create(parent, body=None, x__xgafv=None)</code>
<pre>Creates a custom voice from a natural-language prompt (`VOICE_TYPE_PROMPTED`) or from reference and consent audio recordings (`VOICE_TYPE_REPLICATED`).
Args:
parent: string, Required. The parent resource where this voice will be created. Format: `projects/{project}/locations/{location}` Supported only by the Vertex API. (required)
body: object, The request body.
The object takes the form of:
{ # Request message for `VoicesService.CreateVoice`.
&quot;store&quot;: True or False, # Optional. Whether the created voice is persisted and managed by Google. * When `true`, Google stores the voice and returns `Voice.id` (for example, `voice_abc123def456`), which can be managed via `GetVoice`, `ListVoices`, and `DeleteVoice` and referenced by ID in synthesis requests. Stored voices expire after 1 year of inactivity; using a stored voice in speech synthesis or as a `base_voice` in `CreateVoice` extends its `expire_time`. Projects are subject to a maximum active stored voice quota; exceeding the quota returns `RESOURCE_EXHAUSTED`. * When `false` (default), the voice is not stored by Google and `Voice.key` (for example, `voicekey_...`) is returned for client-side storage and synthesis. Optional discovery metadata fields on `voice` are not persisted or returned when `store` is `false`. * Required to be `true` when `voice.type` is `&quot;prompted&quot;` (otherwise fails with `INVALID_ARGUMENT`).
&quot;voice&quot;: { # A voice resource representing either a custom voice (created via `CreateVoice`) or a prebuilt system voice (returned by `ListVoices`). # Required. The voice to create. `voice.model` is optional; if omitted, the service selects the default voice creation model. Output-only fields on `Voice` (`id`, `key`, `expire_time`, `usage`) are ignored if set.
&quot;accent&quot;: &quot;A String&quot;, # Optional. Regional accent descriptor (e.g. &quot;American&quot;, &quot;British&quot;).
&quot;context&quot;: &quot;A String&quot;, # Optional. Optimal usage context or domain (e.g. &quot;Conversational&quot;, &quot;Audiobook&quot;, &quot;News&quot;).
&quot;description&quot;: &quot;A String&quot;, # Optional. Descriptive summary of vocal timbre, personality, and tone.
&quot;displayName&quot;: &quot;A String&quot;, # Optional. User-provided display name for a stored voice (`store = true`), or the catalog name for a prebuilt voice.
&quot;expireTime&quot;: &quot;A String&quot;, # Output only. The timestamp at which a custom stored voice (`store = true`) or replicated voice key (`store = false`) expires. For custom stored voices (`store = true`), this expiration time is extended when the voice is used for speech synthesis or as a `base_voice` in `CreateVoice`. Unset for prebuilt catalog voices (`&quot;prebuilt&quot;`), which do not expire.
&quot;gender&quot;: &quot;A String&quot;, # Optional. Perceived voice gender presentation (e.g. &quot;female&quot;, &quot;male&quot;, &quot;neutral&quot;).
&quot;id&quot;: &quot;A String&quot;, # Output only. The unique identifier of the voice. * For Google-managed custom voices (`store = true`), this is a generated ID with prefix `voice_` (for example, `voice_abc123def456`). Pass `voices/{id}` as the `name` in `GetVoice` and `DeleteVoice`, and pass `{id}` directly to `SpeechConfig.voice_config.voice` (or `SpeechConfig.voice`) during speech synthesis. * For prebuilt catalog voices (`&quot;prebuilt&quot;` returned by `ListVoices`), this is the speaker name (for example, `Puck` or `Charon`). * Unset when `CreateVoice` is called with `store = false`.
&quot;key&quot;: &quot;A String&quot;, # Output only. The client-managed voice replication key (with prefix `voicekey_`). Returned only by `CreateVoice` when `type` is `&quot;replicated&quot;` and `store` is `false`. Pass this key to `SpeechConfig.voice_config.voice` (or `SpeechConfig.voice`) during speech synthesis.
&quot;languageCode&quot;: &quot;A String&quot;, # Optional. Primary BCP-47 language tag (e.g. &quot;en-US&quot;, &quot;fr-FR&quot;).
&quot;model&quot;: &quot;A String&quot;, # Optional. The model used to design or replicate the voice. If omitted in `CreateVoice`, defaults to the latest supported voice design model. Returned in `CreateVoice`, `GetVoice`, and `ListVoices` responses for custom voices (`&quot;prompted&quot;` and `&quot;replicated&quot;`); unset for `&quot;prebuilt&quot;` voices. Created voices can be synthesized across any supported TTS synthesis model.
&quot;persona&quot;: &quot;A String&quot;, # Optional. Intended persona or character archetype (e.g. &quot;Warm, Friendly&quot;, &quot;Narrator&quot;).
&quot;pitch&quot;: &quot;A String&quot;, # Optional. Voice pitch classification.
&quot;prompted&quot;: { # Parameters for prompted voice generation. Required in `CreateVoice` when `type` is `&quot;prompted&quot;`. Returned in `CreateVoice`, `GetVoice`, and `ListVoices` responses for prompted voices. # Parameters for prompted voice generation. Required in `CreateVoice` when `type` is `&quot;prompted&quot;`. Returned in `CreateVoice`, `GetVoice`, and `ListVoices` responses for prompted voices.
&quot;input&quot;: &quot;A String&quot;, # Required. The natural-language prompt describing the desired voice, e.g. &quot;A deep, booming male voice of a massive evil ogre in his middle years.&quot;
},
&quot;regionCode&quot;: &quot;A String&quot;, # Optional. ISO 3166-1 alpha-2 or UN M.49 geographic region code (e.g. &quot;US&quot;, &quot;GB&quot;, &quot;001&quot;).
&quot;replicated&quot;: { # Input only. Parameters for replicated voice generation. Required on input when `type` is `&quot;replicated&quot;`. Not returned in responses. # Input only. Parameters for replicated voice generation. Required on input when `type` is `&quot;replicated&quot;`. Not returned in responses.
&quot;consentAudio&quot;: { # Audio payload used for voice creation. # Required. Audio recording of the same speaker reading the required consent phrase, confirming authorization to replicate the voice.
&quot;data&quot;: &quot;A String&quot;, # Required. The raw audio bytes.
&quot;mimeType&quot;: &quot;A String&quot;, # Required. The IANA MIME type of the audio data (for example, `audio/wav` or `audio/mpeg`).
},
&quot;sourceAudio&quot;: { # Audio payload used for voice creation. # Required. The reference audio sample of the speaker&#x27;s voice to replicate. Must be an unmodified recording of an adult human voice.
&quot;data&quot;: &quot;A String&quot;, # Required. The raw audio bytes.
&quot;mimeType&quot;: &quot;A String&quot;, # Required. The IANA MIME type of the audio data (for example, `audio/wav` or `audio/mpeg`).
},
},
&quot;sampleAudio&quot;: { # Audio payload used for voice creation. # Output only. Sample audio (synthesizer prompt audio) generated for a prompted voice. Populated only in `CreateVoice` and `GetVoice` responses when `type` is `&quot;prompted&quot;`; unset in `ListVoices` responses and for `&quot;replicated&quot;` or `&quot;prebuilt&quot;` voices.
&quot;data&quot;: &quot;A String&quot;, # Required. The raw audio bytes.
&quot;mimeType&quot;: &quot;A String&quot;, # Required. The IANA MIME type of the audio data (for example, `audio/wav` or `audio/mpeg`).
},
&quot;type&quot;: &quot;A String&quot;, # Required. The type of the voice. In `CreateVoice`, must be `&quot;replicated&quot;` or `&quot;prompted&quot;`. In `ListVoices` responses, may also be `&quot;prebuilt&quot;`.
&quot;usage&quot;: { # Statistics on the interaction request&#x27;s token usage. # Output only. Token usage statistics for the voice creation request. Populated only in the response of `CreateVoice` when `type` is `&quot;prompted&quot;`; unset for `&quot;replicated&quot;` and in `GetVoice` and `ListVoices` responses.
&quot;cachedTokensByModality&quot;: [ # A breakdown of cached token usage by modality.
{ # The token count for a single response modality.
&quot;modality&quot;: &quot;A String&quot;, # The modality associated with the token count.
&quot;tokens&quot;: 42, # Number of tokens for the modality.
},
],
&quot;groundingToolCount&quot;: [ # Grounding tool count.
{ # The number of grounding tool counts.
&quot;count&quot;: 42, # The number of grounding tool counts.
&quot;type&quot;: &quot;A String&quot;, # The grounding tool type associated with the count.
},
],
&quot;inputTokensByModality&quot;: [ # A breakdown of input token usage by modality.
{ # The token count for a single response modality.
&quot;modality&quot;: &quot;A String&quot;, # The modality associated with the token count.
&quot;tokens&quot;: 42, # Number of tokens for the modality.
},
],
&quot;outputTokensByModality&quot;: [ # A breakdown of output token usage by modality.
{ # The token count for a single response modality.
&quot;modality&quot;: &quot;A String&quot;, # The modality associated with the token count.
&quot;tokens&quot;: 42, # Number of tokens for the modality.
},
],
&quot;toolUseTokensByModality&quot;: [ # A breakdown of tool-use token usage by modality.
{ # The token count for a single response modality.
&quot;modality&quot;: &quot;A String&quot;, # The modality associated with the token count.
&quot;tokens&quot;: 42, # Number of tokens for the modality.
},
],
&quot;totalCachedTokens&quot;: 42, # Number of tokens in the cached part of the prompt (the cached content).
&quot;totalInputTokens&quot;: 42, # Number of tokens in the prompt (context).
&quot;totalOutputTokens&quot;: 42, # Total number of tokens across all the generated responses.
&quot;totalThoughtTokens&quot;: 42, # Number of tokens of thoughts for thinking models.
&quot;totalTokens&quot;: 42, # Total token count for the interaction request (prompt + responses + other internal tokens).
&quot;totalToolUseTokens&quot;: 42, # Number of tokens present in tool-use prompt(s).
},
},
}
x__xgafv: string, V1 error format.
Allowed values
1 - v1 error format
2 - v2 error format
Returns:
An object of the form:
{ # A voice resource representing either a custom voice (created via `CreateVoice`) or a prebuilt system voice (returned by `ListVoices`).
&quot;accent&quot;: &quot;A String&quot;, # Optional. Regional accent descriptor (e.g. &quot;American&quot;, &quot;British&quot;).
&quot;context&quot;: &quot;A String&quot;, # Optional. Optimal usage context or domain (e.g. &quot;Conversational&quot;, &quot;Audiobook&quot;, &quot;News&quot;).
&quot;description&quot;: &quot;A String&quot;, # Optional. Descriptive summary of vocal timbre, personality, and tone.
&quot;displayName&quot;: &quot;A String&quot;, # Optional. User-provided display name for a stored voice (`store = true`), or the catalog name for a prebuilt voice.
&quot;expireTime&quot;: &quot;A String&quot;, # Output only. The timestamp at which a custom stored voice (`store = true`) or replicated voice key (`store = false`) expires. For custom stored voices (`store = true`), this expiration time is extended when the voice is used for speech synthesis or as a `base_voice` in `CreateVoice`. Unset for prebuilt catalog voices (`&quot;prebuilt&quot;`), which do not expire.
&quot;gender&quot;: &quot;A String&quot;, # Optional. Perceived voice gender presentation (e.g. &quot;female&quot;, &quot;male&quot;, &quot;neutral&quot;).
&quot;id&quot;: &quot;A String&quot;, # Output only. The unique identifier of the voice. * For Google-managed custom voices (`store = true`), this is a generated ID with prefix `voice_` (for example, `voice_abc123def456`). Pass `voices/{id}` as the `name` in `GetVoice` and `DeleteVoice`, and pass `{id}` directly to `SpeechConfig.voice_config.voice` (or `SpeechConfig.voice`) during speech synthesis. * For prebuilt catalog voices (`&quot;prebuilt&quot;` returned by `ListVoices`), this is the speaker name (for example, `Puck` or `Charon`). * Unset when `CreateVoice` is called with `store = false`.
&quot;key&quot;: &quot;A String&quot;, # Output only. The client-managed voice replication key (with prefix `voicekey_`). Returned only by `CreateVoice` when `type` is `&quot;replicated&quot;` and `store` is `false`. Pass this key to `SpeechConfig.voice_config.voice` (or `SpeechConfig.voice`) during speech synthesis.
&quot;languageCode&quot;: &quot;A String&quot;, # Optional. Primary BCP-47 language tag (e.g. &quot;en-US&quot;, &quot;fr-FR&quot;).
&quot;model&quot;: &quot;A String&quot;, # Optional. The model used to design or replicate the voice. If omitted in `CreateVoice`, defaults to the latest supported voice design model. Returned in `CreateVoice`, `GetVoice`, and `ListVoices` responses for custom voices (`&quot;prompted&quot;` and `&quot;replicated&quot;`); unset for `&quot;prebuilt&quot;` voices. Created voices can be synthesized across any supported TTS synthesis model.
&quot;persona&quot;: &quot;A String&quot;, # Optional. Intended persona or character archetype (e.g. &quot;Warm, Friendly&quot;, &quot;Narrator&quot;).
&quot;pitch&quot;: &quot;A String&quot;, # Optional. Voice pitch classification.
&quot;prompted&quot;: { # Parameters for prompted voice generation. Required in `CreateVoice` when `type` is `&quot;prompted&quot;`. Returned in `CreateVoice`, `GetVoice`, and `ListVoices` responses for prompted voices. # Parameters for prompted voice generation. Required in `CreateVoice` when `type` is `&quot;prompted&quot;`. Returned in `CreateVoice`, `GetVoice`, and `ListVoices` responses for prompted voices.
&quot;input&quot;: &quot;A String&quot;, # Required. The natural-language prompt describing the desired voice, e.g. &quot;A deep, booming male voice of a massive evil ogre in his middle years.&quot;
},
&quot;regionCode&quot;: &quot;A String&quot;, # Optional. ISO 3166-1 alpha-2 or UN M.49 geographic region code (e.g. &quot;US&quot;, &quot;GB&quot;, &quot;001&quot;).
&quot;replicated&quot;: { # Input only. Parameters for replicated voice generation. Required on input when `type` is `&quot;replicated&quot;`. Not returned in responses. # Input only. Parameters for replicated voice generation. Required on input when `type` is `&quot;replicated&quot;`. Not returned in responses.
&quot;consentAudio&quot;: { # Audio payload used for voice creation. # Required. Audio recording of the same speaker reading the required consent phrase, confirming authorization to replicate the voice.
&quot;data&quot;: &quot;A String&quot;, # Required. The raw audio bytes.
&quot;mimeType&quot;: &quot;A String&quot;, # Required. The IANA MIME type of the audio data (for example, `audio/wav` or `audio/mpeg`).
},
&quot;sourceAudio&quot;: { # Audio payload used for voice creation. # Required. The reference audio sample of the speaker&#x27;s voice to replicate. Must be an unmodified recording of an adult human voice.
&quot;data&quot;: &quot;A String&quot;, # Required. The raw audio bytes.
&quot;mimeType&quot;: &quot;A String&quot;, # Required. The IANA MIME type of the audio data (for example, `audio/wav` or `audio/mpeg`).
},
},
&quot;sampleAudio&quot;: { # Audio payload used for voice creation. # Output only. Sample audio (synthesizer prompt audio) generated for a prompted voice. Populated only in `CreateVoice` and `GetVoice` responses when `type` is `&quot;prompted&quot;`; unset in `ListVoices` responses and for `&quot;replicated&quot;` or `&quot;prebuilt&quot;` voices.
&quot;data&quot;: &quot;A String&quot;, # Required. The raw audio bytes.
&quot;mimeType&quot;: &quot;A String&quot;, # Required. The IANA MIME type of the audio data (for example, `audio/wav` or `audio/mpeg`).
},
&quot;type&quot;: &quot;A String&quot;, # Required. The type of the voice. In `CreateVoice`, must be `&quot;replicated&quot;` or `&quot;prompted&quot;`. In `ListVoices` responses, may also be `&quot;prebuilt&quot;`.
&quot;usage&quot;: { # Statistics on the interaction request&#x27;s token usage. # Output only. Token usage statistics for the voice creation request. Populated only in the response of `CreateVoice` when `type` is `&quot;prompted&quot;`; unset for `&quot;replicated&quot;` and in `GetVoice` and `ListVoices` responses.
&quot;cachedTokensByModality&quot;: [ # A breakdown of cached token usage by modality.
{ # The token count for a single response modality.
&quot;modality&quot;: &quot;A String&quot;, # The modality associated with the token count.
&quot;tokens&quot;: 42, # Number of tokens for the modality.
},
],
&quot;groundingToolCount&quot;: [ # Grounding tool count.
{ # The number of grounding tool counts.
&quot;count&quot;: 42, # The number of grounding tool counts.
&quot;type&quot;: &quot;A String&quot;, # The grounding tool type associated with the count.
},
],
&quot;inputTokensByModality&quot;: [ # A breakdown of input token usage by modality.
{ # The token count for a single response modality.
&quot;modality&quot;: &quot;A String&quot;, # The modality associated with the token count.
&quot;tokens&quot;: 42, # Number of tokens for the modality.
},
],
&quot;outputTokensByModality&quot;: [ # A breakdown of output token usage by modality.
{ # The token count for a single response modality.
&quot;modality&quot;: &quot;A String&quot;, # The modality associated with the token count.
&quot;tokens&quot;: 42, # Number of tokens for the modality.
},
],
&quot;toolUseTokensByModality&quot;: [ # A breakdown of tool-use token usage by modality.
{ # The token count for a single response modality.
&quot;modality&quot;: &quot;A String&quot;, # The modality associated with the token count.
&quot;tokens&quot;: 42, # Number of tokens for the modality.
},
],
&quot;totalCachedTokens&quot;: 42, # Number of tokens in the cached part of the prompt (the cached content).
&quot;totalInputTokens&quot;: 42, # Number of tokens in the prompt (context).
&quot;totalOutputTokens&quot;: 42, # Total number of tokens across all the generated responses.
&quot;totalThoughtTokens&quot;: 42, # Number of tokens of thoughts for thinking models.
&quot;totalTokens&quot;: 42, # Total token count for the interaction request (prompt + responses + other internal tokens).
&quot;totalToolUseTokens&quot;: 42, # Number of tokens present in tool-use prompt(s).
},
}</pre>
</div>
<div class="method">
<code class="details" id="delete">delete(name, x__xgafv=None)</code>
<pre>Deletes a custom stored voice (`store = true`) by resource name. Prebuilt catalog voices (`&quot;prebuilt&quot;`) cannot be deleted.
Args:
name: string, Required. The resource name of the custom stored voice to delete (for example, `voices/voice_abc123def456`). (required)
x__xgafv: string, V1 error format.
Allowed values
1 - v1 error format
2 - v2 error format
Returns:
An object of the form:
{ # Response message for `VoicesService.DeleteVoice`.
}</pre>
</div>
<div class="method">
<code class="details" id="get">get(name, x__xgafv=None)</code>
<pre>Gets a custom stored voice (`store = true`) by resource name. Prebuilt catalog voices (`VOICE_TYPE_PREBUILT`) cannot be retrieved via `GetVoice`; use `ListVoices` instead.
Args:
name: string, Required. The resource name of the custom stored voice to retrieve (for example, `voices/voice_abc123def456`). (required)
x__xgafv: string, V1 error format.
Allowed values
1 - v1 error format
2 - v2 error format
Returns:
An object of the form:
{ # A voice resource representing either a custom voice (created via `CreateVoice`) or a prebuilt system voice (returned by `ListVoices`).
&quot;accent&quot;: &quot;A String&quot;, # Optional. Regional accent descriptor (e.g. &quot;American&quot;, &quot;British&quot;).
&quot;context&quot;: &quot;A String&quot;, # Optional. Optimal usage context or domain (e.g. &quot;Conversational&quot;, &quot;Audiobook&quot;, &quot;News&quot;).
&quot;description&quot;: &quot;A String&quot;, # Optional. Descriptive summary of vocal timbre, personality, and tone.
&quot;displayName&quot;: &quot;A String&quot;, # Optional. User-provided display name for a stored voice (`store = true`), or the catalog name for a prebuilt voice.
&quot;expireTime&quot;: &quot;A String&quot;, # Output only. The timestamp at which a custom stored voice (`store = true`) or replicated voice key (`store = false`) expires. For custom stored voices (`store = true`), this expiration time is extended when the voice is used for speech synthesis or as a `base_voice` in `CreateVoice`. Unset for prebuilt catalog voices (`&quot;prebuilt&quot;`), which do not expire.
&quot;gender&quot;: &quot;A String&quot;, # Optional. Perceived voice gender presentation (e.g. &quot;female&quot;, &quot;male&quot;, &quot;neutral&quot;).
&quot;id&quot;: &quot;A String&quot;, # Output only. The unique identifier of the voice. * For Google-managed custom voices (`store = true`), this is a generated ID with prefix `voice_` (for example, `voice_abc123def456`). Pass `voices/{id}` as the `name` in `GetVoice` and `DeleteVoice`, and pass `{id}` directly to `SpeechConfig.voice_config.voice` (or `SpeechConfig.voice`) during speech synthesis. * For prebuilt catalog voices (`&quot;prebuilt&quot;` returned by `ListVoices`), this is the speaker name (for example, `Puck` or `Charon`). * Unset when `CreateVoice` is called with `store = false`.
&quot;key&quot;: &quot;A String&quot;, # Output only. The client-managed voice replication key (with prefix `voicekey_`). Returned only by `CreateVoice` when `type` is `&quot;replicated&quot;` and `store` is `false`. Pass this key to `SpeechConfig.voice_config.voice` (or `SpeechConfig.voice`) during speech synthesis.
&quot;languageCode&quot;: &quot;A String&quot;, # Optional. Primary BCP-47 language tag (e.g. &quot;en-US&quot;, &quot;fr-FR&quot;).
&quot;model&quot;: &quot;A String&quot;, # Optional. The model used to design or replicate the voice. If omitted in `CreateVoice`, defaults to the latest supported voice design model. Returned in `CreateVoice`, `GetVoice`, and `ListVoices` responses for custom voices (`&quot;prompted&quot;` and `&quot;replicated&quot;`); unset for `&quot;prebuilt&quot;` voices. Created voices can be synthesized across any supported TTS synthesis model.
&quot;persona&quot;: &quot;A String&quot;, # Optional. Intended persona or character archetype (e.g. &quot;Warm, Friendly&quot;, &quot;Narrator&quot;).
&quot;pitch&quot;: &quot;A String&quot;, # Optional. Voice pitch classification.
&quot;prompted&quot;: { # Parameters for prompted voice generation. Required in `CreateVoice` when `type` is `&quot;prompted&quot;`. Returned in `CreateVoice`, `GetVoice`, and `ListVoices` responses for prompted voices. # Parameters for prompted voice generation. Required in `CreateVoice` when `type` is `&quot;prompted&quot;`. Returned in `CreateVoice`, `GetVoice`, and `ListVoices` responses for prompted voices.
&quot;input&quot;: &quot;A String&quot;, # Required. The natural-language prompt describing the desired voice, e.g. &quot;A deep, booming male voice of a massive evil ogre in his middle years.&quot;
},
&quot;regionCode&quot;: &quot;A String&quot;, # Optional. ISO 3166-1 alpha-2 or UN M.49 geographic region code (e.g. &quot;US&quot;, &quot;GB&quot;, &quot;001&quot;).
&quot;replicated&quot;: { # Input only. Parameters for replicated voice generation. Required on input when `type` is `&quot;replicated&quot;`. Not returned in responses. # Input only. Parameters for replicated voice generation. Required on input when `type` is `&quot;replicated&quot;`. Not returned in responses.
&quot;consentAudio&quot;: { # Audio payload used for voice creation. # Required. Audio recording of the same speaker reading the required consent phrase, confirming authorization to replicate the voice.
&quot;data&quot;: &quot;A String&quot;, # Required. The raw audio bytes.
&quot;mimeType&quot;: &quot;A String&quot;, # Required. The IANA MIME type of the audio data (for example, `audio/wav` or `audio/mpeg`).
},
&quot;sourceAudio&quot;: { # Audio payload used for voice creation. # Required. The reference audio sample of the speaker&#x27;s voice to replicate. Must be an unmodified recording of an adult human voice.
&quot;data&quot;: &quot;A String&quot;, # Required. The raw audio bytes.
&quot;mimeType&quot;: &quot;A String&quot;, # Required. The IANA MIME type of the audio data (for example, `audio/wav` or `audio/mpeg`).
},
},
&quot;sampleAudio&quot;: { # Audio payload used for voice creation. # Output only. Sample audio (synthesizer prompt audio) generated for a prompted voice. Populated only in `CreateVoice` and `GetVoice` responses when `type` is `&quot;prompted&quot;`; unset in `ListVoices` responses and for `&quot;replicated&quot;` or `&quot;prebuilt&quot;` voices.
&quot;data&quot;: &quot;A String&quot;, # Required. The raw audio bytes.
&quot;mimeType&quot;: &quot;A String&quot;, # Required. The IANA MIME type of the audio data (for example, `audio/wav` or `audio/mpeg`).
},
&quot;type&quot;: &quot;A String&quot;, # Required. The type of the voice. In `CreateVoice`, must be `&quot;replicated&quot;` or `&quot;prompted&quot;`. In `ListVoices` responses, may also be `&quot;prebuilt&quot;`.
&quot;usage&quot;: { # Statistics on the interaction request&#x27;s token usage. # Output only. Token usage statistics for the voice creation request. Populated only in the response of `CreateVoice` when `type` is `&quot;prompted&quot;`; unset for `&quot;replicated&quot;` and in `GetVoice` and `ListVoices` responses.
&quot;cachedTokensByModality&quot;: [ # A breakdown of cached token usage by modality.
{ # The token count for a single response modality.
&quot;modality&quot;: &quot;A String&quot;, # The modality associated with the token count.
&quot;tokens&quot;: 42, # Number of tokens for the modality.
},
],
&quot;groundingToolCount&quot;: [ # Grounding tool count.
{ # The number of grounding tool counts.
&quot;count&quot;: 42, # The number of grounding tool counts.
&quot;type&quot;: &quot;A String&quot;, # The grounding tool type associated with the count.
},
],
&quot;inputTokensByModality&quot;: [ # A breakdown of input token usage by modality.
{ # The token count for a single response modality.
&quot;modality&quot;: &quot;A String&quot;, # The modality associated with the token count.
&quot;tokens&quot;: 42, # Number of tokens for the modality.
},
],
&quot;outputTokensByModality&quot;: [ # A breakdown of output token usage by modality.
{ # The token count for a single response modality.
&quot;modality&quot;: &quot;A String&quot;, # The modality associated with the token count.
&quot;tokens&quot;: 42, # Number of tokens for the modality.
},
],
&quot;toolUseTokensByModality&quot;: [ # A breakdown of tool-use token usage by modality.
{ # The token count for a single response modality.
&quot;modality&quot;: &quot;A String&quot;, # The modality associated with the token count.
&quot;tokens&quot;: 42, # Number of tokens for the modality.
},
],
&quot;totalCachedTokens&quot;: 42, # Number of tokens in the cached part of the prompt (the cached content).
&quot;totalInputTokens&quot;: 42, # Number of tokens in the prompt (context).
&quot;totalOutputTokens&quot;: 42, # Total number of tokens across all the generated responses.
&quot;totalThoughtTokens&quot;: 42, # Number of tokens of thoughts for thinking models.
&quot;totalTokens&quot;: 42, # Total token count for the interaction request (prompt + responses + other internal tokens).
&quot;totalToolUseTokens&quot;: 42, # Number of tokens present in tool-use prompt(s).
},
}</pre>
</div>
<div class="method">
<code class="details" id="list">list(parent, accent=None, context=None, gender=None, languageCode=None, pageSize=None, pageToken=None, persona=None, pitch=None, regionCode=None, search=None, type=None, x__xgafv=None)</code>
<pre>Lists custom stored voices owned by the caller as well as prebuilt system voices from Google&#x27;s voice catalog.
Args:
parent: string, Required. The parent that owns this collection of voices. Format: `projects/{project}/locations/{location}` Supported only by the Vertex API. (required)
accent: string, Optional. Filter by accent description (e.g. &quot;American&quot;, &quot;British&quot;). Case-insensitive exact match. If multiple values are specified, matches voices with any of the specified accents (OR). (repeated)
context: string, Optional. Filter by intended context or domain (e.g. &quot;News, Commercial&quot;). Case-insensitive exact match. If multiple values are specified, matches voices with any of the specified contexts (OR). (repeated)
gender: string, Optional. Filter by gender presentation (e.g. &quot;female&quot;, &quot;male&quot;, &quot;neutral&quot;). Case-insensitive exact match. If multiple values are specified, matches voices with any of the specified genders (OR). (repeated)
languageCode: string, Optional. Filter by BCP-47 language code (e.g. &quot;en-US&quot;). Case-insensitive exact match. If multiple values are specified, matches voices with any of the specified language codes (OR). (repeated)
pageSize: integer, Optional. The maximum number of voices to return per page. The service may return fewer than this value. If unspecified, at most 50 voices are returned. The maximum value is 1000; values above 1000 are coerced to 1000.
pageToken: string, A page token, received from a previous `ListVoices` call. Provide this to retrieve the subsequent page. When paginating, all filter query parameters (`language_code`, `region_code`, `accent`, `persona`, `context`, `gender`, `pitch`, `type`, and `search`) must match the call that returned this token; otherwise the request fails with `INVALID_ARGUMENT`. `page_size` may change between pages.
persona: string, Optional. Filter by vocal persona (e.g. &quot;Warm, Friendly&quot;). Case-insensitive exact match. If multiple values are specified, matches voices with any of the specified personas (OR). (repeated)
pitch: string, Optional. Filter by vocal pitch. Accepts `&quot;low&quot;`, `&quot;medium&quot;`, `&quot;high&quot;` (case-insensitive). If multiple values are specified, matches voices with any of the specified pitches (OR). (repeated)
regionCode: string, Optional. Filter by ISO 3166-1 alpha-2 or UN M.49 region code (e.g. &quot;US&quot;, &quot;001&quot;). Case-insensitive exact match. If multiple values are specified, matches voices with any of the specified region codes (OR). (repeated)
search: string, Optional. Free-text substring search query matched case-insensitively against both `display_name` and `description`. Maximum 2048 bytes.
type: string, Optional. Filter by voice type. Accepts `&quot;prebuilt&quot;`, `&quot;replicated&quot;`, `&quot;prompted&quot;` (case-insensitive). If multiple values are specified, matches voices with any of the specified types (OR). (repeated)
x__xgafv: string, V1 error format.
Allowed values
1 - v1 error format
2 - v2 error format
Returns:
An object of the form:
{ # Response message for `VoicesService.ListVoices`.
&quot;nextPageToken&quot;: &quot;A String&quot;, # A token that can be sent as `page_token` to retrieve the next page. If empty, there are no subsequent pages.
&quot;voices&quot;: [ # The voices from the specified collection.
{ # A voice resource representing either a custom voice (created via `CreateVoice`) or a prebuilt system voice (returned by `ListVoices`).
&quot;accent&quot;: &quot;A String&quot;, # Optional. Regional accent descriptor (e.g. &quot;American&quot;, &quot;British&quot;).
&quot;context&quot;: &quot;A String&quot;, # Optional. Optimal usage context or domain (e.g. &quot;Conversational&quot;, &quot;Audiobook&quot;, &quot;News&quot;).
&quot;description&quot;: &quot;A String&quot;, # Optional. Descriptive summary of vocal timbre, personality, and tone.
&quot;displayName&quot;: &quot;A String&quot;, # Optional. User-provided display name for a stored voice (`store = true`), or the catalog name for a prebuilt voice.
&quot;expireTime&quot;: &quot;A String&quot;, # Output only. The timestamp at which a custom stored voice (`store = true`) or replicated voice key (`store = false`) expires. For custom stored voices (`store = true`), this expiration time is extended when the voice is used for speech synthesis or as a `base_voice` in `CreateVoice`. Unset for prebuilt catalog voices (`&quot;prebuilt&quot;`), which do not expire.
&quot;gender&quot;: &quot;A String&quot;, # Optional. Perceived voice gender presentation (e.g. &quot;female&quot;, &quot;male&quot;, &quot;neutral&quot;).
&quot;id&quot;: &quot;A String&quot;, # Output only. The unique identifier of the voice. * For Google-managed custom voices (`store = true`), this is a generated ID with prefix `voice_` (for example, `voice_abc123def456`). Pass `voices/{id}` as the `name` in `GetVoice` and `DeleteVoice`, and pass `{id}` directly to `SpeechConfig.voice_config.voice` (or `SpeechConfig.voice`) during speech synthesis. * For prebuilt catalog voices (`&quot;prebuilt&quot;` returned by `ListVoices`), this is the speaker name (for example, `Puck` or `Charon`). * Unset when `CreateVoice` is called with `store = false`.
&quot;key&quot;: &quot;A String&quot;, # Output only. The client-managed voice replication key (with prefix `voicekey_`). Returned only by `CreateVoice` when `type` is `&quot;replicated&quot;` and `store` is `false`. Pass this key to `SpeechConfig.voice_config.voice` (or `SpeechConfig.voice`) during speech synthesis.
&quot;languageCode&quot;: &quot;A String&quot;, # Optional. Primary BCP-47 language tag (e.g. &quot;en-US&quot;, &quot;fr-FR&quot;).
&quot;model&quot;: &quot;A String&quot;, # Optional. The model used to design or replicate the voice. If omitted in `CreateVoice`, defaults to the latest supported voice design model. Returned in `CreateVoice`, `GetVoice`, and `ListVoices` responses for custom voices (`&quot;prompted&quot;` and `&quot;replicated&quot;`); unset for `&quot;prebuilt&quot;` voices. Created voices can be synthesized across any supported TTS synthesis model.
&quot;persona&quot;: &quot;A String&quot;, # Optional. Intended persona or character archetype (e.g. &quot;Warm, Friendly&quot;, &quot;Narrator&quot;).
&quot;pitch&quot;: &quot;A String&quot;, # Optional. Voice pitch classification.
&quot;prompted&quot;: { # Parameters for prompted voice generation. Required in `CreateVoice` when `type` is `&quot;prompted&quot;`. Returned in `CreateVoice`, `GetVoice`, and `ListVoices` responses for prompted voices. # Parameters for prompted voice generation. Required in `CreateVoice` when `type` is `&quot;prompted&quot;`. Returned in `CreateVoice`, `GetVoice`, and `ListVoices` responses for prompted voices.
&quot;input&quot;: &quot;A String&quot;, # Required. The natural-language prompt describing the desired voice, e.g. &quot;A deep, booming male voice of a massive evil ogre in his middle years.&quot;
},
&quot;regionCode&quot;: &quot;A String&quot;, # Optional. ISO 3166-1 alpha-2 or UN M.49 geographic region code (e.g. &quot;US&quot;, &quot;GB&quot;, &quot;001&quot;).
&quot;replicated&quot;: { # Input only. Parameters for replicated voice generation. Required on input when `type` is `&quot;replicated&quot;`. Not returned in responses. # Input only. Parameters for replicated voice generation. Required on input when `type` is `&quot;replicated&quot;`. Not returned in responses.
&quot;consentAudio&quot;: { # Audio payload used for voice creation. # Required. Audio recording of the same speaker reading the required consent phrase, confirming authorization to replicate the voice.
&quot;data&quot;: &quot;A String&quot;, # Required. The raw audio bytes.
&quot;mimeType&quot;: &quot;A String&quot;, # Required. The IANA MIME type of the audio data (for example, `audio/wav` or `audio/mpeg`).
},
&quot;sourceAudio&quot;: { # Audio payload used for voice creation. # Required. The reference audio sample of the speaker&#x27;s voice to replicate. Must be an unmodified recording of an adult human voice.
&quot;data&quot;: &quot;A String&quot;, # Required. The raw audio bytes.
&quot;mimeType&quot;: &quot;A String&quot;, # Required. The IANA MIME type of the audio data (for example, `audio/wav` or `audio/mpeg`).
},
},
&quot;sampleAudio&quot;: { # Audio payload used for voice creation. # Output only. Sample audio (synthesizer prompt audio) generated for a prompted voice. Populated only in `CreateVoice` and `GetVoice` responses when `type` is `&quot;prompted&quot;`; unset in `ListVoices` responses and for `&quot;replicated&quot;` or `&quot;prebuilt&quot;` voices.
&quot;data&quot;: &quot;A String&quot;, # Required. The raw audio bytes.
&quot;mimeType&quot;: &quot;A String&quot;, # Required. The IANA MIME type of the audio data (for example, `audio/wav` or `audio/mpeg`).
},
&quot;type&quot;: &quot;A String&quot;, # Required. The type of the voice. In `CreateVoice`, must be `&quot;replicated&quot;` or `&quot;prompted&quot;`. In `ListVoices` responses, may also be `&quot;prebuilt&quot;`.
&quot;usage&quot;: { # Statistics on the interaction request&#x27;s token usage. # Output only. Token usage statistics for the voice creation request. Populated only in the response of `CreateVoice` when `type` is `&quot;prompted&quot;`; unset for `&quot;replicated&quot;` and in `GetVoice` and `ListVoices` responses.
&quot;cachedTokensByModality&quot;: [ # A breakdown of cached token usage by modality.
{ # The token count for a single response modality.
&quot;modality&quot;: &quot;A String&quot;, # The modality associated with the token count.
&quot;tokens&quot;: 42, # Number of tokens for the modality.
},
],
&quot;groundingToolCount&quot;: [ # Grounding tool count.
{ # The number of grounding tool counts.
&quot;count&quot;: 42, # The number of grounding tool counts.
&quot;type&quot;: &quot;A String&quot;, # The grounding tool type associated with the count.
},
],
&quot;inputTokensByModality&quot;: [ # A breakdown of input token usage by modality.
{ # The token count for a single response modality.
&quot;modality&quot;: &quot;A String&quot;, # The modality associated with the token count.
&quot;tokens&quot;: 42, # Number of tokens for the modality.
},
],
&quot;outputTokensByModality&quot;: [ # A breakdown of output token usage by modality.
{ # The token count for a single response modality.
&quot;modality&quot;: &quot;A String&quot;, # The modality associated with the token count.
&quot;tokens&quot;: 42, # Number of tokens for the modality.
},
],
&quot;toolUseTokensByModality&quot;: [ # A breakdown of tool-use token usage by modality.
{ # The token count for a single response modality.
&quot;modality&quot;: &quot;A String&quot;, # The modality associated with the token count.
&quot;tokens&quot;: 42, # Number of tokens for the modality.
},
],
&quot;totalCachedTokens&quot;: 42, # Number of tokens in the cached part of the prompt (the cached content).
&quot;totalInputTokens&quot;: 42, # Number of tokens in the prompt (context).
&quot;totalOutputTokens&quot;: 42, # Total number of tokens across all the generated responses.
&quot;totalThoughtTokens&quot;: 42, # Number of tokens of thoughts for thinking models.
&quot;totalTokens&quot;: 42, # Total token count for the interaction request (prompt + responses + other internal tokens).
&quot;totalToolUseTokens&quot;: 42, # Number of tokens present in tool-use prompt(s).
},
},
],
}</pre>
</div>
<div class="method">
<code class="details" id="list_next">list_next(previous_request, previous_response)</code>
<pre>Retrieves the next page of results.
Args:
previous_request: The request for the previous page. (required)
previous_response: The response from the request for the previous page. (required)
Returns:
A request object that you can call &#x27;execute()&#x27; on to request the next
page. Returns None if there are no more items in the collection.
</pre>
</div>
</body></html>