Move the telemetry util import to be more lazy

This commit is contained in:
Ashwin Bharambe 2024-12-05 21:51:47 -08:00
parent 392be5f6dc
commit 66d8f4ffd1

View file

@ -12,8 +12,6 @@ from typing import Any, AsyncGenerator, Callable, Type, TypeVar
from pydantic import BaseModel
from llama_stack.providers.utils.telemetry import tracing
T = TypeVar("T")
@ -41,6 +39,8 @@ def trace_protocol(cls: Type[T]) -> Type[T]:
"""
def trace_method(method: Callable) -> Callable:
from llama_stack.providers.utils.telemetry import tracing
is_async = asyncio.iscoroutinefunction(method)
is_async_gen = inspect.isasyncgenfunction(method)