style(guardrails): shorten Azure cast-ok reasons to fit the line limit

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
This commit is contained in:
yucheng 2026-09-30 21:50:41 +00:00
parent f4206f740d
commit 27dcfc8c83

View file

@ -139,10 +139,10 @@ class AzureGuardrailBase:
responses_input: Final = data.get("input")
if not isinstance(responses_input, (str, list)):
return None
validated_input: Final = cast(ResponseInputParam, responses_input) # cast-ok: isinstance narrowed to str | list, the ResponseInputParam shape
validated_input: Final = cast(ResponseInputParam, responses_input) # cast-ok: narrowed to str | list
return get_last_user_message(ResponsesAPIRequestUtils.responses_input_to_chat_messages(validated_input))
messages: Final = data.get("messages")
if not isinstance(messages, list):
return None
return get_last_user_message(cast(list[AllMessageValues], messages)) # cast-ok: isinstance narrowed to list, the message list shape
return get_last_user_message(cast(list[AllMessageValues], messages)) # cast-ok: narrowed to list