Skip to content

Commit

Permalink
[Mega-Linter] Apply linters fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
hmstepanek authored and github-actions[bot] committed Dec 20, 2023
1 parent 1c1f408 commit 9f4018a
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions newrelic/hooks/external_botocore.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down Expand Up @@ -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:
Expand Down Expand Up @@ -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:
Expand Down Expand Up @@ -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:
Expand Down Expand Up @@ -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:
Expand All @@ -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(
Expand All @@ -441,7 +441,7 @@ def wrap_bedrock_runtime_invoke_model(wrapped, instance, args, kwargs):
ft.duration,
True,
trace_id,
span_id
span_id,
)

finally:
Expand Down Expand Up @@ -498,7 +498,7 @@ def handle_embedding_event(
duration,
is_error,
trace_id,
span_id
span_id,
):
embedding_id = str(uuid.uuid4())

Expand Down Expand Up @@ -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", "")
Expand Down

0 comments on commit 9f4018a

Please sign in to comment.