From 9f4018a57ba33f51e44a542ebd20b6accb5e4c48 Mon Sep 17 00:00:00 2001 From: hmstepanek Date: Wed, 20 Dec 2023 22:03:40 +0000 Subject: [PATCH] [Mega-Linter] Apply linters fixes --- newrelic/hooks/external_botocore.py | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/newrelic/hooks/external_botocore.py b/newrelic/hooks/external_botocore.py index d2f97b817c..1f954ba0a6 100644 --- a/newrelic/hooks/external_botocore.py +++ b/newrelic/hooks/external_botocore.py @@ -144,7 +144,7 @@ def create_chat_completion_message_event( "response.model": request_model, "vendor": "bedrock", "ingest_source": "Python", - "is_response": True + "is_response": True, } transaction.record_custom_event("LlmChatCompletionMessage", chat_completion_message_dict) @@ -246,7 +246,7 @@ def extract_bedrock_claude_model(request_body, response_body=None): chat_completion_summary_dict = { "request.max_tokens": request_body.get("max_tokens_to_sample", ""), "request.temperature": request_body.get("temperature", ""), - "response.number_of_messages": len(input_message_list) + "response.number_of_messages": len(input_message_list), } if response_body: @@ -274,7 +274,7 @@ def extract_bedrock_llama_model(request_body, response_body=None): chat_completion_summary_dict = { "request.max_tokens": request_body.get("max_gen_len", ""), "request.temperature": request_body.get("temperature", ""), - "response.number_of_messages": len(input_message_list) + "response.number_of_messages": len(input_message_list), } if response_body: @@ -308,7 +308,7 @@ def extract_bedrock_cohere_model(request_body, response_body=None): chat_completion_summary_dict = { "request.max_tokens": request_body.get("max_tokens", ""), "request.temperature": request_body.get("temperature", ""), - "response.number_of_messages": len(input_message_list) + "response.number_of_messages": len(input_message_list), } if response_body: @@ -403,7 +403,7 @@ def wrap_bedrock_runtime_invoke_model(wrapped, instance, args, kwargs): notice_error_attributes = { "http.statusCode": error_attributes["http.statusCode"], "error.message": error_attributes["error.message"], - "error.code": error_attributes["error.code"] + "error.code": error_attributes["error.code"], } if is_embedding: @@ -427,7 +427,7 @@ def wrap_bedrock_runtime_invoke_model(wrapped, instance, args, kwargs): ft.duration, True, trace_id, - span_id + span_id, ) else: handle_chat_completion_event( @@ -441,7 +441,7 @@ def wrap_bedrock_runtime_invoke_model(wrapped, instance, args, kwargs): ft.duration, True, trace_id, - span_id + span_id, ) finally: @@ -498,7 +498,7 @@ def handle_embedding_event( duration, is_error, trace_id, - span_id + span_id, ): embedding_id = str(uuid.uuid4()) @@ -543,7 +543,7 @@ def handle_chat_completion_event( duration, is_error, trace_id, - span_id + span_id, ): custom_attrs_dict = transaction._custom_params conversation_id = custom_attrs_dict.get("conversation_id", "")