Skip to content

Commit 4fd6c52

Browse files
committed
fix: api tool avoid sending body if empty
1 parent b523a98 commit 4fd6c52

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

application/agents/tools/api_tool.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,10 @@ def _make_api_call(self, url, method, headers, query_params, body):
2929
body = json.dumps(body)
3030
try:
3131
print(f"Making API call: {method} {url} with body: {body}")
32+
if body == "{}":
33+
body = None
3234
response = requests.request(method, url, headers=headers, data=body)
3335
response.raise_for_status()
34-
3536
content_type = response.headers.get(
3637
"Content-Type", "application/json"
3738
).lower()

0 commit comments

Comments
 (0)