diff --git a/profiler/src/profiler/TracyLlm.cpp b/profiler/src/profiler/TracyLlm.cpp index ddb89866..42a3efa5 100644 --- a/profiler/src/profiler/TracyLlm.cpp +++ b/profiler/src/profiler/TracyLlm.cpp @@ -825,6 +825,12 @@ bool TracyLlm::OnResponse( const nlohmann::json& json ) if( done ) { + if( json.contains( "usage" ) ) + { + auto& usage = json["usage"]; + if( usage.contains( "total_tokens" ) ) m_usedCtx = usage["total_tokens"].get(); + } + bool isTool = false; auto& str = back["content"].get_ref(); if( !str.starts_with( "" ) )