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 c9d1b6e commit 107290aCopy full SHA for 107290a
function_schema/core.py
@@ -1,5 +1,6 @@
1
import enum
2
import typing
3
+import types
4
import inspect
5
6
@@ -138,7 +139,7 @@ def guess_type(
138
139
origin = typing.get_origin(T)
140
141
# hacking around typing modules, `typing.Union` and `types.UnitonType`
- if origin is typing.Union:
142
+ if origin is typing.Union or origin is types.UnionType:
143
union_types = [t for t in typing.get_args(T) if t is not type(None)]
144
_types = []
145
for union_type in union_types:
0 commit comments