Open Dofine-dufei opened 1 week ago
There is a known issue where the Custom Tool's parameters change from object type to string type when set in the schema. This behavior is due to the ToolParameterConverter
class's get_parameter_type
method, which maps several parameter types, including ToolParameter.ToolParameterType.STRING
, ToolParameter.ToolParameterType.SECRET_INPUT
, and ToolParameter.ToolParameterType.SELECT
, to the string type. This mapping is likely done to standardize these parameter types as strings within the schema [1].
Currently, there is no documentation or code comments explaining why object types are not supported as parameters in custom tools, nor are there any existing workarounds or extensions in the Dify codebase that allow for object types to be used as parameters in custom tools [1].
To continue talking to Dosu, mention @dosu.
Self Checks
Dify version
0.9.2
Cloud or Self Hosted
Self Hosted (Source)
Steps to reproduce
1.set parameter type as object in Custom Tool's schema. 2.test or generate a agent, found that parameter changed to a string type.
✔️ Expected Behavior
I wish tool's parameters support object type in Custom Tool.
❌ Actual Behavior
The tool's parameters changed to string type, actually it's object type.