mirror of
https://github.com/BerriAI/litellm.git
synced 2026-09-06 08:16:43 +00:00
fix: _extract_fields_recursive
This commit is contained in:
parent
eac3cba44f
commit
57a2ec3beb
1 changed files with 5 additions and 0 deletions
|
|
@ -841,6 +841,11 @@ def _extract_fields_recursive(
|
|||
"TypeVar",
|
||||
):
|
||||
continue
|
||||
# Handle Optional[T] where T is still a TypeVar
|
||||
if hasattr(field_annotation, "__args__"):
|
||||
non_none_args = [arg for arg in field_annotation.__args__ if arg is not type(None)]
|
||||
if non_none_args and isinstance(non_none_args[0], TypeVar):
|
||||
continue
|
||||
|
||||
# Get field metadata
|
||||
description = field.description or field_name
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue