Skip to content

AutoGPT is the vision of accessible AI for everyone, to use and to build on. Our mission is to provide the tools, so that you can focus on what matters.

fix(copilot): handle empty tool_call arguments in baseline path (#12289)

Zamil Majdy25022f2d1e50
diff --git a/autogpt_platform/backend/backend/copilot/baseline/service.py b/autogpt_platform/backend/backend/copilot/baseline/service.py
index fba16804b6..d151a5edbe 100644
--- a/autogpt_platform/backend/backend/copilot/baseline/service.py
+++ b/autogpt_platform/backend/backend/copilot/baseline/service.py
@@ -287,7 +287,7 @@ async def stream_chat_completion_baseline(
yield StreamFinishStep()
step_open = False
- # Append the assistant message with tool_calls to context
+ # Append the assistant message with tool_calls to context.
assistant_msg: dict[str, Any] = {"role": "assistant"}
if round_text:
assistant_msg["content"] = round_text
@@ -297,7 +297,7 @@ async def stream_chat_completion_baseline(
"type": "function",
"function": {
"name": tc["name"],
- "arguments": tc["arguments"],
+ "arguments": tc["arguments"] or "{}",
},
}
for tc in tool_calls_by_index.values()