Ë
    tPêj   ã                   ó  — U d Z ddlmZ ddlmZ ddlmZ ddlmZm	Z	 ddl
mZmZ ddlmZ ddlmZmZmZ dd	lmZ  G d
„ de«      ZdZeed<   dZeed<    ei «      Zeeeef      ed<   deeef   dz  deeef   fd„Zddœdedz  defd„Zy)zArize-Phoenix preset.é    )ÚMapping)ÚMappingProxyType)ÚFinal)ÚAliasChoicesÚField)ÚBaseSettingsÚSettingsConfigDict)ÚArizePhoenixLogger)ÚExporterOwnerÚExporterSpecÚOpenTelemetryV2Config)Úensure_mappersc                   óN   — e Zd ZU  edd¬«      Z ed edd«      ¬«      Zee	d<   y	)
Ú_PhoenixSettingsFÚignore)Úcase_sensitiveÚextraÚdefaultÚPHOENIX_PROJECT_NAMEÚPHOENIX_COLLECTOR_PROJECT_NAME)r   Úvalidation_aliasÚproject_nameN)
Ú__name__Ú
__module__Ú__qualname__r	   Úmodel_configr   r   r   ÚstrÚ__annotations__© ó    ún/home/oem/CyberBrain26-unified/.venv/lib/python3.12/site-packages/litellm/integrations/otel/presets/phoenix.pyr   r      s.   … Ù%°UÀ(ÔK€LáØÙ%Ð&<Ð>^Ó_ô€L�#ô r    r   zx-project-nameÚPHOENIX_PROJECT_HEADER)Úphoenix_project_name_overrideÚphoenix_project_nameÚ_PROJECT_KEYSÚ_NO_PROJECTÚauth_metadataNÚreturnc                 ó|   ‡ ‡— ‰ st         S t        ˆ ˆfd„t        D «       d«      }|rt        t        |i«      S t         S )aÎ  The per-request Phoenix project header for this key/team, if any.

    ``auth_metadata`` must be the key/team config the proxy resolved at auth
    (``user_api_key_auth_metadata``), never client-supplied request metadata:
    choosing the destination project is a data-exfiltration primitive, so a
    caller must not be able to name one. Returns an empty mapping when the key
    and team name no project, leaving the request on the env-configured default.
    c              3   ón   •K  — | ],  }‰j                  |«      xs d j                  «       xŠsŒ)‰–— Œ. y­w)Ú N)ÚgetÚstrip)Ú.0Úkeyr'   Ústrippeds     €€r!   ú	<genexpr>z*phoenix_project_headers.<locals>.<genexpr>6   s5   øè ø€ Òc�c¸M×<MÑ<MÈcÓ<RÒ<XÐVX×;_Ñ;_Ó;aÐ/a¨xÑ/aŒÑcùs   ƒ*5®5r+   )r&   Únextr%   r   r"   )r'   Úprojectr0   s   ` @r!   Úphoenix_project_headersr4   *   s@   ù€ ñ ÜÐÜÜcœ]ÔcØ
ó€Gñ CJÔÔ3°WÐ=Ó>ÐZÌ{ÐZr    )Úconfig_overridesr5   c           	      ó¬  — t        j                  «       }t        |d«      r|j                  nd }t	        «       j
                  }| xs
 t        «       }|j                  g |j                  ¢t        t        |d«      r|j                  nd|j                  |t        j                  ¬«      ‘t        |j                  d«      i |j                   ¥d|i¥dœ¬«      S )	NÚotlp_auth_headersÚprotocolÚ	otlp_http)ÚkindÚendpointÚheadersÚownerÚopeninferencezopeninference.project.name)Ú	exportersÚmapper_namesÚresource_attributes)Úupdate)Ú
_V1PhoenixÚget_arize_phoenix_configÚhasattrr7   r   r   r   Ú
model_copyr?   r   r8   r;   r   ÚARIZE_PHOENIXr   r@   rA   )r5   Úcfgr<   r   Úbases        r!   Úphoenix_presetrJ   <   sÓ   € ô ×4Ñ4Ó6€CÜ.5°cÐ;NÔ.O�S×*Ò*ÐUY€GÜ*Ó,×9Ñ9€LØ"Ò=Ô&;Ó&=€DØ�?‰?ðØ—‘ðäÜ)0°°jÔ)A˜ŸšÀ{Ø Ÿ\™\Ø#Ü'×5Ñ5ô	ðô +¨4×+<Ñ+<¸oÓNð$Ø×*Ñ*ð$à,¨lñ$ñ
ð ó ð r    )Ú__doc__Úcollections.abcr   Útypesr   Útypingr   Úpydanticr   r   Úpydantic_settingsr   r	   Ú(litellm.integrations.arize.arize_phoenixr
   rC   Ú&litellm.integrations.otel.model.configr   r   r   Ú'litellm.integrations.otel.presets.utilsr   r   r"   r   r%   r&   r   r4   rJ   r   r    r!   ú<module>rT      sÀ   ðÚ å #Ý "Ý ç (ß >õ÷ñ õ
 Cô�|ô ð !1Ð ˜Ó 0ð Q€ˆuÓ Pá(8¸Ó(<€ˆU�7˜3 ˜8Ñ$Ñ%Ó <ð[¨7°3¸°8Ñ+<¸tÑ+Cð [ÈÐPSÐUXÐPXÑHYó [ð( 6:òà+¨dÑ2ðð ôr    