Skip to content

Commit 9a80b2c

Browse files
songguocolakevinlin09
authored andcommitted
feat(model/qwen3-asr): fix recognition param.language
1 parent 434e0ee commit 9a80b2c

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

dashscope/audio/qwen_omni/omni_realtime.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,7 @@ def __init__(
9595
headers=None,
9696
workspace=None,
9797
url=None,
98+
api_key: str = None,
9899
additional_params=None,
99100
):
100101
"""
@@ -124,7 +125,7 @@ def __init__(
124125
else:
125126
url = f'{url}?model={model}'
126127
self.url = url
127-
self.apikey = dashscope.api_key
128+
self.apikey = api_key or dashscope.api_key
128129
self.user_headers = headers
129130
self.user_workspace = workspace
130131
self.model = model
@@ -277,7 +278,8 @@ def update_session(self,
277278
}
278279
if transcription_params is not None:
279280
self.config['input_audio_transcription'] = {}
280-
self.config['input_audio_transcription'].update({'language': transcription_params.language})
281+
if transcription_params.language is not None:
282+
self.config['input_audio_transcription'].update({'language': transcription_params.language})
281283
if transcription_params.corpus_text is not None:
282284
transcription_params.corpus = {
283285
"text": transcription_params.corpus_text

0 commit comments

Comments
 (0)