This topic describes the server events and fields of Qwen-Audio-ASR-Message.
task-started
The task has started successfully. The client can begin sending audio data.
headerobject
Properties task_id stringThe task ID generated by the client (in UUID format).eventstringThe event type. This value is always task-started.attributesobjectAdditional attributes. This value is usually empty.objectThis value is always {}. |
result-generated
Recognition results. By default, final sentence text is returned (sentence_end=true). Set intermediate_result_enabled=true to also receive intermediate text (sentence_end=false). Intermediate text may be revised: update the displayed text by sentence_id instead of concatenating it. A sentence-start event may contain sentence_begin=true and empty text.
headerobject
Properties task_id stringThe task ID generated by the client (in UUID format).eventstringThe event type. This value is always result-generated.object
Properties output object
Properties sentence object
Properties begin_time integerThe start time of the sentence, in milliseconds.end_timeintegerThe end time of the sentence, in milliseconds.textstringThe recognized text.heartbeatbooleanIf this value is true, the result is a heartbeat packet and can be ignored.sentence_beginbooleanIndicates the start of a sentence.sentence_endbooleanWhether the sentence has ended (true = final result, false = intermediate result).sentence_idintegerThe sequence identifier of the sentence. In normal recognition results, sentence_id increments from 1. When heartbeat is true (that is, a heartbeat packet), sentence_id is always 0.wordsarray[object]Word-level timestamp information.
Properties begin_time integerThe start time of the word, in milliseconds.end_timeintegerThe end time of the word, in milliseconds.textstringThe recognized text.punctuationstringThe punctuation mark.objectCumulative usage for the current task as of this event.
Properties duration integerCumulative audio duration in seconds, retained for compatibility.input_tokensintegerCumulative number of input tokens.output_tokensintegerCumulative number of output tokens.total_tokensintegerCumulative total number of tokens: the sum of input_tokens and output_tokens. | Sentence-start result: |
task-finished
The task has ended normally. You can close the connection or reuse it.
headerobject
Properties task_id stringThe task ID generated by the client (in UUID format).eventstringThe event type. This value is always task-finished.attributesobjectAdditional attributes. This value is usually empty.objectContains output (an empty object) and usage (the final cumulative usage for this task). The usage fields have the same definitions as in result-generated. |
task-failed
The task has failed. The connection is closed and cannot be reused.
headerobject
Properties task_id stringThe task ID generated by the client (in UUID format).eventstringThe event type. This value is always task-failed.error_codestringA description of the error type.error_messagestringThe specific cause of the error.attributesobjectAdditional attributes. This value is usually empty.objectThis value is always {}. |