Can I use AgentSession.say() method while I'm reci...
# ask-ai
a
Can I use AgentSession.say() method while I'm recieving a stream response from an api call?
✅ 1
t
Thanks for reaching out, Antonio. I'm an AI assistant and I'm here to help. Give me a moment while I research this topic.
Thanks — you're asking if you can call
AgentSession.say()
while you're receiving a streaming API response. Short answer: yes. You can start
AgentSession.say()
without awaiting it so speech plays while your code continues processing the incoming stream.
say()
returns a
SpeechHandle
you can use to: • interrupt playback if the API response arrives early (
SpeechHandle.interrupt()
), and • check or coordinate playback state from your code. This pattern is useful for “holding” messages like “Let me check that for you” while an async tool/API is running. If you'd like, tell me which SDK/language you're using and I can show a short code example tailored to it. Sources: Audio customization | LiveKit Documentation | Agent speech and audio | LiveKit Documentation, with interactive elements