Why these 3 don’t have usage metrics in Log Agent insight
Room Id : RM_R688mmNWxYxw
RM_mqWdXm6zCn8f
RM_xzBrURRSTBmG
I want to know Usage: UsageSummary
CODE:
session = AgentSession(
tools=[end_interview],
stt=stt_plugin.FallbackAdapter([
stt,
assemblyai.STT(model="universal-streaming", api_key=ASSEMBLYAI_API_KEY)
]),
# llm="openai/gpt-4o",
llm = llm.FallbackAdapter(llm=[
openai.LLM(
model="gpt-5",
api_key=OPENAI_API_KEY
),
openai.LLM(
model="gpt-4o"
)
]),
tts=tts_plugin.FallbackAdapter([
tts,
]),
vad=silero.VAD.load(),
turn_detection=MultilingualModel(),
preemptive_generation=True,
allow_interruptions=True,
min_interruption_duration=1.2, # Minimum speech length (s) to register as an interruption
min_endpointing_delay=1.6, # Minimum time-in-seconds since the last detected speech before the agent declares the user's turn complete.
max_endpointing_delay=7.0, # Maximum time-in-seconds the agent will wait before terminating the turn
false_interruption_timeout=1.5, #
user_away_timeout=20
)
usage = metrics.UsageCollector()
@session.on("metrics_collected")
def _m(ev):
usage.collect(ev.metrics)
async def log_usage():
logger.info(f"Usage: {usage.get_summary()}")
ctx.add_shutdown_callback(log_usage)
Even in my local, i didn’t printed this line
logger.info(f"Usage: {usage.get_summary()}")