Does openAI realtime model support the .say functi...
# ask-ai
m
Does openAI realtime model support the .say function in AgentSession with livekit-agents 1.0?
t
Thanks for reaching out, Extra. I'm an AI assistant and I'm here to help. Give me a moment while I research this topic.
The OpenAI Realtime model in LiveKit Agents 1.0 does not directly support the
.say
function in
AgentSession
without a TTS plugin. If you are using a realtime model, you have two options: • Add a TTS plugin to your session to enable the
.say
method. • Use the
generate_reply()
method instead, which works with realtime models without requiring a TTS plugin. If you need further assistance, feel free to ask! Sources: Agent speech and audio | LiveKit Docs | Agent speech | LiveKit Docs
m
I keep getting this OpenAI S2S connection closed unexpectedly
t
The error message "OpenAI S2S connection closed unexpectedly" indicates that the WebSocket connection to OpenAI's Realtime API has been terminated unexpectedly. This could be due to network issues, API timeouts, or other connection problems. To troubleshoot, you may want to check: • Your network stability and ensure there are no interruptions. • Any timeout settings in your implementation that might be causing the connection to close. • Logs for additional details about the error to identify the root cause. If the issue persists, feel free to provide more details, and I’ll assist further! Sources: livekit.plugins.openai.realtime API documentation | Tree View: | dse-workbench | Tree View: | dse-workbench
c
@many-machine-74335 did you find a workaround for this?
t
It seems like you're reaching out to someone for a workaround. If you'd like, I can assist further in troubleshooting or exploring potential solutions for the "OpenAI S2S connection closed unexpectedly" issue. Let me know how I can help!
m
@clean-lamp-24122 In my case it turned out to be an issue with how turn_detection was setup in the realtime model, I removed it and uses the turn detection from session instead and it worked.
🙌 1
t
Thank you for sharing this insight! It seems the issue might be related to how
turn_detection
was set up in the realtime model. If you removed it and used the turn detection from the session instead, and it resolved the issue, this could be a helpful workaround for others experiencing the same problem. Let me know if you need further assistance!