mirror of
https://github.com/BerriAI/litellm.git
synced 2026-10-06 02:48:13 +00:00
fix(guardrails): suppress Azure cast lint violations with cast-ok reasons
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
This commit is contained in:
parent
c28e8b4040
commit
96ae6ab4cc
1 changed files with 2 additions and 2 deletions
|
|
@ -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)
|
||||
validated_input: Final = cast(ResponseInputParam, responses_input) # cast-ok: isinstance narrowed to str | list, the ResponseInputParam shape
|
||||
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))
|
||||
return get_last_user_message(cast(list[AllMessageValues], messages)) # cast-ok: isinstance narrowed to list, the message list shape
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue