@@ -557,7 +557,7 @@ def handle_bedrock_exception(
557
557
except json .decoder .JSONDecodeError :
558
558
pass
559
559
except Exception :
560
- _logger .warning (REQUEST_EXTACTOR_FAILURE_LOG_MESSAGE % traceback .format_exception (* sys .exc_info ()))
560
+ _logger .warning (REQUEST_EXTACTOR_FAILURE_LOG_MESSAGE , traceback .format_exception (* sys .exc_info ()))
561
561
562
562
error_attributes = bedrock_error_attributes (exc , bedrock_attrs )
563
563
notice_error_attributes = {
@@ -584,7 +584,7 @@ def handle_bedrock_exception(
584
584
else :
585
585
handle_chat_completion_event (transaction , error_attributes )
586
586
except Exception :
587
- _logger .warning (EXCEPTION_HANDLING_FAILURE_LOG_MESSAGE % traceback .format_exception (* sys .exc_info ()))
587
+ _logger .warning (EXCEPTION_HANDLING_FAILURE_LOG_MESSAGE , traceback .format_exception (* sys .exc_info ()))
588
588
589
589
raise
590
590
@@ -594,7 +594,7 @@ def run_bedrock_response_extractor(response_extractor, response_body, bedrock_at
594
594
try :
595
595
response_extractor (response_body , bedrock_attrs )
596
596
except Exception :
597
- _logger .warning (RESPONSE_EXTRACTOR_FAILURE_LOG_MESSAGE % traceback .format_exception (* sys .exc_info ()))
597
+ _logger .warning (RESPONSE_EXTRACTOR_FAILURE_LOG_MESSAGE , traceback .format_exception (* sys .exc_info ()))
598
598
599
599
if is_embedding :
600
600
handle_embedding_event (transaction , bedrock_attrs )
@@ -608,7 +608,7 @@ def run_bedrock_request_extractor(request_extractor, request_body, bedrock_attrs
608
608
except json .decoder .JSONDecodeError :
609
609
pass
610
610
except Exception :
611
- _logger .warning (REQUEST_EXTACTOR_FAILURE_LOG_MESSAGE % traceback .format_exception (* sys .exc_info ()))
611
+ _logger .warning (REQUEST_EXTACTOR_FAILURE_LOG_MESSAGE , traceback .format_exception (* sys .exc_info ()))
612
612
613
613
614
614
def wrap_bedrock_runtime_invoke_model (response_streaming = False ):
@@ -735,7 +735,7 @@ def _wrap_bedrock_runtime_invoke_model(wrapped, instance, args, kwargs):
735
735
run_bedrock_response_extractor (response_extractor , response_body , bedrock_attrs , is_embedding , transaction )
736
736
737
737
except Exception :
738
- _logger .warning (RESPONSE_PROCESSING_FAILURE_LOG_MESSAGE % traceback .format_exception (* sys .exc_info ()))
738
+ _logger .warning (RESPONSE_PROCESSING_FAILURE_LOG_MESSAGE , traceback .format_exception (* sys .exc_info ()))
739
739
740
740
return response
741
741
@@ -826,7 +826,7 @@ def record_stream_chunk(self, return_val, transaction):
826
826
if _type == "content_block_stop" :
827
827
record_events_on_stop_iteration (self , transaction )
828
828
except Exception :
829
- _logger .warning (RESPONSE_EXTRACTOR_FAILURE_LOG_MESSAGE % traceback .format_exception (* sys .exc_info ()))
829
+ _logger .warning (RESPONSE_EXTRACTOR_FAILURE_LOG_MESSAGE , traceback .format_exception (* sys .exc_info ()))
830
830
831
831
832
832
def record_events_on_stop_iteration (self , transaction ):
@@ -842,7 +842,7 @@ def record_events_on_stop_iteration(self, transaction):
842
842
bedrock_attrs ["duration" ] = self ._nr_ft .duration * 1000
843
843
handle_chat_completion_event (transaction , bedrock_attrs )
844
844
except Exception :
845
- _logger .warning (RESPONSE_PROCESSING_FAILURE_LOG_MESSAGE % traceback .format_exception (* sys .exc_info ()))
845
+ _logger .warning (RESPONSE_PROCESSING_FAILURE_LOG_MESSAGE , traceback .format_exception (* sys .exc_info ()))
846
846
847
847
# Clear cached data as this can be very large.
848
848
self ._nr_bedrock_attrs .clear ()
@@ -878,7 +878,7 @@ def record_error(self, transaction, exc):
878
878
# Clear cached data as this can be very large.
879
879
error_attributes .clear ()
880
880
except Exception :
881
- _logger .warning (EXCEPTION_HANDLING_FAILURE_LOG_MESSAGE % traceback .format_exception (* sys .exc_info ()))
881
+ _logger .warning (EXCEPTION_HANDLING_FAILURE_LOG_MESSAGE , traceback .format_exception (* sys .exc_info ()))
882
882
883
883
884
884
def handle_embedding_event (transaction , bedrock_attrs ):
0 commit comments