[Refactor] Remove dead current_tool_name_sent assignments from tool parsers (#43997)

Signed-off-by: sfeng33 <4florafeng@gmail.com>
This commit is contained in:
Flora Feng
2026-05-29 21:45:15 -04:00
committed by GitHub
parent 1e2ce5d11a
commit 1a096d8208
4 changed files with 0 additions and 6 deletions
-1
View File
@@ -34,7 +34,6 @@ class Ernie45ToolParser(ToolParser):
abc\n</think>\n\n\n<tool_call>\ndef\n</tool_call>\n
"""
super().__init__(tokenizer, tools)
self.current_tool_name_sent = False
self.prev_tool_call_arr: list[dict] = []
self.current_tool_id = -1
self.streamed_args_for_tool: list[str] = []
@@ -38,7 +38,6 @@ class HunyuanA13BToolParser(ToolParser):
# Initialize state for streaming mode
self.prev_tool_calls: list[dict] = []
self.current_tool_id = -1
self.current_tool_name_sent = False
self.streamed_args: list[str] = [] # Track arguments sent for each tool
# For backward compatibility with tests
@@ -262,7 +261,6 @@ class HunyuanA13BToolParser(ToolParser):
)
else:
self.streaming_state["sent_tools"][0]["sent_name"] = True
self.current_tool_name_sent = True
return delta
return None
@@ -306,7 +304,6 @@ class HunyuanA13BToolParser(ToolParser):
]
)
self.streaming_state["sent_tools"][current_idx]["sent_name"] = True
self.current_tool_name_sent = True
while len(self.streamed_args) <= current_idx:
self.streamed_args.append("")
return delta
-1
View File
@@ -246,7 +246,6 @@ class HYV3ToolParser(ToolParser):
def __init__(self, tokenizer: TokenizerLike, tools: list[Tool] | None = None):
super().__init__(tokenizer, tools)
self.current_tool_name_sent: bool = False
self.prev_tool_call_arr: list[dict] = []
self.current_tool_id: int = -1
self.streamed_args_for_tool: list[
@@ -47,7 +47,6 @@ class Phi4MiniJsonToolParser(ToolParser):
# streaming mode
self.prev_tool_call_arr: list[dict[str, Any]] = []
self.current_tool_id: int = -1
self.current_tool_name_sent: bool = False
self.streamed_args_for_tool: list[
str
] = [] # map what has been streamed for each tool so far to a list