Skip to content

Commit

Permalink
fix(core/tools): Fix the issue with iterating over None in `_transfor…
Browse files Browse the repository at this point in the history
…m_tool_parameters_type`. (langgenius#5190)
  • Loading branch information
laipz8200 authored Jun 14, 2024
1 parent 4289f17 commit ed53ef2
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions api/core/tools/tool/tool.py
Original file line number Diff line number Diff line change
Expand Up @@ -237,10 +237,10 @@ def _transform_tool_parameters_type(self, tool_parameters: dict[str, Any]) -> di
"""
# Temp fix for the issue that the tool parameters will be converted to empty while validating the credentials
result = deepcopy(tool_parameters)
for parameter in self.parameters:
for parameter in self.parameters or []:
if parameter.name in tool_parameters:
result[parameter.name] = ToolParameterConverter.cast_parameter_by_type(tool_parameters[parameter.name], parameter.type)

return result

@abstractmethod
Expand Down

0 comments on commit ed53ef2

Please sign in to comment.