From 744d15e06860117c096efbaa556aa27f2703f3ba Mon Sep 17 00:00:00 2001 From: mubashir1osmani Date: Fri, 23 Jan 2026 16:16:33 -0500 Subject: [PATCH] remove imports from functions --- litellm/integrations/arize/_utils.py | 25 ++++++++----------------- 1 file changed, 8 insertions(+), 17 deletions(-) diff --git a/litellm/integrations/arize/_utils.py b/litellm/integrations/arize/_utils.py index 06485260a49..c271af77bf3 100644 --- a/litellm/integrations/arize/_utils.py +++ b/litellm/integrations/arize/_utils.py @@ -13,6 +13,14 @@ from litellm.types.utils import StandardLoggingPayload if TYPE_CHECKING: from opentelemetry.trace import Span +from litellm.integrations._types.open_inference import ( + MessageAttributes, + ImageAttributes, + SpanAttributes, + AudioAttributes, + EmbeddingAttributes, + OpenInferenceSpanKindValues +) class ArizeOTELAttributes(BaseLLMObsOTELAttributes): @@ -20,11 +28,6 @@ class ArizeOTELAttributes(BaseLLMObsOTELAttributes): @staticmethod @override def set_messages(span: "Span", kwargs: Dict[str, Any]): - from litellm.integrations._types.open_inference import ( - MessageAttributes, - SpanAttributes, - ) - messages = kwargs.get("messages") # for /chat/completions @@ -90,13 +93,6 @@ class ArizeOTELAttributes(BaseLLMObsOTELAttributes): def _set_response_attributes(span: "Span", response_obj): """Helper to set response output and token usage attributes on span.""" - from litellm.integrations._types.open_inference import ( - ImageAttributes, - MessageAttributes, - SpanAttributes, - AudioAttributes, - EmbeddingAttributes, - ) if not hasattr(response_obj, "get"): return @@ -243,7 +239,6 @@ def _infer_open_inference_span_kind(call_type: Optional[str]) -> str: """ Map LiteLLM call types to OpenInference span kinds. """ - from litellm.integrations._types.open_inference import OpenInferenceSpanKindValues if not call_type: return OpenInferenceSpanKindValues.UNKNOWN.value @@ -297,10 +292,6 @@ def _set_tool_attributes( span: "Span", optional_tools: Optional[list], metadata_tools: Optional[list] ): """set tool attributes on span from optional_params or tool call metadata""" - from litellm.integrations._types.open_inference import ( - SpanAttributes, - ) - if optional_tools: for idx, tool in enumerate(optional_tools): if not isinstance(tool, dict):