@@ -17,10 +17,10 @@ def test_calc_finish_reason_tool_calls(self):
17
17
engine_client .reasoning_parser = "ernie_x1"
18
18
# 创建一个OpenAIServingCompletion实例
19
19
serving_completion = OpenAIServingCompletion (engine_client , "pid" , "ips" , 360 )
20
- # 创建一个模拟的output,并设置finish_reason为"tool_calls "
21
- output = {"finish_reason " : "tool_calls " }
20
+ # 创建一个模拟的output,并设置finish_reason为"tool_call "
21
+ output = {"tool_call " : "tool_call " }
22
22
# 调用calc_finish_reason方法
23
- result = serving_completion .calc_finish_reason (None , 100 , output )
23
+ result = serving_completion .calc_finish_reason (None , 100 , output , False )
24
24
# 断言结果为"tool_calls"
25
25
assert result == "tool_calls"
26
26
@@ -33,7 +33,7 @@ def test_calc_finish_reason_stop(self):
33
33
# 创建一个模拟的output,并设置finish_reason为其他值
34
34
output = {"finish_reason" : "other_reason" }
35
35
# 调用calc_finish_reason方法
36
- result = serving_completion .calc_finish_reason (None , 100 , output )
36
+ result = serving_completion .calc_finish_reason (None , 100 , output , False )
37
37
# 断言结果为"stop"
38
38
assert result == "stop"
39
39
@@ -45,7 +45,7 @@ def test_calc_finish_reason_length(self):
45
45
# 创建一个模拟的output
46
46
output = {}
47
47
# 调用calc_finish_reason方法
48
- result = serving_completion .calc_finish_reason (100 , 100 , output )
48
+ result = serving_completion .calc_finish_reason (100 , 100 , output , False )
49
49
# 断言结果为"length"
50
50
assert result == "length"
51
51
@@ -95,6 +95,7 @@ def test_request_output_to_completion_response(self):
95
95
model_name = model_name ,
96
96
prompt_batched_token_ids = prompt_batched_token_ids ,
97
97
completion_batched_token_ids = completion_batched_token_ids ,
98
+ text_after_process_list = ["1" , "1" ],
98
99
)
99
100
100
101
assert completion_response .id == request_id
0 commit comments