mirror of
https://github.com/BerriAI/litellm.git
synced 2026-11-11 08:38:24 +00:00
fix(guardrails): type the single Gemini item as a mapping
This commit is contained in:
parent
9c68f7391d
commit
955f43b786
1 changed files with 3 additions and 2 deletions
|
|
@ -222,8 +222,9 @@ def _unmaskable_reason(
|
|||
|
||||
def _gemini_items(value: object) -> Sequence[object]:
|
||||
"""A repeated Gemini field as a sequence: a JSON array, or the single object Google also accepts in its place."""
|
||||
if isinstance(value, dict):
|
||||
return (value,)
|
||||
single: Final = as_str_mapping(value)
|
||||
if single is not None:
|
||||
return (single,)
|
||||
return _OBJECT_LIST.validate_python(value) if isinstance(value, list) else ()
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue