From 31633f3ed4ef82243a02a56f316259b2764b1aa0 Mon Sep 17 00:00:00 2001 From: Liudmila Molkova Date: Mon, 3 Feb 2025 15:12:18 -0800 Subject: [PATCH] ruff --- .../opentelemetry/instrumentation/openai_v2/patch.py | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/instrumentation-genai/opentelemetry-instrumentation-openai-v2/src/opentelemetry/instrumentation/openai_v2/patch.py b/instrumentation-genai/opentelemetry-instrumentation-openai-v2/src/opentelemetry/instrumentation/openai_v2/patch.py index 71f2dff9df..072365abb7 100644 --- a/instrumentation-genai/opentelemetry-instrumentation-openai-v2/src/opentelemetry/instrumentation/openai_v2/patch.py +++ b/instrumentation-genai/opentelemetry-instrumentation-openai-v2/src/opentelemetry/instrumentation/openai_v2/patch.py @@ -74,9 +74,7 @@ def traced_method(wrapped, instance, args, kwargs): span, result, event_logger, capture_content ) for choice in getattr(result, "choices", []): - event_logger.emit( - choice_to_event(choice, capture_content) - ) + event_logger.emit(choice_to_event(choice, capture_content)) span.end() return result @@ -133,10 +131,8 @@ async def traced_method(wrapped, instance, args, kwargs): _set_response_attributes( span, result, event_logger, capture_content ) - for choice in getattr(result, "choices", []): - event_logger.emit( - choice_to_event(choice, capture_content) - ) + for choice in getattr(result, "choices", []): + event_logger.emit(choice_to_event(choice, capture_content)) span.end() return result