@@ -176,7 +176,7 @@ class BatchTranslationConfig(TranslationConfig):
176176class BatchLanguageIdentificationConfig :
177177 """Batch mode: Language identification config."""
178178
179- expected_languages : List [str ] = None
179+ expected_languages : Optional [ List [str ] ] = None
180180 """Expected languages for language identification"""
181181
182182
@@ -203,7 +203,7 @@ class SentimentAnalysisConfig:
203203class TopicDetectionConfig :
204204 """Defines topic detection parameters."""
205205
206- topics : List [str ] = None
206+ topics : Optional [ List [str ] ] = None
207207 """Optional list of topics for topic detection."""
208208
209209
@@ -212,6 +212,18 @@ class AutoChaptersConfig:
212212 """Auto Chapters config."""
213213
214214
215+ @dataclass
216+ class AudioEventsConfig :
217+
218+ types : Optional [List [str ]]
219+ """Optional list of audio event types to detect."""
220+
221+ def asdict (self ):
222+ if self .types is None :
223+ self .types = []
224+ return asdict (self )
225+
226+
215227@dataclass (init = False )
216228class TranscriptionConfig (_TranscriptionConfig ):
217229 # pylint: disable=too-many-instance-attributes
@@ -254,12 +266,16 @@ class TranscriptionConfig(_TranscriptionConfig):
254266 """Indicates if partial translation, where words are produced
255267 immediately, is enabled."""
256268
257- translation_config : TranslationConfig = None
269+ translation_config : Optional [ TranslationConfig ] = None
258270 """Optional configuration for translation."""
259271
272+ audio_events_config : Optional [AudioEventsConfig ] = None
273+ """Optional configuration for audio events"""
274+
260275 def as_config (self ):
261276 dictionary = self .asdict ()
262277 dictionary .pop ("translation_config" , None )
278+ dictionary .pop ("audio_events_config" , None )
263279 dictionary .pop ("enable_translation_partials" , None )
264280 enable_transcription_partials = dictionary .pop (
265281 "enable_transcription_partials" , False
@@ -504,6 +520,12 @@ class ServerMessageType(str, Enum):
504520 AddTranscript = "AddTranscript"
505521 """Indicates the final transcript of a part of the audio."""
506522
523+ AudioEventStarted = "AudioEventStarted"
524+ """Indicates the start of an audio event."""
525+
526+ AudioEventEnded = "AudioEventEnded"
527+ """Indicates the end of an audio event."""
528+
507529 AddPartialTranslation = "AddPartialTranslation"
508530 """Indicates a partial translation, which is an incomplete translation that
509531 is immediately produced and may change as more context becomes available.
0 commit comments