+
    ~jz                        ^ RI Ht ^ RIt^ RIt^ RIt^ RIHt ^RIHt Rt	Rt
RtRtR	tR
tRtR R ltR R ltRR R lltR# )    )annotationsN)api)__version__z&https://agent-gateway.livekit.cloud/v1z.https://agent-gateway.staging.livekit.cloud/v1z
User-AgentzX-LiveKit-Room-IDzX-LiveKit-Job-IDzX-LiveKit-Inference-ProviderzX-LiveKit-Inference-Priorityc                   V ^8  d   QhRR/# )   returnstr )formats   "t/Users/mitch_tango/dev/rabbit-r1-livekit/agent/.venv/lib/python3.14/site-packages/livekit/agents/inference/_utils.py__annotate__r      s     ! !3 !    c                     \         P                  P                  R4      p V '       d   V # \         P                  P                  RR4      pRV9   d   \        # \        # )zGet the default inference URL based on the environment.

Priority:
1. LIVEKIT_INFERENCE_URL if set
2. If LIVEKIT_URL contains '.staging.livekit.cloud', use staging gateway
3. Otherwise, use production gateway
LIVEKIT_INFERENCE_URLLIVEKIT_URL z.staging.livekit.cloud)osenvirongetSTAGING_INFERENCE_URLDEFAULT_INFERENCE_URL)inference_urllivekit_urls     r   get_default_inference_urlr      sH     JJNN#:;M**..3K;.$$  r   c                   V ^8  d   QhRR/# )r   r   zdict[str, str]r
   )r   s   "r   r   r   (   s      ~ r   c                    \         R\         R\        P                  ! 4        R2/p  ^RIHp V! 4       pVP                  P                  P                  '       d(   VP                  P                  P                  V \        &   VP                  P                  '       d   VP                  P                  V \        &   V #   \         d     T # i ; i)zBuild identification headers for inference requests.

Always includes User-Agent with SDK version and Python version.
Includes X-LiveKit-Room-ID and X-LiveKit-Job-ID when running
inside a job context (omitted in console mode or tests).
zLiveKit Agents/z	 (python ))get_job_context)HEADER_USER_AGENTr   platformpython_versionjobr   roomsidHEADER_ROOM_IDidHEADER_JOB_IDRuntimeError)headersr   ctxs      r   get_inference_headersr+   (   s     	ok])HD[D[D]C^^_`G	)77<<&)ggll&6&6GN#77:::%(WWZZGM" N  Ns   2B= AB= B= =CCc               (    V ^8  d   QhRRRRRRRR/# )r   api_keyz
str | None
api_secretttlfloatr   r	   r
   )r   s   "r   r   r   ?   s)        % Z] r   c                   \         P                  P                  R R7      p\         P                  ! W4      P	                  R4      P                  V4      P                  \        P                  ! VR7      4      P                  4       # )T)performagent)seconds)
r   access_tokenInferenceGrantsAccessTokenwith_identitywith_inference_grantswith_ttldatetime	timedeltato_jwt)r-   r.   r/   grants   &&& r   create_access_tokenr?   ?   s]    ,,T,:E,	w			u	%	($$S1	2	r   )iX  )
__future__r   r;   r   r    livekitr   versionr   r   r   r   r%   r'   HEADER_INFERENCE_PROVIDERHEADER_INFERENCE_PRIORITYr   r+   r?   r
   r   r   <module>rE      sS    "  	   !@ H   $": : !&. r   