@@ -422,24 +422,6 @@ async def responses_full_generator(
422422 usage = usage ,
423423 )
424424
425- # Log complete response if output logging is enabled
426- if self .enable_log_outputs and self .request_logger :
427- output_text = ""
428- if content :
429- output_text = content
430- elif reasoning_content :
431- output_text = f"[reasoning: { reasoning_content } ]"
432-
433- if output_text :
434- self .request_logger .log_outputs (
435- request_id = request .request_id ,
436- outputs = output_text ,
437- output_token_ids = final_output .token_ids ,
438- finish_reason = final_output .finish_reason ,
439- is_streaming = False ,
440- delta = False ,
441- )
442-
443425 if request .store :
444426 async with self .response_store_lock :
445427 stored_response = self .response_store .get (response .id )
@@ -469,6 +451,24 @@ def _make_response_output_items(
469451 reasoning_content = None
470452 content = final_output .text
471453
454+ # Log complete response if output logging is enabled
455+ if self .enable_log_outputs and self .request_logger :
456+ output_text = ""
457+ if content :
458+ output_text = content
459+ elif reasoning_content :
460+ output_text = f"[reasoning: { reasoning_content } ]"
461+
462+ if output_text :
463+ self .request_logger .log_outputs (
464+ request_id = request .request_id ,
465+ outputs = output_text ,
466+ output_token_ids = final_output .token_ids ,
467+ finish_reason = final_output .finish_reason ,
468+ is_streaming = False ,
469+ delta = False ,
470+ )
471+
472472 output = []
473473 if reasoning_content :
474474 reasoning_item = ResponseReasoningItem (
0 commit comments