Skip to content

Conversation

@linger118927
Copy link

Description

When using Claude models (or other LLM providers) with tool calling, the tool_call.arguments field may be an empty string "" instead of "{}" for tools that don't require parameters.

This causes a JSONDecodeError[ in ](file://core/mt_llm_client.py#90#24)AssistantAgent._execute_tool_call method, even though the tool call is valid and should be executed with empty arguments.

Current Behavior

# In _assistant_agent.py line 1547
arguments = json.loads(tool_call.arguments)  # Raises JSONDecodeError for ""

When tool_call.arguments = "", this raises:

Why are these changes needed?

Related issue number

Checks

## Description
When using Claude models (or other LLM providers) with tool calling, the `tool_call.arguments` 
field may be an empty string `""` instead of `"{}"` for tools that don't require parameters.

This causes a `JSONDecodeError[ in ](file://core/mt_llm_client.py#90#24)AssistantAgent._execute_tool_call` method, even though 
the tool call is valid and should be executed with empty arguments.

## Current Behavior
```python
# In _assistant_agent.py line 1547
arguments = json.loads(tool_call.arguments)  # Raises JSONDecodeError for ""
```

When `tool_call.arguments = ""`, this raises:
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

1 participant