diff --git a/python/sglang/srt/function_call/base_format_detector.py b/python/sglang/srt/function_call/base_format_detector.py index 2b83893f5..03a0c6e43 100644 --- a/python/sglang/srt/function_call/base_format_detector.py +++ b/python/sglang/srt/function_call/base_format_detector.py @@ -83,7 +83,7 @@ class BaseFormatDetector(ABC): results.append( ToolCallItem( - tool_index=-1, # Caller should update this based on the actual tools array called + tool_index=tool_indices.get(name, -1), name=name, parameters=json.dumps( act.get("parameters") or act.get("arguments", {}),