Ë
    tPêjú  ã                   óX   — d Z ddlmZ ddlmZmZmZ ddlmZm	Z	 ddl
mZ  G d„ d«      Zy)	u  Weave (W&B) attribute mapper.

Weave consumes OpenInference + a small set of Weave-specific keys (display
name, thread id, output value). This mapper layers the latter on top of
OpenInference's vocabulary â€” compose ``["genai", "openinference", "weave"]``
to feed a Weave backend.
é    )ÚCallable)ÚAttributeMapÚ	AttrValueÚSpanData)ÚcollectÚjson_or_none)ÚLLMCallSpanDatac                   ó    — e Zd ZU dZd„ d„ dœZeeeege	dz  f   f   e
d<   dd„ iZeeeege	dz  f   f   e
d	<   d
edefd„Zed
edefd„«       Zy)ÚWeaveMapperz6Maps ``LLMCallSpanData`` to Weave's vendor attributes.c                 óh   — | j                   r%| j                  j                  › d| j                   › �S d S )Nú )Úrequest_modelÚ	operationÚvalue©Úds    úl/home/oem/CyberBrain26-unified/.venv/lib/python3.12/site-packages/litellm/integrations/otel/mappers/weave.pyú<lambda>zWeaveMapper.<lambda>   s/   € ÐTU×TcÒTc¨1¯;©;×+<Ñ+<Ð*=¸Q¸q¿¹Ð>OÐ(P€ Ðim€ ó    c                 ó6   — | j                   j                  xs d S ©N)ÚidentityÚcall_idr   s    r   r   zWeaveMapper.<lambda>   s   €  1§:¡:×#5Ñ#5Ò#=¸€ r   )zweave.display_namezweave.call_idNÚ_LLM_CALL_ATTRSzweave.outputc                 óZ   — | j                   rt        t        | j                   «      «      S d S r   )Úchoices_outr   Úlistr   s    r   r   zWeaveMapper.<lambda>   s   € ÀqÇ}Â}¤,¬t°A·M±MÓ/BÓ"C€ ÐZ^€ r   Ú_BLOB_ATTRSÚdataÚreturnc                 óD   — |t         d˜ x�\   | j                  |«      S  	 i S )N© )r	   Ú	_llm_call)Úselfr   s     r   ÚmapzWeaveMapper.map    s'   € ØÜ Õ"Ø—~‘~ dÓ+Ð+ð #àØ�	r   c                 ó^   — i t        | j                  |«      ¥t        | j                  |«      ¥S r   )r   r   r   )Úclsr   s     r   r#   zWeaveMapper._llm_call'   s4   € ð
Ü�c×)Ñ)¨4Ó0ð
ä�c—o‘o tÓ,ð
ð 	
r   )Ú__name__Ú
__module__Ú__qualname__Ú__doc__r   ÚdictÚstrr   r	   r   Ú__annotations__r   r   r   r%   Úclassmethodr#   r"   r   r   r   r      s¡   … Ù@ñ
 nÙ=ñ	Q€O�T˜#˜x¨Ð(9¸9ÀtÑ;KÐ(KÑLÐLÑMó ð 	Ñ^ðM€K��c˜8 _Ð$5°yÀ4Ñ7GÐ$GÑHÐHÑIó ð
˜ð  \ó ð ð
˜_ð 
°ò 
ó ñ
r   r   N)r+   Úcollections.abcr   Ú&litellm.integrations.otel.mappers.baser   r   r   Ú'litellm.integrations.otel.mappers.utilsr   r   Ú(litellm.integrations.otel.model.payloadsr	   r   r"   r   r   ú<module>r4      s%   ðñõ %ç TÑ Tß IÝ D÷
ò 
r   