Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion google/genai/tests/types/test_types.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,13 @@ class SubFunctionResponsePart(types.FunctionResponsePart):
pass


def test_audio_transcription_config_mode():
config = types.AudioTranscriptionConfig(mode='smart')

assert config.mode == types.AudioTranscriptionConfigMode.SMART
assert config.model_dump(by_alias=True, exclude_none=True)['mode'] == 'SMART'


def test_factory_method_from_uri_part():

my_part = SubPart.from_uri(
Expand Down Expand Up @@ -2969,4 +2976,3 @@ def test_computer_use_types():
assert c.enable_prompt_injection_detection is True
assert len(c.disabled_safety_policies) == 2
assert types.SafetyPolicy.FINANCIAL_TRANSACTIONS in c.disabled_safety_policies

16 changes: 16 additions & 0 deletions google/genai/types.py
Original file line number Diff line number Diff line change
Expand Up @@ -6338,6 +6338,15 @@ class LanguageHintsDict(TypedDict, total=False):
LanguageHintsOrDict = Union[LanguageHints, LanguageHintsDict]


class AudioTranscriptionConfigMode(_common.CaseInSensitiveEnum):
"""Controls the level of detail returned by audio transcription."""

VERBATIM = 'VERBATIM'
"""Returns a verbatim transcription."""
SMART = 'SMART'
"""Returns a cleaned-up transcription."""


class AudioTranscriptionConfig(_common.BaseModel):
"""The audio transcription configuration in Setup."""

Expand Down Expand Up @@ -6371,6 +6380,10 @@ class AudioTranscriptionConfig(_common.BaseModel):
description="""Configures speaker diarization.
""",
)
mode: Optional[AudioTranscriptionConfigMode] = Field(
default=None,
description="""Controls the level of detail returned by audio transcription.""",
)


class AudioTranscriptionConfigDict(TypedDict, total=False):
Expand Down Expand Up @@ -6399,6 +6412,9 @@ class AudioTranscriptionConfigDict(TypedDict, total=False):
"""Configures speaker diarization.
"""

mode: Optional[AudioTranscriptionConfigMode]
"""Controls the level of detail returned by audio transcription."""


AudioTranscriptionConfigOrDict = Union[
AudioTranscriptionConfig, AudioTranscriptionConfigDict
Expand Down