getSessionMetrics method
Get session metrics including token usage and performance stats.
FFI (LiteRT-LM): Returns accurate token counts from benchmark info. MediaPipe (Mobile): Returns estimated counts (uses internal metrics if available).
Call this after getResponse or getResponseAsync completes for accurate results.
Implementation
@override
SessionMetrics getSessionMetrics() {
// Web MediaPipe implementation doesn't expose detailed token metrics.
// Users can estimate using sizeInTokens() before/after generation.
return SessionMetrics();
}