Ë
    uPêjH  ã            	       óö   — U d dl Z d dlmZ d dlmZ d dlmZ d dlZd dlm	Z	 dZ
eed<    edd	d
dœ«      Zeeeeedf   f      ed<   dZeed<   dededz  fd„Zdededefd„Zdefd„Z	 ddedededz  defd„Zy)é    N)ÚMapping)ÚMappingProxyType)ÚFinal)Ú	ModelInfoé@   Ú"OPENAI_MAX_PROMPT_CACHE_KEY_LENGTH)ÚmaxÚxhighÚhigh)r
   r   )ÚminimalÚlow)r	   r
   r   .Ú_EFFORT_DEGRADATION_CHAINÚnoneÚ_THINKING_OFFÚuser_idÚreturnc                 ó4   — | €y t        | «      d t         xs d S ©N)Ústrr   )r   s    ú{/home/oem/CyberBrain26-unified/.venv/lib/python3.12/site-packages/litellm/llms/anthropic/experimental_pass_through/utils.pyÚprompt_cache_key_from_user_idr      s"   € Ø€ØÜˆw‹<Ð;Ô;Ð<ÒDÀÐDó    ÚmodelÚcustom_llm_providerc                 óN   — t        |t        «      r| j                  |› d�«      S | S )zXThe id the provider itself knows, for reporting back to the caller in ``message_start``.ú/)Ú
isinstancer   Úremoveprefix©r   r   s     r   Úlocal_model_namer       s-   € ä<FÐGZÔ\_Ô<`ˆ5×ÑÐ!4Ð 5°QÐ7Ó8ÐkÐfkÐkr   c                  ót   — t         j                  xs' t        j                  dd«      j	                  «       dk(  S )zLCheck whether the default 'summary: detailed' injection is enabled (opt-in).ÚLITELLM_REASONING_AUTO_SUMMARYÚfalseÚtrue)ÚlitellmÚreasoning_auto_summaryÚosÚgetenvÚlower© r   r   Ú!is_reasoning_auto_summary_enabledr+       s/   € ä×)Ñ)Òs¬R¯Y©YÐ7WÐY`Ó-a×-gÑ-gÓ-iÐmsÑ-sÐsr   Úeffortc                 ó  ‡— t         j                  | «      }|€| S ddlm} ddlm} 	  |||¬«      } ||d¬«      Š‰s|d   S t        d„ ‰D «       «      }t        ˆfd	„g |¢|¢­D «       |d   «      S # t        $ r |d   cY S w xY w)
a@  Lower a tier the deployment does not accept to the nearest one it does, leaving others alone.

    The accepted set is resolved by the same owner that answers ``/model_group/info``, so a level
    the proxy advertises is a level this path forwards.

    A deployment that refuses every step of a chain falls back to an accepted level read off that
    same set rather than to an assumed one, since an entry naming its levels outright can exclude
    the tiers the per-level flags treat as unconditional. ``none`` is never that fallback and is
    never degraded to, being an off switch rather than a tier; an always-on-thinking model is
    handled where the thinking block is built. A deployment accepting no tier at all keeps the
    chain's floor, which is what every deployment degraded to before there was anything to ask.
    r   )Ú#resolve_supported_reasoning_efforts)Úget_model_infor   éÿÿÿÿT)Údeployment_is_mappedc              3   ó4   K  — | ]  }|t         k7  sŒ|–— Œ y ­wr   )r   )Ú.0Úlevels     r   ú	<genexpr>z3normalize_reasoning_effort_value.<locals>.<genexpr>F   s   è ø€ Ò!Y¨EÀ%Ì=ÓBX¤%Ñ!Yùs   ‚‘c              3   ó,   •K  — | ]  }|‰v sŒ|–— Œ y ­wr   r*   )r3   r4   Ú	supporteds     €r   r5   z3normalize_reasoning_effort_value.<locals>.<genexpr>G   s   øè ø€ ÒT˜5ÀÈ)ÒAS”ÑTùs   ƒ	�)	r   ÚgetÚ0litellm.router_utils.reasoning_effort_capabilityr.   Úlitellm.utilsr/   Ú	ExceptionÚtupleÚnext)	r,   r   r   Úchainr.   r/   Ú
model_infoÚaccepted_tiersr7   s	           @r   Ú normalize_reasoning_effort_valuerA   %   s£   ø€ ô" -×0Ñ0°Ó8€EØ€}ØˆådÝ,ðÙ'5¸EÐWjÔ'kˆ
ñ ;¸:Ð\`Ôa€IÙØ�R‰yÐä!Ñ!Y°YÔ!YÓY€NÜÓTÐ$= eÐ$=¨nÑ$=ÔTÐV[Ð\^ÑV_Ó`Ð`øô ò Ø�R‰yÒðús   ¨
A2 Á2BÂBr   )r'   Úcollections.abcr   Útypesr   Útypingr   r%   Úlitellm.types.utilsr   r   Ú__annotations__r   r   r<   r   Úobjectr   r    Úboolr+   rA   r*   r   r   ú<module>rI      sã   ðÜ 	Ý #Ý "Ý ã Ý )à,.Ð " EÓ .áBRà'Ø"Ø%ñóCÐ ˜5 ¨¨e°C¸°H©oÐ)=Ñ!>Ñ?ó ð €ˆuÓ ðE¨6ð E°c¸D±jó Eðl˜Cð l°fð lÀó lð
t¨4ó tð '+ñ"aØð"aàð"að ˜t™ð"að 	ô	"ar   