File tree Expand file tree Collapse file tree 1 file changed +13
-2
lines changed
dashscope/audio/qwen_omni Expand file tree Collapse file tree 1 file changed +13
-2
lines changed Original file line number Diff line number Diff line change 55import threading
66import time
77from dataclasses import field , dataclass
8- from typing import List
8+ from typing import List , Any
99import uuid
1010from enum import Enum , unique
1111
@@ -35,7 +35,13 @@ class TranslationParams:
3535 """
3636 TranslationParams
3737 """
38+
39+ @dataclass
40+ class Corpus :
41+ phrases : dict [str , Any ] = field (default = None )
42+
3843 language : str = field (default = None )
44+ corpus : Corpus = field (default = None )
3945
4046
4147@dataclass
@@ -262,8 +268,13 @@ def update_session(self,
262268 self .config ['turn_detection' ] = None
263269 if translation_params is not None :
264270 self .config ['translation' ] = {
265- 'language' : translation_params .language
271+ 'language' : translation_params .language ,
266272 }
273+ if translation_params .corpus is not None :
274+ if translation_params .corpus and translation_params .corpus .phrases is not None :
275+ self .config ['translation' ]['corpus' ] = {
276+ 'phrases' : translation_params .corpus .phrases
277+ }
267278 if transcription_params is not None :
268279 self .config ['input_audio_transcription' ] = {}
269280 self .config ['input_audio_transcription' ].update ({'language' : transcription_params .language })
You can’t perform that action at this time.
0 commit comments