Ë
    tPêj7  ã                   ó‚   — d Z ddlmZmZ ddlmZ ddlmZ ddlm	Z	m
Z
 edd„«       Zededd	fd
„«       Zdde	de	ddfd„Zy)uš  SDK-free entrypoints for proxy-core call sites (auth, â€¦).

Proxy code may run without the OpenTelemetry SDK installed, so it must not import
``litellm.integrations.otel.logger`` (which imports the SDK at module scope) at
module load. These wrappers import it lazily and no-op when the SDK is absent or
V2 is not the active logger â€” so a call site can wrap a request phase or seed
identity unconditionally.
é    )ÚCallableÚIterator)Úcontextmanager)Úcache)ÚAnyÚFinalÚreturnc                  ó^   — 	 ddl m}  | j                  | j                  fS # t        $ r Y yw xY w)aE  Resolve the SDK-backed hooks once and cache the outcome, absence included.

    CPython never caches a failed import, so without this memoization every call
    site re-attempts the import on each request; when the OTel SDK is not installed
    that re-scans ``sys.path`` and contends on the import lock on the hot path.
    r   ©ÚloggerN)Úlitellm.integrations.otelr   Ú	ExceptionÚ
phase_spanÚseed_request_identityr   s    úf/home/oem/CyberBrain26-unified/.venv/lib/python3.12/site-packages/litellm/integrations/otel/runtime.pyÚ_otel_runtimer      s7   € ðÝ4ð ×Ñ˜v×;Ñ;Ð<Ð<øô ò Ùðús   ‚   	,«,ÚnamezIterator[Any]c              #   óv   K  — t        «       }|€d–— y |d   | «      5 }|–— ddd«       y# 1 sw Y   yxY w­w)zºRun a request phase inside a live active span so its DB/service calls nest.

    Yields ``None`` (a plain no-op) when the OTel SDK is unavailable or V2 is not
    the active logger.
    Nr   ©r   )r   ÚruntimeÚspans      r   r   r      sE   è ø€ ô #“_€GØ€ØŠ
ØØ	ˆ�‰�DÓ	ð ˜TØŠ
÷÷ ñ üs   ‚9Ÿ-¤	9­6²9NÚuser_api_key_dictÚmodelc                 ó8   — t        «       }|€y |d   | |¬«       y)zFSeed request-identity Baggage at the auth boundary (no-op without V2).Né   )r   r   )r   r   r   s      r   r   r   .   s"   € ä"“_€GØ€ØØ€GˆA�JÐ ¨Ö.ó    )r	   z7tuple[Callable[[str], Any], Callable[..., None]] | None)N)Ú__doc__Úcollections.abcr   r   Ú
contextlibr   Ú	functoolsr   Útypingr   r   r   Ústrr   r   © r   r   ú<module>r$      sh   ðñ÷ /Ý %Ý ß ð ò=ó ð=ð ð�Sð ˜_ò ó ðñ/¨Sð /¸ð /Èô /r   