From 3e6a79600cc07ed58b8b226da77c800c45944c39 Mon Sep 17 00:00:00 2001 From: lievan Date: Fri, 24 Jan 2025 10:18:35 -0500 Subject: [PATCH] remove unneeded default --- ddtrace/contrib/internal/openai/utils.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ddtrace/contrib/internal/openai/utils.py b/ddtrace/contrib/internal/openai/utils.py index d526f96b30..0217b1e61d 100644 --- a/ddtrace/contrib/internal/openai/utils.py +++ b/ddtrace/contrib/internal/openai/utils.py @@ -89,7 +89,7 @@ def _extract_token_chunk(self, chunk): """Attempt to extract the token chunk (last chunk in the stream) from the streamed response.""" if not self._dd_span._get_ctx_item("_dd.auto_extract_token_chunk"): return - choices = getattr(chunk, "choices", None) + choices = getattr(chunk, "choices") if not choices: return choice = choices[0] @@ -155,7 +155,7 @@ async def _extract_token_chunk(self, chunk): """Attempt to extract the token chunk (last chunk in the stream) from the streamed response.""" if not self._dd_span._get_ctx_item("_dd.auto_extract_token_chunk"): return - choices = getattr(chunk, "choices", None) + choices = getattr(chunk, "choices") if not choices: return choice = choices[0]