mirror of
https://github.com/tiennm99/litellm.git
synced 2026-08-06 10:21:32 +00:00
fix: _extract_fields_recursive
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user