deactivate class params check for now
This commit is contained in:
parent
f3d50e9fea
commit
3a5b708d53
1 changed files with 5 additions and 5 deletions
|
|
@ -25,7 +25,6 @@ from langflow.interface.toolkits.base import toolkits_creator
|
||||||
from langflow.interface.types import get_type_list
|
from langflow.interface.types import get_type_list
|
||||||
from langflow.interface.utils import load_file_into_dict
|
from langflow.interface.utils import load_file_into_dict
|
||||||
from langflow.utils import util, validate
|
from langflow.utils import util, validate
|
||||||
from pydantic import BaseModel
|
|
||||||
|
|
||||||
|
|
||||||
def instantiate_class(node_type: str, base_type: str, params: Dict) -> Any:
|
def instantiate_class(node_type: str, base_type: str, params: Dict) -> Any:
|
||||||
|
|
@ -35,11 +34,12 @@ def instantiate_class(node_type: str, base_type: str, params: Dict) -> Any:
|
||||||
return custom_agent.initialize(**params) # type: ignore
|
return custom_agent.initialize(**params) # type: ignore
|
||||||
|
|
||||||
class_object = import_by_type(_type=base_type, name=node_type)
|
class_object = import_by_type(_type=base_type, name=node_type)
|
||||||
|
# check if it is a class before using issubclass
|
||||||
|
|
||||||
if issubclass(class_object, BaseModel):
|
# if isinstance(class_object, type) and issubclass(class_object, BaseModel):
|
||||||
# validate params
|
# # validate params
|
||||||
fields = class_object.__fields__
|
# fields = class_object.__fields__
|
||||||
params = {key: value for key, value in params.items() if key in fields}
|
# params = {key: value for key, value in params.items() if key in fields}
|
||||||
|
|
||||||
if base_type == "agents":
|
if base_type == "agents":
|
||||||
# We need to initialize it differently
|
# We need to initialize it differently
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue