plain-librarian-80497
08/18/2025, 4:59 PMtall-airline-16756
08/18/2025, 4:59 PMtall-airline-16756
08/18/2025, 5:00 PMplain-librarian-80497
08/18/2025, 5:01 PMtall-airline-16756
08/18/2025, 5:01 PMResponseTextDoneEvent
. This event pops up right when the LLM has wrapped up its response.
Here’s a quick example to show you how it works:
// Listen for the ResponseTextDoneEvent
agent.addEventListener('ResponseTextDoneEvent', (event) => {
console.log('LLM response completed:', event.text);
});
If you want, I’m here to help with any other questions or details on how to set this up!plain-librarian-80497
08/18/2025, 5:03 PMtall-airline-16756
08/18/2025, 5:04 PM_handle_response_done
event, which closes all message channels and lets us know the generation is wrapped up.
• The _mark_generation_done()
method, which clearly signals that the generation is finished.
• A message with role="assistant"
gets added to the chat context and conversation items.
All these steps work together to make sure the LLM response is complete. If you'd like, I’m happy to share more details or examples—just let me know!
Sources: examples/drive-thru/test_agent.py