Update swarms/tools/base_tool.py

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
pull/904/head
harshalmore31 2 weeks ago committed by GitHub
parent fb494b9ce2
commit 227f8b36cc
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -2402,12 +2402,7 @@ class BaseTool(BaseModel):
try:
# Parse arguments JSON string
if isinstance(arguments_str, str):
# Handle empty or whitespace-only arguments
arguments_str = arguments_str.strip()
if not arguments_str:
arguments = {}
else:
arguments = json.loads(arguments_str)
arguments = self._parse_json_string(arguments_str)
else:
arguments = arguments_str if arguments_str is not None else {}

Loading…
Cancel
Save