詳細については、「Qwen によるリアルタイム音声・動画翻訳」をご参照ください。
エラー
サーバーから返されるエラーメッセージです。
event_id string このイベントの一意の識別子。 | {
"event_id": "event_RoUu4T8yExPMI37GKwaOC",
"type": "error",
"error": {
"type": "invalid_request_error",
"code": "invalid_value",
"message": "Invalid modalities: ['audio']. Supported combinations are: ['text'] and ['audio', 'text'].",
"param": "session.modalities"
}
}
|
type string イベントタイプ。この値は常に error です。 |
error object 詳細なエラー情報。 プロパティ param string エラーに関連するパラメーター。例: session.modalities。 |
session.created
クライアントが接続した後にサーバーから返される最初のイベントです。この会話のデフォルト構成が含まれています。
event_id string このイベントの一意の識別子。 | {
"event_id": "event_QxBGpjBDmDDQQWDtrqBKB",
"type": "session.created",
"session": {
"id": "sess_OozZ1vtbPt2muDflHODIH",
"object": "realtime.session",
"model": "qwen3-livetranslate-flash-realtime",
"modalities": [
"text",
"audio"
],
"voice": "Cherry",
"input_audio_format": "pcm16",
"output_audio_format": "pcm24",
"translation": {
"language": "en"
}
}
}
|
type string イベントタイプ。この値は常に session.created です。 |
session object 会話構成。 プロパティ object string この値は常に realtime.session です。 modalities array モデルの出力モダリティ。 voice string モデルによって生成される音声のボイス。 input_audio_format string 入力音声フォーマット。この値は常に pcm16 です。 output_audio_format string 出力音声フォーマット。この値は常に pcm24 です。 translation object (optional) 翻訳構成。 プロパティ translation string (Optional) 翻訳のターゲット言語。 |
session.updated
クライアントからの session.update リクエストを正常に処理した後、サーバーはこのイベントを返します。エラーが発生した場合、サーバーは代わりに error イベントを返します。
event_id string このイベントの一意の識別子。 | {
"event_id": "event_QxBGpjBDmDDQQWDtrqBKB",
"type": "session.updated",
"session": {
"id": "sess_OozZ1vtbPt2muDflHODIH",
"object": "realtime.session",
"model": "qwen3-livetranslate-flash-realtime",
"modalities": [
"text",
"audio"
],
"voice": "Ethan",
"input_audio_format": "pcm16",
"output_audio_format": "pcm24",
"translation": {
"language": "en"
}
}
}
|
type string イベントタイプ。この値は常に session.updated です。 |
session object 会話構成。 プロパティ object string この値は常に realtime.session です。 modalities array モデルの出力モダリティ。 voice string 音声生成に使用されるボイス。 input_audio_format string 入力音声フォーマット。この値は常に pcm16 です。 output_audio_format string 出力音声フォーマット。この値は常に pcm24 です。 translation object (optional) 翻訳構成。 プロパティ translation string (Optional) 翻訳のターゲット言語。 |
session.finished
このイベントは、現在の会話内のすべての音声翻訳タスクが完了したことを示します。
サーバーは、クライアントが session.finish リクエストを送信した後にのみ、このイベントを送信します。このイベントを受信した後、クライアントは切断できます。
event_id string このイベントの一意の識別子。 | {
"event_id": "event_xxx",
"type": "session.finished"
}
|
type string イベントタイプ。この値は常に session.finished です。 |
response.created
サーバーは、新しいモデル応答を生成するときにこのイベントを返します。
event_id string このイベントの一意の識別子。 | {
"event_id": "event_L8hHVI5jYis6BzAjnPWJh",
"type": "response.created",
"response": {
"id": "resp_P79OOMs8LnrXVpiIHUCKR",
"object": "realtime.response",
"conversation_id": "conv_UFClXtYkRkFXrs48y8pmK",
"status": "in_progress",
"modalities": [
"text",
"audio"
],
"voice": "Cherry",
"output_audio_format": "pcm24",
"output": []
}
}
|
type string イベントタイプ。この値は常に response.created です。 |
response object 応答オブジェクト。 プロパティ conversation_id string 現在の会話の一意の識別子。 object string オブジェクトタイプ。このイベントの場合、この値は常に realtime.response です。 status string 応答ステータス。有効な値: completed (完了)
失敗した
in_progress (進行中)
incomplete (不完全)
voice string モデルは音声の音色を生成します。 output_audio_format string 出力音声フォーマット。この値は常に pcm24 です。 output string このイベントの場合、このフィールドは空です。 |
response.done
サーバーは、完全な応答を生成した後、このイベントを返します。response オブジェクトには、生の音声データを除くすべての出力が含まれます。
event_id string このイベントの一意の識別子。 | {
"event_id": "event_CNea8oXNipVanSg2VIzkO",
"type": "response.done",
"response": {
"id": "resp_TfhYTqej692vsGA2jNEtH",
"object": "realtime.response",
"conversation_id": "conv_ZtyLfKVm8XqLwYRlsuDih",
"status": "completed",
"modalities": [
"text",
"audio"
],
"voice": "Cherry",
"output_audio_format": "pcm24",
"output": [
{
"id": "item_MKtkMwN9RtcyE9eJShyWy",
"object": "realtime.item",
"type": "message",
"status": "completed",
"role": "assistant",
"content": [
{
"type": "audio",
"transcript": "Hello? "
}
]
}
],
"usage": {
"total_tokens": 56,
"input_tokens": 47,
"output_tokens": 9,
"input_tokens_details": {
"text_tokens": 20,
"audio_tokens": 27
},
"output_tokens_details": {
"text_tokens": 2,
"audio_tokens": 7
}
}
}
}
|
type string イベントタイプ。この値は常に response.done です。 |
response object 応答オブジェクト。 プロパティ conversation_id string 現在の会話の一意の識別子。 object string オブジェクトタイプ。このイベントの場合、この値は常に realtime.response です。 voice string 音声生成に使用されるボイス。 output_audio_format string 出力音声フォーマット。この値は常に pcm24 です。 output object 応答出力。 プロパティ type string 出力アイテムタイプ。この値は常に message です。 object string 出力アイテムオブジェクトタイプ。この値は常に realtime.item です。 status string 出力アイテムステータス。 content array 出力アイテム本文。 プロパティ type string コンテンツタイプ。text はプレーンテキスト出力に使用します。audio は音声出力に使用します。 transcript string 音声の文字起こし。 usage object この応答のトークン使用量情報。 |
response.text.text
出力モダリティにテキストのみが含まれ、モデルが新しいテキストを増分的に生成するときに、サーバーはこのイベントを返します。
event_id string このイベントの一意の識別子。 | {
"event_id": "event_B1lIeyOXR7qJMEExbqtTG",
"type": "response.text.text",
"response_id": "resp_B1lIdtjF4Noqpn5NOjznj",
"item_id": "item_B1lIdJsAJlJiFs8ztWpJt",
"output_index": 0,
"content_index": 0,
"text": "How are",
"stash": " you today?"
}
|
type string イベントタイプ。この値は常に response.text.text です。 |
text string 返された増分テキスト。 |
response_id string 応答 ID。 |
item_id string メッセージアイテム ID。これを使用して、同じメッセージ内のアイテムを関連付けることができます。 |
output_index integer この値は常に 0 です。 |
content_index integer この値は常に 0 です。 |
stash string モデルによって生成された一時的なテキストです。これを現在の text と連結して、一時的な結果を形成します。システムは、response.text.done イベントを受信するまで、response.text.text イベントを使用して text と stash を継続的に更新します。その時点で、text フィールドから最終的な完全なテキストを取得します。 |
response.text.done
出力モダリティにテキストのみが含まれ、モデルがテキストの生成を完了するときに、サーバーはこのイベントを返します。
応答が中断された、不完全な、またはキャンセルされた場合にも、サーバーはこのイベントを返します。
event_id string このイベントの一意の識別子。 | {
"event_id": "event_B1lIeE2Nac33zn5V7h2mm",
"type": "response.text.done",
"response_id": "resp_B1lIdtjF4Noqpn5NOjznj",
"item_id": "item_B1lIdJsAJlJiFs8ztWpJt",
"output_index": 0,
"content_index": 0,
"text": "How can I assist you today?"
}
|
type string イベントタイプ。この値は常に response.text.done です。 |
response_id string 応答の一意の識別子。 |
item_id string メッセージアイテムの一意の識別子。 |
output_indexinteger この値は常に 0 です。 |
content_indexinteger この値は常に 0 です。 |
text string モデルによって出力された完全なテキスト。 |
response.audio.delta
出力モダリティに音声が含まれ、モデルが新しい音声データを増分的に生成するときに、サーバーはこのイベントを返します。
event_id string このイベントの一意の識別子。 | {
"event_id": "event_B1osWMZBtrEQbiIwW0qHQ",
"type": "response.audio.delta",
"response_id": "resp_P79OOMs8LnrXVpiIHUCKR",
"item_id": "item_OFaPGtzfWCPyGzxnuEX9i",
"output_index": 0,
"content_index": 0,
"delta": "UklGRnoGAABXQVZFZm10IBAAAAAB..."
}
|
type string イベントタイプ。この値は常に response.audio.delta です。 |
response_id string 応答の一意の識別子。 |
item_id string メッセージアイテムの一意の識別子。 |
output_indexinteger この値は常に 0 です。 |
content_indexinteger この値は常に 0 です。 |
delta string モデルによって生成された、Base64 エンコードされた増分音声データ。 |
response.audio.done
出力モダリティに音声が含まれ、モデルが音声の生成を完了するときに、サーバーはこのイベントを返します。
応答が中断された、不完全な、またはキャンセルされた場合にも、サーバーはこのイベントを返します。
このイベントは完全な音声データを返しません。
event_id string このイベントの一意の識別子。 | {
"event_id": "event_B1osWMWoDRYyITDyNYcBu",
"type": "response.audio.done",
"response_id": "resp_P79OOMs8LnrXVpiIHUCKR",
"item_id": "item_OFaPGtzfWCPyGzxnuEX9i",
"output_index": 0,
"content_index": 0
}
|
type string イベントタイプ。この値は常に response.audio.done です。 |
response_id string 応答の一意の識別子。 |
item_id string メッセージアイテムの一意の識別子。 |
output_indexinteger この値は常に 0 です。 |
content_indexinteger この値は常に 0 です。 |
conversation.item.input_audio_transcription.text
input_audio_transcription.model パラメーターを設定すると、サーバーは入力音声 (元のソース言語テキスト) の音声認識結果をストリーミングします。
event_id string このイベントの一意の識別子。 | {
"event_id": "event_xxx",
"type": "conversation.item.input_audio_transcription.text",
"item_id": "item_xxx",
"content_index": 0,
"text": "",
"stash": "The weather is so nice today",
"language": "en"
}
|
type string イベントタイプ。この値は常に conversation.item.input_audio_transcription.text です。 |
item_id string メッセージアイテムの一意の識別子。 |
content_index integer この値は常に 0 です。 |
text string 確定された文字起こしテキスト。 |
stash string 未確定の文字起こしテキスト。これは後続のイベントによって修正される可能性があります。 |
language string 検出されたソース言語。 |
conversation.item.input_audio_transcription.completed
input_audio_transcription.model パラメーターを設定すると、音声認識が完了した後にサーバーはこのイベントを返します。最終的な完全な文字起こし結果が含まれます。
event_id string このイベントの一意の識別子。 | {
"event_id": "event_xxx",
"type": "conversation.item.input_audio_transcription.completed",
"item_id": "item_xxx",
"content_index": 0,
"transcript": "The weather is nice today. Let's go for a walk in the park.",
"language": "zh"
}
|
type string イベントのタイプ。この値は常に conversation.item.input_audio_transcription.completed です。 |
item_id string メッセージアイテムの一意の識別子。 |
content_index integer この値は常に 0 です。 |
transcript string ソース言語での完全な音声認識結果。 |
language string 検出されたソース言語。 |
response.audio_transcript.text
出力モダリティに音声が含まれる場合、サーバーはリアルタイム翻訳コンテンツを表示するためにこのイベントを返すことがあります。
event_id string このイベントの一意の識別子。 | {
"event_id": "event_xxx",
"type": "response.audio_transcript.text",
"response_id": "resp_xxx",
"item_id": "item_xxx",
"output_index": 0,
"content_index": 0,
"text": "Hello,",
"stash": " who are you?"
}
|
type string イベントタイプ。この値は常に response.audio_transcript.text です。 |
response_id string 応答の一意の識別子。 |
item_id string メッセージアイテムの一意の識別子。 |
output_indexinteger この値は常に 0 です。 |
content_indexinteger この値は常に 0 です。 |
text string 確定された翻訳テキストセグメント。 |
stash string モデルによって生成された一時的な翻訳です。これを現在の text と連結して、一時的な結果を形成します。システムは、response.audio_transcript.done イベントを受信するまで、response.audio_transcript.text イベントを使用して text と stash を継続的に更新します。その時点で、transcript フィールドから最終的な完全な翻訳テキストを取得します。 | |
response.audio_transcript.done
出力モダリティに音声が含まれ、モデルがテキストの生成を完了するときに、サーバーはこのイベントを返します。
event_id string このイベントの一意の識別子。 | {
"event_id": "event_VN4Q4GJugLcc1S23viW8E",
"type": "response.audio_transcript.done",
"response_id": "resp_P79OOMs8LnrXVpiIHUCKR",
"item_id": "item_JvJauNH2CTXb1D9WV6pD4",
"output_index": 0,
"content_index": 0,
"transcript": "How can I assist you today?"
}
|
type string イベントタイプ。この値は常に response.audio_transcript.done です。 |
response_id string 応答の一意の識別子。 |
item_id string メッセージアイテムの一意の識別子。 |
output_indexinteger この値は常に 0 です。 |
content_indexinteger この値は常に 0 です。 |
transcript string 完全なテキスト。 |
response.output_item.added
サーバーは、応答生成中に新しい出力アイテムを作成するときにこのイベントを返します。
event_id string このイベントの一意の識別子。 | {
"event_id": "event_B4O5yPt3Gjnjy5eYH3plG",
"type": "response.output_item.added",
"response_id": "resp_P79OOMs8LnrXVpiIHUCKR",
"output_index": 0,
"item": {
"id": "item_OFaPGtzfWCPyGzxnuEX9i",
"object": "realtime.item",
"type": "message",
"status": "in_progress",
"role": "assistant",
"content": []
}
}
|
type string イベントタイプ。この値は常に response.output_item.added です。 |
response_id string 応答の一意の識別子。 |
output_indexinteger この値は常に 0 です。 |
itemobject 出力アイテム情報。 プロパティ type string この値は常に message です。 object string この値は常に realtime.item です。 status string 出力アイテムステータス。 |
response.output_item.done
新しい出力アイテムが完了したときに、サーバーはこのイベントを返します。
event_id string このイベントの一意の識別子。 | {
"event_id": "event_XkiwbYTBC9Wcdwy6uYJ2G",
"type": "response.output_item.done",
"response_id": "resp_P79OOMs8LnrXVpiIHUCKR",
"output_index": 0,
"item": {
"id": "item_JvJauNH2CTXb1D9WV6pD4",
"object": "realtime.item",
"type": "message",
"status": "completed",
"role": "assistant",
"content": [
{
"type": "audio",
"text": "Hello. I am Qwen, a large-scale language model developed by Alibaba Cloud. How can I help you?"
}
]
}
}
|
type string イベントタイプ。この値は常に response.output_item.done です。 |
response_id string 応答の一意の識別子。 |
output_indexinteger この値は常に 0 です。 |
itemobject 出力アイテム情報。 プロパティ object string この値は常に realtime.item です。 type string この値は常に message です。 status string 出力アイテムステータス。 |
response.content_part.added
サーバーは、新しいコンテンツパートを出力するときにこのイベントを返します。
event_id string このイベントの一意の識別子。 | {
"event_id": "event_J2UixwYKZsXg7c9YXZetL",
"type": "response.content_part.added",
"response_id": "resp_P79OOMs8LnrXVpiIHUCKR",
"item_id": "item_OFaPGtzfWCPyGzxnuEX9i",
"output_index": 0,
"content_index": 0,
"part": {
"type": "audio",
"text": ""
}
}
|
type string イベントタイプ。この値は常に response.content_part.added です。 |
response_id string 応答の一意の識別子。 |
item_id string メッセージアイテムの一意の識別子。 |
output_indexinteger この値は常に 0 です。 |
content_indexinteger この値は常に 0 です。 |
partobject 出力アイテム情報。 |
response.content_part.done
新しいコンテンツパートが完了したときに、サーバーはこのイベントを返します。
event_id string このイベントの一意の識別子。 | {
"event_id": "event_VN4Q4GJugLcc1S23viW8E",
"type": "response.content_part.done",
"response_id": "resp_P79OOMs8LnrXVpiIHUCKR",
"item_id": "item_JvJauNH2CTXb1D9WV6pD4",
"output_index": 0,
"content_index": 0,
"part": {
"type": "audio",
"text": "Hello. I am Qwen, a large-scale language model developed by Alibaba Cloud. How can I help you?"
}
}
|
type string イベントタイプ。この値は常に response.content_part.done です。 |
response_id string 応答の一意の識別子。 |
item_id string メッセージアイテムの一意の識別子。 |
output_indexinteger この値は常に 0 です。 |
content_indexinteger この値は常に 0 です。 |
partobject 出力アイテム情報。 |