@@ -569,12 +569,12 @@ def __init__(
569
569
params : Optional [Dict ] = None ,
570
570
):
571
571
if not isinstance (name , str ):
572
- raise ParamError (message = "The name of the function should be a string." )
572
+ raise ParamError (message = "The name of the function should be a string, but got {}" . format ( type ( name )) )
573
573
if not isinstance (description , str ):
574
- raise ParamError (message = "The description of the function should be a string." )
574
+ raise ParamError (message = "The description of the function should be a string, but got {}" . format ( type ( description )) )
575
575
if not isinstance (input_field_names , (str , list )):
576
576
raise ParamError (
577
- message = "The input field names of the function should be a string or a list of strings."
577
+ message = "The input field names of the function should be a string or a list of strings, but got {}" . format ( type ( input_field_names ))
578
578
)
579
579
self ._name = name
580
580
self ._description = description
@@ -585,7 +585,7 @@ def __init__(
585
585
output_field_names = []
586
586
if not isinstance (output_field_names , (str , list )):
587
587
raise ParamError (
588
- message = "The output field names of the function should be a string or a list of strings."
588
+ message = "The output field names of the function should be a string or a list of strings, but got {}" . format ( type ( output_field_names ))
589
589
)
590
590
output_field_names = (
591
591
[output_field_names ] if isinstance (output_field_names , str ) else output_field_names
@@ -684,8 +684,8 @@ def construct_from_dict(cls, raw: Dict):
684
684
return Function (
685
685
raw ["name" ],
686
686
raw ["type" ],
687
- raw ["input_field_names" ],
688
- raw ["output_field_names" ],
687
+ list ( raw ["input_field_names" ]) ,
688
+ list ( raw ["output_field_names" ]) ,
689
689
raw ["description" ],
690
690
raw ["params" ],
691
691
)
0 commit comments