From 8e93f092af0e62f762d418ed5531979392da056a Mon Sep 17 00:00:00 2001 From: yucheng Date: Tue, 29 Sep 2026 21:56:57 +0000 Subject: [PATCH] style(grayswan): apply ruff format to post-call context changes Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> --- .../guardrails/guardrail_hooks/grayswan/grayswan.py | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/litellm/proxy/guardrails/guardrail_hooks/grayswan/grayswan.py b/litellm/proxy/guardrails/guardrail_hooks/grayswan/grayswan.py index 65994dbd386..200fd785fa8 100644 --- a/litellm/proxy/guardrails/guardrail_hooks/grayswan/grayswan.py +++ b/litellm/proxy/guardrails/guardrail_hooks/grayswan/grayswan.py @@ -278,11 +278,7 @@ class GraySwanGuardrail(CustomGuardrail): messages: Final = ( *context, *(_MonitorMessage(role=role, content=text) for text in texts), - *( - (_MonitorMessage(role="assistant", tool_calls=response_tool_calls),) - if response_tool_calls - else () - ), + *((_MonitorMessage(role="assistant", tool_calls=response_tool_calls),) if response_tool_calls else ()), ) # Get dynamic params from request metadata @@ -622,9 +618,7 @@ class GraySwanGuardrail(CustomGuardrail): request_route: Final = ( litellm_metadata.get("user_api_key_request_route") if isinstance(litellm_metadata, Mapping) else None ) - route_call_types: Final = ( - get_call_types_for_route(request_route) if isinstance(request_route, str) else None - ) + route_call_types: Final = get_call_types_for_route(request_route) if isinstance(request_route, str) else None call_type: Final = ( (route_call_types[0].value if route_call_types else None) or (logging_obj.call_type if logging_obj is not None else None)