@@ -133,6 +133,7 @@ def test_max_logprobs_invalid_values(self):
133133
134134 self .assertIn ("max_logprobs" , str (context .exception ))
135135 self .assertIn ("must be >= -1" , str (context .exception ))
136+ self .assertIn ("got -2" , str (context .exception ))
136137
137138 def test_max_logprobs_exceeds_vocab_size (self ):
138139 """Test max_logprobs exceeding vocab_size"""
@@ -146,7 +147,7 @@ def test_max_logprobs_exceeds_vocab_size(self):
146147 self .assertIn ("max_logprobs" , str (context .exception ))
147148 self .assertIn ("must be <= vocab_size" , str (context .exception ))
148149 self .assertIn ("1000" , str (context .exception ))
149- self .assertIn ("1500" , str (context .exception ))
150+ self .assertIn ("got 1500" , str (context .exception ))
150151
151152 def test_max_logprobs_unlimited (self ):
152153 """Test max_logprobs = -1 (unlimited) sets to ori_vocab_size"""
@@ -237,7 +238,8 @@ def test_prompt_logprobs_invalid_values(self):
237238 self .engine_client .valid_parameters (data )
238239
239240 self .assertIn ("prompt_logprobs" , str (context .exception ))
240- self .assertIn ("must be >= -1" , str (context .exception ))
241+ self .assertIn ("must be a non-negative value or -1" , str (context .exception ))
242+ self .assertIn ("current value is -2" , str (context .exception ))
241243
242244 def test_prompt_logprobs_exceeds_max_logprobs (self ):
243245 """Test prompt_logprobs exceeding max_logprobs"""
@@ -252,6 +254,8 @@ def test_prompt_logprobs_exceeds_max_logprobs(self):
252254
253255 self .assertIn ("prompt_logprobs" , str (context .exception ))
254256 self .assertIn ("exceeds maximum allowed value" , str (context .exception ))
257+ self .assertIn ("15" , str (context .exception ))
258+ self .assertIn ("10" , str (context .exception ))
255259
256260 def test_top_logprobs_validation_with_fd_use_get_save_output_v1_enabled (self ):
257261 """Test top_logprobs validation when FD_USE_GET_SAVE_OUTPUT_V1 is enabled"""
@@ -275,7 +279,8 @@ def test_top_logprobs_validation_with_fd_use_get_save_output_v1_enabled(self):
275279 data = {"logprobs" : True , "top_logprobs" : - 2 , "request_id" : "test" }
276280 with self .assertRaises (ValueError ) as context :
277281 self .engine_client .valid_parameters (data )
278- self .assertIn ("must be >= -1" , str (context .exception ))
282+ self .assertIn ("must be a non-negative value or -1" , str (context .exception ))
283+ self .assertIn ("current value is -2" , str (context .exception ))
279284
280285 # Test value exceeding max_logprobs - should raise ValueError
281286 data = {"logprobs" : True , "top_logprobs" : 25 , "request_id" : "test" }
@@ -293,13 +298,15 @@ def test_top_logprobs_validation_with_fd_use_get_save_output_v1_disabled(self):
293298 data = {"logprobs" : True , "top_logprobs" : - 1 , "request_id" : "test" }
294299 with self .assertRaises (ValueError ) as context :
295300 self .engine_client .valid_parameters (data )
296- self .assertIn ("must be >= 0" , str (context .exception ))
301+ self .assertIn ("top_logprobs must be between 0 and 20" , str (context .exception ))
302+ self .assertIn ("current value is -1" , str (context .exception ))
297303
298304 # Test value > 20 - should raise ValueError
299305 data = {"logprobs" : True , "top_logprobs" : 25 , "request_id" : "test" }
300306 with self .assertRaises (ValueError ) as context :
301307 self .engine_client .valid_parameters (data )
302- self .assertIn ("must be <= 20" , str (context .exception ))
308+ self .assertIn ("top_logprobs must be between 0 and 20" , str (context .exception ))
309+ self .assertIn ("current value is 25" , str (context .exception ))
303310
304311 # Test valid value
305312 data = {"logprobs" : True , "top_logprobs" : 10 , "request_id" : "test" }
0 commit comments