This topic describes the client events and parameters of Qwen-Audio-ASR-Message.
run-task
Starts a speech recognition task and sets parameters such as the model, audio format, and sample rate.
When to send: Send immediately after the connection is established.
Response event: You can send audio only after the server returns the task-started event.
headerobject(Required)
Properties action string(Required)The command type. Set to run-task.task_idstring(Required)A client-generated task ID (UUID format) that links subsequent events to this task.streamingstring(Required)Set to duplex.object(Required)
Properties task_group string(Required)The task group. Set to audio.taskstring(Required)The task type. Set to asr.functionstring(Required)The function type. Set to recognition.modelstring(Required)The model name. Set to qwen-audio-3.1-asr-flash-message. See Qwen-Audio-3.1-ASR-Flash-Message.inputobject(Required)The input object. Pass {} when no context is provided.
Properties context array(object)(Optional)The conversation context, which improves recognition accuracy for domain-specific vocabulary. For usage details, see Context enhancement.
Properties role string(Required)The message role. Valid values:
array(object)(Required)The list of message contents.
Properties type string(Required)The content type. Valid values:
string(Required)The text content. When type is input_text, enter the recognition results from previous turns of user speech or a domain-specific word list. When type is text, enter the responses from the large language model in previous turns.object(Required)The speech recognition parameters.
Properties disfluency_removal_enabled boolean (Optional)Whether to filter filler words and polish the output. Defaults to false. Set to true to enable this feature.intermediate_result_enabled boolean (Optional)Whether to return intermediate streaming results. Defaults to false. Set to true to return intermediate streaming results.keep_dialect boolean (Optional)Specifies whether to preserve dialect expressions. Default: false. Set to false to transcribe dialect speech as standard Mandarin text, or true to preserve dialect expressions.This parameter applies only to final results (sentence_end=true) and is not supported for intermediate results (sentence_end=false).vad_model string (Optional)The VAD model. Default: far_field_meeting_16k.
string(Required)The audio format.Valid values:
integer(Required)The sample rate, in Hz.Only 16000 Hz is supported.vocabulary_idstring(Optional)The ID of a precompiled hot word list.Generate this ID in advance by calling the create hot word list API. Pass the ID during recognition to use the hot words in the list.Suitable for scenarios where the vocabulary is known and relatively stable, and where you need to reuse the same word list across requests.For usage details, see Precompiled hotwords.vocabularyobject(Optional)Instant hot words.Passed as key-value pairs, where the key is the hot word text (string) and the value is the hot word weight (integer). No hot word list needs to be created in advance. The weight ranges from [1, 5] or is set to 50: a value in [1, 5] makes the model more likely to output the word as the value increases; a value of 50 designates a super hot word, which greatly improves recall, but the number of super hot words cannot exceed 50.Suitable for temporary, session-level hot word optimization.When instant and precompiled hotwords are configured together, the system merges both sets. If the merged set contains more than 2000 hotwords, the system randomly selects 2000 to use. For usage details, see Instant hotwords.language_hintsarray[string](Optional)The language of the audio to recognize. There is no default value; if not set, the model detects the language automatically.You can set up to 4 values. If you set more, only the first 4 take effect.
Click to view the supported language codes
sentence_end=true) and is not supported for intermediate results (sentence_end=false).max_sentence_silenceinteger(Optional)The VAD silence threshold for segmentation, in ms. When the silence after a segment of speech exceeds this threshold, the system determines that the sentence has ended.Default value: 800.Valid values: [200, 6000].heartbeatboolean(Optional)Whether to enable heartbeat packets.Default value: false.
float(Optional)The threshold for distinguishing speech from noise, used to adjust the sensitivity of Voice Activity Detection (VAD).Valid values: [-1.0, 1.0].Value descriptions:
|
continue-task
Updates the conversation context during task execution to improve recognition.
When to send: Send during task execution when you need to update the conversation context.
headerobject(Required)
Properties action string(Required)The command type. Set to continue-task.task_idstring(Required)A client-generated task ID (UUID format) that must match the task_id in the run-task event.streamingstring(Required)Set to duplex.object(Required)
Properties input object(Required)The input object.
Properties context _array(object)___ (Optional) The conversation context, which improves recognition accuracy for domain-specific vocabulary. For usage details, see Improve recognition accuracy.Properties role _string_ __(Required) The message role. Valid values:user: The recognition results from previous turns of user speech, or a domain-specific word list.assistant: The responses from the large language model in previous turns.content _array(object)___(Required) The list of message contents. Properties type _string_ __(Required) The content type. Valid values:input_text: The recognition results from previous turns of user speech, or a domain-specific word list (used when role is user). You must also provide the text field.text: The responses from the large language model in previous turns (used when role is assistant). You must also provide the text field.text _string_ __(Required) The text content. When type is input_text, enter the recognition results from previous turns of user speech or a domain-specific word list. When type is text, enter the responses from the large language model in previous turns. |
finish-task
Notifies the server that all audio has been sent and requests to end the task.
When to send: Send after all audio data has been sent.
Response event: The server returns the task-finished event.
headerobject(Required)
Properties action string(Required)The command type. Set to finish-task.task_idstring(Required)A client-generated task ID (UUID format) that must match the task_id in the run-task event.streamingstring(Required)Set to duplex.object(Required)
Properties input object(Required)Set to {}. |