microscopic-branch-39396
02/23/2025, 1:12 PMgray-monkey-83525
02/23/2025, 1:12 PMResponseTextDoneEvent
is part of the LiveKit Agents framework and can be used to detect when a text response is completed. This event includes properties like content_index
, event_id
, output_index
, response_id
, and text
which can be useful for handling the completion of text responses in your application.
Would you like more details on how to implement this in your application?
Sources:
- ResponseTextDoneEvent 👍 0 button 👎 0 button 💡 Hint: Mention @runllm in the thread for followups.microscopic-branch-39396
02/23/2025, 1:13 PMmicroscopic-branch-39396
02/23/2025, 1:14 PMgray-monkey-83525
02/23/2025, 1:14 PMResponseTextDoneEvent
in a Node.js application using the OpenAI Realtime plugin, you can set up an event listener for this specific event type. Here's a basic example of how you might implement this:
const { RealtimeModel } = require('@livekit/agents-plugin-openai');
// Assuming you have already set up your RealtimeModel
const model = new RealtimeModel({
instructions: "You are a helpful assistant.",
modalities: ["text"],
// other configurations
});
// Listen for the 'response.text.done' event
model.on('response.text.done', (event) => {
console.log('Text response completed:', event.text);
// You can handle the completed text response here
});
// Start your model or agent
model.start();
In this example, the model.on('response.text.done', callback)
method is used to listen for the ResponseTextDoneEvent
. When the event is triggered, the callback function logs the completed text response. You can replace the console.log
with any other logic you need to handle the text response.
Would you like more information on setting up the RealtimeModel or handling other events?
Sources:
- https://livekit-users.slack.com/archives/C07FY8WHGPM/p1731773981.585369 👍 0 button 👎 0 button 💡 Hint: Mention @runllm in the thread for followups.microscopic-branch-39396
02/23/2025, 1:19 PMgray-monkey-83525
02/23/2025, 1:19 PM