diff --git a/gateway/platforms/api_server.py b/gateway/platforms/api_server.py index 62196973d1..32c56d1fb5 100644 --- a/gateway/platforms/api_server.py +++ b/gateway/platforms/api_server.py @@ -1949,15 +1949,10 @@ class APIServerAdapter(BasePlatformAdapter): "call_id": tc.get("id", ""), }) elif role == "tool": - output_content = msg.get("content", "") - if isinstance(output_content, list): - output = output_content - else: - output = [{"type": "input_text", "text": str(output_content)}] items.append({ "type": "function_call_output", "call_id": msg.get("tool_call_id", ""), - "output": output, + "output": msg.get("content", ""), }) # Final assistant message diff --git a/tests/gateway/test_api_server.py b/tests/gateway/test_api_server.py index 32346fc83d..8e3e066b8f 100644 --- a/tests/gateway/test_api_server.py +++ b/tests/gateway/test_api_server.py @@ -1547,7 +1547,7 @@ class TestToolCallsInOutput: assert output[0]["call_id"] == "call_abc123" assert output[1]["type"] == "function_call_output" assert output[1]["call_id"] == "call_abc123" - assert output[1]["output"] == [{"type": "input_text", "text": "42"}] + assert output[1]["output"] == "42" assert output[2]["type"] == "message" assert output[2]["content"][0]["text"] == "The result is 42."