Skip to content

Commit 959783f

Browse files
authored
[fix] fix seed-oss-parser (#23560)
Signed-off-by: jiabin.00 <jiabin.00@bytedance.com>
1 parent ce0e9db commit 959783f

File tree

2 files changed

+5
-7
lines changed

2 files changed

+5
-7
lines changed

tests/tool_use/test_seed_oss_tool_parser.py

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -102,9 +102,7 @@ def test_extract_tool_calls_no_tools(seed_oss_tool_parser):
102102
],
103103
argnames=["model_output", "expected_tool_calls", "expected_content"],
104104
argvalues=[
105-
("""<seed:think>\n</seed:cot_budget_reflect>\n</seed:cot_budget_reflect>\n"""
106-
"""The current thinking budget is 0, so I will directly start answering the question.\n</seed:think>\n"""
107-
"""<seed:tool_call>\n<function=get_weather>\n"""
105+
("""<seed:tool_call>\n<function=get_weather>\n"""
108106
"""<parameter=location>Barcelona, Spain</parameter>\n</function>\n</seed:tool_call>""",
109107
[
110108
ToolCall(function=FunctionCall(
@@ -114,10 +112,7 @@ def test_extract_tool_calls_no_tools(seed_oss_tool_parser):
114112
}, ),
115113
),
116114
type='function')
117-
],
118-
"""<seed:think>\n</seed:cot_budget_reflect>\n</seed:cot_budget_reflect>\n"""
119-
"""The current thinking budget is 0, so I will directly start answering the question.\n</seed:think>\n"""
120-
),
115+
], None),
121116
(
122117
"""<seed:think>The user\'s current thinking budget is 512.</seed:cot_budget_reflect>\nLet me analyze the """
123118
"""question. The user wants to know the weather in Barcelona, Spain. Looking at the functions available, """

vllm/entrypoints/openai/tool_parsers/seed_oss_tool_parser.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -271,6 +271,9 @@ def extract_tool_calls(
271271
# Extract content after think end token
272272
result_content = model_output[think_end_index:]
273273
thinking_content = model_output[:think_end_index]
274+
else:
275+
thinking_content = ""
276+
result_content = model_output
274277

275278
try:
276279
function_calls = self._get_function_calls(result_content)

0 commit comments

Comments
 (0)