mirror of
https://github.com/BerriAI/litellm.git
synced 2026-09-12 23:01:41 +00:00
refactor: drop inline isinstance guard in type-list normalization
JSON Schema type arrays contain only strings, so type_mapping.get(entry, entry) is sufficient and avoids an inline type guard.
This commit is contained in:
parent
f1f2fff980
commit
affd76499e
1 changed files with 1 additions and 3 deletions
|
|
@ -57,9 +57,7 @@ def normalize_json_schema_types(
|
|||
# to mark a field nullable (e.g. ["STRING", "NULL"]). Without this
|
||||
# branch those entries fall through to the generic list recursion,
|
||||
# which leaves the bare strings uppercase.
|
||||
normalized_schema[key] = [
|
||||
type_mapping.get(entry, entry) if isinstance(entry, str) else entry for entry in value
|
||||
]
|
||||
normalized_schema[key] = [type_mapping.get(entry, entry) for entry in value]
|
||||
elif key == "properties" and isinstance(value, dict):
|
||||
# Recursively normalize properties
|
||||
normalized_schema[key] = {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue