feat(token-tracking): attach usage hook to advisor's self-created LLM client

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This commit is contained in:
wangwei
2026-07-02 14:39:13 +08:00
co-authored by Copilot
parent 613d167e81
commit 29e76d021c
2 changed files with 35 additions and 1 deletions
+2 -1
View File
@@ -180,9 +180,10 @@ async def analyze(
if client is None:
from openai import AsyncOpenAI
from rag_eval.metrics.factory import resolve_openai_client_kwargs
from rag_eval.metrics.factory import attach_usage_hook, resolve_openai_client_kwargs
client = AsyncOpenAI(**resolve_openai_client_kwargs(judge_model, settings))
attach_usage_hook(client)
owns_client = True
try: