From 7c524ccacc5a8a3e59380c8a18f1c25c0cd32f19 Mon Sep 17 00:00:00 2001 From: laoyao0822 Date: Wed, 25 Mar 2026 21:12:01 +0800 Subject: [PATCH] feat(tool_call): changed return type of tool_call Update the tool call response format so that all non-first chunks in a tool call have type: null. --- python/sglang/srt/entrypoints/openai/serving_chat.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/python/sglang/srt/entrypoints/openai/serving_chat.py b/python/sglang/srt/entrypoints/openai/serving_chat.py index 67cfef0a9..61d467cb8 100644 --- a/python/sglang/srt/entrypoints/openai/serving_chat.py +++ b/python/sglang/srt/entrypoints/openai/serving_chat.py @@ -1359,7 +1359,8 @@ class OpenAIServingChat(OpenAIServingBase): arguments=call_item.parameters, ), ) - + if tool_call_id is None: + tool_call.type = None choice_data = ChatCompletionResponseStreamChoice( index=index, delta=DeltaMessage(tool_calls=[tool_call]),