We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 46303ab commit 3a17c85Copy full SHA for 3a17c85
function_schema/core.py
@@ -9,6 +9,7 @@
9
Union,
10
get_args,
11
get_origin,
12
+ get_type_hints,
13
)
14
15
from .types import FunctionSchema, Doc
@@ -81,9 +82,11 @@ def get_function_schema(
81
82
"properties": {},
83
"required": [],
84
}
85
+ type_hints = get_type_hints(func, include_extras=True)
86
for name, param in params.items():
- param_args = get_args(param.annotation)
- is_annotated = get_origin(param.annotation) is Annotated
87
+ type_hint = type_hints[name]
88
+ param_args = get_args(type_hint)
89
+ is_annotated = get_origin(type_hint) is Annotated
90
91
enum_ = None
92
default_value = inspect._empty
0 commit comments