mirror of
https://github.com/BerriAI/litellm.git
synced 2026-10-30 06:43:27 +00:00
fix(token_counter): avoid new unknown type diagnostics
Assisted-by: OpenAI Codex
This commit is contained in:
parent
7858fb9569
commit
d2160f155d
1 changed files with 2 additions and 3 deletions
|
|
@ -1112,9 +1112,8 @@ def _format_type(props, indent):
|
|||
return " | ".join([f'"{item}"' for item in props["enum"]])
|
||||
return "string"
|
||||
elif type == "array":
|
||||
items: Final = props.get("items")
|
||||
if isinstance(items, dict):
|
||||
return f"{_format_type(items, indent)}[]"
|
||||
if "items" in props and isinstance(props["items"], dict):
|
||||
return f"{_format_type(props['items'], indent)}[]"
|
||||
return "any[]"
|
||||
elif type == "object":
|
||||
return f"{{\n{_format_object_parameters(props, indent + 2)}\n}}"
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue