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 May 16, 2024
1 parent 292b1ff commit 69d2818
Showing 1 changed file with 15 additions and 9 deletions.
24 changes: 15 additions & 9 deletions newrelic/hooks/external_botocore.py
Original file line number Diff line number Diff line change
Expand Up @@ -120,9 +120,11 @@ def create_chat_completion_message_event(
"request_id": request_id,
"span_id": span_id,
"trace_id": trace_id,
"token_count": settings.ai_monitoring.llm_token_count_callback(request_model, content)
if settings.ai_monitoring.llm_token_count_callback
else None,
"token_count": (
settings.ai_monitoring.llm_token_count_callback(request_model, content)
if settings.ai_monitoring.llm_token_count_callback
else None
),
"role": message.get("role"),
"completion_id": chat_completion_id,
"sequence": index,
Expand Down Expand Up @@ -156,9 +158,11 @@ def create_chat_completion_message_event(
"request_id": request_id,
"span_id": span_id,
"trace_id": trace_id,
"token_count": settings.ai_monitoring.llm_token_count_callback(request_model, content)
if settings.ai_monitoring.llm_token_count_callback
else None,
"token_count": (
settings.ai_monitoring.llm_token_count_callback(request_model, content)
if settings.ai_monitoring.llm_token_count_callback
else None
),
"role": message.get("role"),
"completion_id": chat_completion_id,
"sequence": index,
Expand Down Expand Up @@ -736,9 +740,11 @@ def handle_embedding_event(transaction, bedrock_attrs):
"id": embedding_id,
"span_id": span_id,
"trace_id": trace_id,
"token_count": settings.ai_monitoring.llm_token_count_callback(model, input)
if settings.ai_monitoring.llm_token_count_callback
else None,
"token_count": (
settings.ai_monitoring.llm_token_count_callback(model, input)
if settings.ai_monitoring.llm_token_count_callback
else None
),
"request_id": request_id,
"duration": bedrock_attrs.get("duration", None),
"request.model": model,
Expand Down

0 comments on commit 69d2818

Please sign in to comment.