Skip to content

Commit 5b5b0a7

Browse files
Annhiluccopybara-github
authored andcommitted
feat: Introduce TYPE_L16 audio content and optional fields.
PiperOrigin-RevId: 893095424
1 parent b2629a4 commit 5b5b0a7

File tree

3 files changed

+39
-3
lines changed

3 files changed

+39
-3
lines changed

google/genai/_interactions/types/audio_content.py

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,15 +28,29 @@ class AudioContent(BaseModel):
2828

2929
type: Literal["audio"]
3030

31+
channels: Optional[int] = None
32+
"""The number of audio channels."""
33+
3134
data: Optional[str] = None
3235
"""The audio content."""
3336

3437
mime_type: Optional[
3538
Literal[
36-
"audio/wav", "audio/mp3", "audio/aiff", "audio/aac", "audio/ogg", "audio/flac", "audio/mpeg", "audio/m4a"
39+
"audio/wav",
40+
"audio/mp3",
41+
"audio/aiff",
42+
"audio/aac",
43+
"audio/ogg",
44+
"audio/flac",
45+
"audio/mpeg",
46+
"audio/m4a",
47+
"audio/l16",
3748
]
3849
] = None
3950
"""The mime type of the audio."""
4051

52+
rate: Optional[int] = None
53+
"""The sample rate of the audio."""
54+
4155
uri: Optional[str] = None
4256
"""The URI of the audio."""

google/genai/_interactions/types/audio_content_param.py

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,14 +32,28 @@ class AudioContentParam(TypedDict, total=False):
3232

3333
type: Required[Literal["audio"]]
3434

35+
channels: int
36+
"""The number of audio channels."""
37+
3538
data: Annotated[Union[str, Base64FileInput], PropertyInfo(format="base64")]
3639
"""The audio content."""
3740

3841
mime_type: Literal[
39-
"audio/wav", "audio/mp3", "audio/aiff", "audio/aac", "audio/ogg", "audio/flac", "audio/mpeg", "audio/m4a"
42+
"audio/wav",
43+
"audio/mp3",
44+
"audio/aiff",
45+
"audio/aac",
46+
"audio/ogg",
47+
"audio/flac",
48+
"audio/mpeg",
49+
"audio/m4a",
50+
"audio/l16",
4051
]
4152
"""The mime type of the audio."""
4253

54+
rate: int
55+
"""The sample rate of the audio."""
56+
4357
uri: str
4458
"""The URI of the audio."""
4559

google/genai/_interactions/types/content_delta.py

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,15 @@ class DeltaAudio(BaseModel):
9393

9494
mime_type: Optional[
9595
Literal[
96-
"audio/wav", "audio/mp3", "audio/aiff", "audio/aac", "audio/ogg", "audio/flac", "audio/mpeg", "audio/m4a"
96+
"audio/wav",
97+
"audio/mp3",
98+
"audio/aiff",
99+
"audio/aac",
100+
"audio/ogg",
101+
"audio/flac",
102+
"audio/mpeg",
103+
"audio/m4a",
104+
"audio/l16",
97105
]
98106
] = None
99107

0 commit comments

Comments
 (0)