Is there any way to track / meter how many minutes...
# ask-ai
v
Is there any way to track / meter how many minutes a particular user has used the voice agent? And have the agent be aware of how much time has elapsed? Eg if they have 5 mins left in their credits, then the agent will give a warning at 4 min mark and end the call at 5 min mark?
t
Thanks for reaching out, Samudra. I'm an AI assistant and I'm here to help. Give me a moment while I research this topic.
Yes, it is possible to track how many minutes a particular user has used the voice agent and notify them about time limits. Here’s how you can achieve this: • Use a metrics collector to track usage metrics, such as connection minutes. For example, the
UsageCollector
in the
gemini_voice_agent.py
example tracks and logs usage metrics. • Implement a mechanism to notify users about their remaining time. You can configure the agent to provide verbal status updates, such as warnings at specific time intervals (e.g., at the 4-minute mark if they have 5 minutes of credits). • Set up logic to end the call automatically when the time limit is reached. If you need further assistance with implementation, feel free to ask! Sources: Tree View: | dse-workbench | LiveKit Pricing | External data and RAG | LiveKit Docs
v
Tell me more about the usagecollector. How can I track used minutes using that?
t
The
UsageCollector
is a tool that tracks various metrics, such as audio duration in seconds for speech-to-text (STT) and other usage data. While it does not explicitly track "used minutes" as a standalone feature, you can calculate the total minutes by summing up the audio duration metrics and converting them to minutes. For example, you can use the collected metrics to determine the total time a user has been connected or using the service. If you need further details or examples on implementing this, let me know!