fix: Fix the non-empty check of the tool input parameters

This commit is contained in:
fit2cloudzhao 2025-11-26 11:19:50 +08:00 committed by zhanweizhang7
parent 9a474b2302
commit 2cdd42ccd3

View File

@ -431,7 +431,7 @@ class ToolSerializer(serializers.Serializer):
@staticmethod
def convert_value(name: str, value: str, _type: str, is_required: bool):
if not is_required and value is None:
if not is_required and (value is None or (isinstance(value, str) and len(value.strip()) == 0)):
return None
try:
if _type == 'int':