Skip to content

Commit 94b371d

Browse files
google-genai-botcopybara-github
authored andcommitted
docs: clarify Voice expire_time and store TTL behavior in GAOS SDK
PiperOrigin-RevId: 990686007
1 parent f15d148 commit 94b371d

3 files changed

Lines changed: 28 additions & 16 deletions

File tree

‎google/genai/_gaos/types/voices/createvoicerequest.py‎

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -37,9 +37,11 @@ class CreateVoiceRequestParam(TypedDict):
3737
3838
* When `true`, Google stores the voice and returns `Voice.id` (for example,
3939
`voice_abc123def456`), which can be managed via `GetVoice`, `ListVoices`,
40-
and `DeleteVoice` and referenced by ID in synthesis requests. Projects
41-
are subject to a maximum active stored voice quota; exceeding the quota
42-
returns `RESOURCE_EXHAUSTED`.
40+
and `DeleteVoice` and referenced by ID in synthesis requests. Stored
41+
voices expire after 1 year of inactivity; using a stored voice in speech
42+
synthesis or as a `base_voice` in `CreateVoice` extends its
43+
`expire_time`. Projects are subject to a maximum active stored voice
44+
quota; exceeding the quota returns `RESOURCE_EXHAUSTED`.
4345
* When `false` (default), the voice is not stored by Google and `Voice.key`
4446
(for example, `voicekey_...`) is returned for client-side storage and
4547
synthesis. Optional discovery metadata fields on `voice` are not
@@ -62,9 +64,11 @@ class CreateVoiceRequest(BaseModel):
6264
6365
* When `true`, Google stores the voice and returns `Voice.id` (for example,
6466
`voice_abc123def456`), which can be managed via `GetVoice`, `ListVoices`,
65-
and `DeleteVoice` and referenced by ID in synthesis requests. Projects
66-
are subject to a maximum active stored voice quota; exceeding the quota
67-
returns `RESOURCE_EXHAUSTED`.
67+
and `DeleteVoice` and referenced by ID in synthesis requests. Stored
68+
voices expire after 1 year of inactivity; using a stored voice in speech
69+
synthesis or as a `base_voice` in `CreateVoice` extends its
70+
`expire_time`. Projects are subject to a maximum active stored voice
71+
quota; exceeding the quota returns `RESOURCE_EXHAUSTED`.
6872
* When `false` (default), the voice is not stored by Google and `Voice.key`
6973
(for example, `voicekey_...`) is returned for client-side storage and
7074
synthesis. Optional discovery metadata fields on `voice` are not

‎google/genai/_gaos/types/voices/voice_output.py‎

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,10 @@ class VoiceOutputTypedDict(TypedDict):
5050
"""
5151
expire_time: NotRequired[datetime]
5252
r"""Output only. The timestamp at which a custom stored voice (`store = true`)
53-
or replicated voice key (`store = false`) expires. Unset for prebuilt
54-
catalog voices (`\"prebuilt\"`), which do not expire.
53+
or replicated voice key (`store = false`) expires. For custom stored voices
54+
(`store = true`), this expiration time is extended when the voice is used
55+
for speech synthesis or as a `base_voice` in `CreateVoice`. Unset for
56+
prebuilt catalog voices (`\"prebuilt\"`), which do not expire.
5557
"""
5658
gender: NotRequired[str]
5759
r"""Optional. Perceived voice gender presentation (e.g. \"female\", \"male\",
@@ -130,8 +132,10 @@ class VoiceOutput(BaseModel):
130132

131133
expire_time: Optional[datetime] = None
132134
r"""Output only. The timestamp at which a custom stored voice (`store = true`)
133-
or replicated voice key (`store = false`) expires. Unset for prebuilt
134-
catalog voices (`\"prebuilt\"`), which do not expire.
135+
or replicated voice key (`store = false`) expires. For custom stored voices
136+
(`store = true`), this expiration time is extended when the voice is used
137+
for speech synthesis or as a `base_voice` in `CreateVoice`. Unset for
138+
prebuilt catalog voices (`\"prebuilt\"`), which do not expire.
135139
"""
136140

137141
gender: Optional[str] = None

‎google/genai/_gaos/voices.py‎

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -268,9 +268,11 @@ def create(
268268
269269
* When `true`, Google stores the voice and returns `Voice.id` (for example,
270270
`voice_abc123def456`), which can be managed via `GetVoice`, `ListVoices`,
271-
and `DeleteVoice` and referenced by ID in synthesis requests. Projects
272-
are subject to a maximum active stored voice quota; exceeding the quota
273-
returns `RESOURCE_EXHAUSTED`.
271+
and `DeleteVoice` and referenced by ID in synthesis requests. Stored
272+
voices expire after 1 year of inactivity; using a stored voice in speech
273+
synthesis or as a `base_voice` in `CreateVoice` extends its
274+
`expire_time`. Projects are subject to a maximum active stored voice
275+
quota; exceeding the quota returns `RESOURCE_EXHAUSTED`.
274276
* When `false` (default), the voice is not stored by Google and `Voice.key`
275277
(for example, `voicekey_...`) is returned for client-side storage and
276278
synthesis. Optional discovery metadata fields on `voice` are not
@@ -1005,9 +1007,11 @@ async def create(
10051007
10061008
* When `true`, Google stores the voice and returns `Voice.id` (for example,
10071009
`voice_abc123def456`), which can be managed via `GetVoice`, `ListVoices`,
1008-
and `DeleteVoice` and referenced by ID in synthesis requests. Projects
1009-
are subject to a maximum active stored voice quota; exceeding the quota
1010-
returns `RESOURCE_EXHAUSTED`.
1010+
and `DeleteVoice` and referenced by ID in synthesis requests. Stored
1011+
voices expire after 1 year of inactivity; using a stored voice in speech
1012+
synthesis or as a `base_voice` in `CreateVoice` extends its
1013+
`expire_time`. Projects are subject to a maximum active stored voice
1014+
quota; exceeding the quota returns `RESOURCE_EXHAUSTED`.
10111015
* When `false` (default), the voice is not stored by Google and `Voice.key`
10121016
(for example, `voicekey_...`) is returned for client-side storage and
10131017
synthesis. Optional discovery metadata fields on `voice` are not

0 commit comments

Comments
 (0)