Import typing module and update default imports
This commit is contained in:
parent
5914381e84
commit
8be28c947f
1 changed files with 5 additions and 5 deletions
|
|
@ -260,12 +260,12 @@ def get_default_imports(code_string):
|
||||||
"""
|
"""
|
||||||
Returns a dictionary of default imports for the dynamic class constructor.
|
Returns a dictionary of default imports for the dynamic class constructor.
|
||||||
"""
|
"""
|
||||||
|
typing_module = importlib.import_module("typing")
|
||||||
default_imports = {
|
default_imports = {
|
||||||
"Optional": importlib.import_module("typing").Optional,
|
"Optional": typing_module.Optional,
|
||||||
"List": importlib.import_module("typing").List,
|
"List": typing_module.List,
|
||||||
"Dict": importlib.import_module("typing").Dict,
|
"Dict": typing_module.Dict,
|
||||||
"Union": importlib.import_module("typing").Union,
|
"Union": typing_module.Union,
|
||||||
# Add more imports from the typing module as needed
|
|
||||||
}
|
}
|
||||||
|
|
||||||
langflow_imports = list(CUSTOM_COMPONENT_SUPPORTED_TYPES.keys())
|
langflow_imports = list(CUSTOM_COMPONENT_SUPPORTED_TYPES.keys())
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue