[Realtime] Emit current (non-beta) OpenAI audio/transcript event names (#7339)
Signed-off-by: Nick Cao <ncao@redhat.com> Co-authored-by: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
1 parent
5c69fc2a8a
commit
498c41b8d6
34 files changed
+251
-189
No files matched your search
@@ -168,7 +168,7 @@ class RealtimeOutputProjector:
|
||||
text = ""
|
||||
payloads.append(
|
||||
{
|
||||
"type": "response.audio_transcript.delta",
|
||||
"type": "response.output_audio_transcript.delta",
|
||||
"response_id": response_id,
|
||||
"item_id": self._response_item_id(response_id),
|
||||
"output_index": 0,
|
||||
@@ -839,7 +839,7 @@ class RealtimeOutputProjector:
|
||||
)
|
||||
payloads.append(
|
||||
{
|
||||
"type": "response.audio.delta",
|
||||
"type": "response.output_audio.delta",
|
||||
"response_id": response_id,
|
||||
"item_id": item_id,
|
||||
"output_index": 0,
|
||||
@@ -872,7 +872,7 @@ class RealtimeOutputProjector:
|
||||
state.audio_done_emitted = True
|
||||
payloads.append(
|
||||
{
|
||||
"type": "response.audio.done",
|
||||
"type": "response.output_audio.done",
|
||||
"response_id": response_id,
|
||||
"item_id": item_id,
|
||||
"output_index": 0,
|
||||
@@ -882,7 +882,7 @@ class RealtimeOutputProjector:
|
||||
if transcript:
|
||||
payloads.append(
|
||||
{
|
||||
"type": "response.audio_transcript.done",
|
||||
"type": "response.output_audio_transcript.done",
|
||||
"response_id": response_id,
|
||||
"item_id": item_id,
|
||||
"output_index": 0,
|
||||
|
||||
@@ -108,7 +108,7 @@ async def _warmup_duplex_realtime(app, args, warmup_frames: int) -> None:
|
||||
sent += 1
|
||||
await asyncio.sleep(0.08)
|
||||
# Wait for the pipeline's first audio output so every stage ran.
|
||||
saw_audio = await _recv_until(lambda e: e.get("type") == "response.audio.delta", 30)
|
||||
saw_audio = await _recv_until(lambda e: e.get("type") == "response.output_audio.delta", 30)
|
||||
# Close the session EXPLICITLY: a bare websocket close parks the
|
||||
# session in its disconnect grace window, where it would keep
|
||||
# occupying the max_sessions=1 slot and block the first client.
|
||||
|
||||
@@ -55,9 +55,7 @@ MODEL_OUTPUT_EVENTS = frozenset(
|
||||
"response.output_item.added",
|
||||
"response.content_part.added",
|
||||
"response.output_audio.delta",
|
||||
"response.audio.delta",
|
||||
"response.output_audio.done",
|
||||
"response.audio.done",
|
||||
"response.output_text.delta",
|
||||
"response.output_text.done",
|
||||
"response.text.delta",
|
||||
|
||||
Reference in new issue
Block a user