@@ -203,7 +203,7 @@ def test_handle_generator(self):
203203 handler .handle (mock_span , component_type = "OpenAIGenerator" )
204204
205205 assert mock_span .update .call_count == 1
206- assert mock_span .update .call_args_list [0 ][1 ] == {"usage " : None , "model" : "test_model" }
206+ assert mock_span .update .call_args_list [0 ][1 ] == {"usage_details " : None , "model" : "test_model" }
207207
208208 def test_handle_chat_generator (self ):
209209 mock_span = Mock ()
@@ -225,7 +225,7 @@ def test_handle_chat_generator(self):
225225
226226 assert mock_span .update .call_count == 1
227227 assert mock_span .update .call_args_list [0 ][1 ] == {
228- "usage " : None ,
228+ "usage_details " : None ,
229229 "model" : "test_model" ,
230230 "completion_start_time" : datetime .datetime ( # noqa: DTZ001
231231 2021 , 7 , 27 , 16 , 2 , 8 , 12345
@@ -254,7 +254,7 @@ def test_handle_bad_completion_start_time(self, caplog):
254254
255255 assert mock_span .update .call_count == 1
256256 assert mock_span .update .call_args_list [0 ][1 ] == {
257- "usage " : None ,
257+ "usage_details " : None ,
258258 "model" : "test_model" ,
259259 "completion_start_time" : None ,
260260 }
@@ -348,7 +348,7 @@ def test_trace_generation(self):
348348 }
349349 with tracer .trace (operation_name = "operation_name" , tags = tags ) as span :
350350 ...
351- assert span .raw_span ()._data ["usage " ] is None
351+ assert span .raw_span ()._data ["usage_details " ] is None
352352 assert span .raw_span ()._data ["model" ] == "test_model"
353353 assert span .raw_span ()._data ["completion_start_time" ] == datetime .datetime (2021 , 7 , 27 , 16 , 2 , 8 , 12345 ) # noqa: DTZ001
354354
@@ -415,7 +415,7 @@ def test_trace_generation_invalid_start_time(self):
415415 }
416416 with tracer .trace (operation_name = "operation_name" , tags = tags ) as span :
417417 ...
418- assert span .raw_span ()._data ["usage " ] is None
418+ assert span .raw_span ()._data ["usage_details " ] is None
419419 assert span .raw_span ()._data ["model" ] == "test_model"
420420 assert span .raw_span ()._data ["completion_start_time" ] is None
421421
0 commit comments