chore(format): ruff format the 4 drifted files (no behavior change)
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AaQCFnfsh3tfq1VfzdJpoi
This commit is contained in:
parent
84d19c97d6
commit
705c5dd49a
4 changed files with 95 additions and 31 deletions
|
|
@ -86,9 +86,7 @@ class BudgetMiddleware(ChatMiddleware):
|
|||
self._meter = meter
|
||||
self._strict = strict_usage
|
||||
|
||||
async def process(
|
||||
self, context: ChatContext, call_next: Callable[[], Awaitable[None]]
|
||||
) -> None:
|
||||
async def process(self, context: ChatContext, call_next: Callable[[], Awaitable[None]]) -> None:
|
||||
await call_next()
|
||||
usage = getattr(context.result, "usage_details", None)
|
||||
total = usage.get("total_token_count") if usage is not None else None
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue