§
    y›jÌ
  ã                  óÌ   — d dl mZ d dlmZ d dlmZmZ d dlmZ d dl	Z	d dl
mZmZ d dlmZ  e¦   «         ZdZeej        v sJ ‚ e	j        d	¬
¦  «        Zdd„Zdd„Z	 	 d d!d„ZdS )"é    )Úannotations)ÚAny)ÚSpanÚset_span_in_context)ÚTraceContextTextMapPropagatorN)ÚATTRIBUTES_MESSAGE_KEYÚATTRIBUTES_SPAN_TYPE_KEY)Úattach_contextÚtraceparentÚfeedback)Úcustom_scope_suffixÚspanúSpan | logfire.LogfireSpanÚreturnÚstrc                óÖ   — t          | t          ¦  «        r| }n| j        }|sJ ‚t          |¦  «        }i }t                               ||¦  «         |                     t          d¦  «        S )zGGet a string representing the span context to use for annotating spans.Ú )Ú
isinstancer   Ú_spanr   ÚTRACEPARENT_PROPAGATORÚinjectÚgetÚTRACEPARENT_NAME)r   Ú	real_spanÚcontextÚcarriers       ú]/home/lighthouse/health/venv/lib/python3.11/site-packages/logfire/experimental/annotations.pyÚget_traceparentr      sm   € õ �$�ÑÔð Øˆ	ˆ	à”Jˆ	ØÐÐÐÝ! )Ñ,Ô,€GØ €GÝ×!Ò! '¨7Ñ3Ô3Ð3Ø�;Š;Õ'¨Ñ,Ô,Ð,ó    Ú	span_nameÚmessageÚ
attributesúdict[str, Any]ÚNonec           	     ó¶   — t          t          | it          ¬¦  «        5  t          j        |fi |¤t
          |t          di¤Ž ddd¦  «         dS # 1 swxY w Y   dS )zUCreate a span of kind 'annotation' as a child of the span with the given traceparent.)Ú
propagatorÚ
annotationN)r
   r   r   Úfeedback_logfireÚinfor   r	   )r   r    r!   r"   s       r   Úraw_annotate_spanr*   !   s»   € å	Õ)¨;Ð7ÕDZÐ	[Ñ	[Ô	[ð 
ð 
ÝÔØð	
ð 	
àð	
õ '¨Ý(¨,ðð	
ð 	
ð 	
ð
ð 
ð 
ñ 
ô 
ð 
ð 
ð 
ð 
ð 
ð 
ð 
øøøð 
ð 
ð 
ð 
ð 
ð 
s   ž#AÁAÁAÚnameÚvalueúint | float | bool | strÚcommentú
str | NoneÚextraúdict[str, Any] | Nonec                ó�   — d|||i}|r||vsJ ‚|                      |¦  «         |r||d<   t          | d|› �d|› d|›�|¦  «         dS )a  Attach feedback to a span.

    This is a more structured version of `raw_annotate_span`
    with special attributes recognized by the Logfire UI.

    Args:
        traceparent: The traceparent string.
        name: The name of the evaluation.
        value: The value of the evaluation.
            Numbers are interpreted as scores, strings as labels, and booleans as assertions.
        comment: An optional reason for the evaluation.
        extra: Optional additional attributes to include in the span.
    zlogfire.feedback.namezlogfire.feedback.commentz
feedback: z = N)Úupdater*   )r   r+   r,   r.   r0   r"   s         r   Úrecord_feedbackr4   .   s’   € ð( #:¸4ÀÀuÐ!M€Jàð !Ø˜5Ð Ð Ð Ð Ø×Ò˜%Ñ Ô Ð àð 9Ø18ˆ
Ð-Ñ.åØØ�TÐÐØ'�TÐ'Ð'˜eÐ'Ð'Øñ	ô ð ð ð r   )r   r   r   r   )
r   r   r    r   r!   r   r"   r#   r   r$   )NN)r   r   r+   r   r,   r-   r.   r/   r0   r1   r   r$   )Ú
__future__r   Útypingr   Úopentelemetry.tracer   r   Ú,opentelemetry.trace.propagation.tracecontextr   ÚlogfireÚlogfire._internal.constantsr   r	   Úlogfire.propagater
   r   r   ÚfieldsÚwith_settingsr(   r   r*   r4   © r   r   ú<module>r?      s  ðØ "Ð "Ð "Ð "Ð "Ð "à Ð Ð Ð Ð Ð à 9Ð 9Ð 9Ð 9Ð 9Ð 9Ð 9Ð 9Ø VÐ VÐ VÐ VÐ VÐ Và €€€Ø XÐ XÐ XÐ XÐ XÐ XÐ XÐ XØ ,Ð ,Ð ,Ð ,Ð ,Ð ,à6Ð6Ñ8Ô8Ð Ø Ð ØÐ1Ô8Ð8Ð8Ð8Ð8à(�7Ô(¸ZÐHÑHÔHÐ ð-ð -ð -ð -ð

ð 

ð 

ð 

ð" Ø#'ð"ð "ð "ð "ð "ð "ð "r   