bulky-wall-61623
09/09/2025, 8:16 AMtall-airline-16756
09/09/2025, 8:16 AMtall-airline-16756
09/09/2025, 8:17 AMresponse.text.delta for text, response.audio.delta for audio, and response.audio_transcript.delta for transcripts.
• Using separate asynchronous channels (text_ch for text and audio_ch for audio) to process and forward each modality.
• Parsing and handling the stream of delta events to deliver content incrementally.
Here’s a simple example of how you can access these split streams in your agent logic:
# Access split audio output
async def custom_audio_node(agent, audio: AsyncIterable[rtc.AudioFrame]):
async for frame in audio:
yield frame
# Access split text output
async def custom_transcription_node(agent, text: AsyncIterable[str | TimedString]):
async for chunk in text:
yield chunk
This setup lets you handle text and audio separately, which is great for things like showing text in a UI while playing audio or analyzing transcripts on their own. If you have any questions or want me to walk you through this in more detail, just let me know—I’m here to help!
Sources: plugins/openai/src/realtime/api_proto.ts | livekit-agents/livekit/agents/voice/agent.py