From e16b6e7fb429de88a735a234ca4686f3a9fb9542 Mon Sep 17 00:00:00 2001 From: 9qeklajc <9qeklajc> Date: Thu, 26 Jun 2025 10:55:25 +0200 Subject: [PATCH] fix format --- router/proxy.py | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/router/proxy.py b/router/proxy.py index ba6c934c..26438c32 100644 --- a/router/proxy.py +++ b/router/proxy.py @@ -185,13 +185,19 @@ async def proxy( # Create a new session for this operation async with create_session() as new_session: # Re-fetch the key in the new session - fresh_key = await new_session.get(key.__class__, key.hashed_key) + fresh_key = await new_session.get( + key.__class__, key.hashed_key + ) if fresh_key: - cost_data = await adjust_payment_for_tokens( - fresh_key, data, new_session + cost_data = ( + await adjust_payment_for_tokens( + fresh_key, data, new_session + ) ) # Format as SSE and yield - cost_json = json.dumps({"cost": cost_data}) + cost_json = json.dumps( + {"cost": cost_data} + ) yield f"data: {cost_json}\n\n".encode() break except json.JSONDecodeError: