ó
    üÞ jT  ã                   ó   • S r  " S S5      rg)z:Middleware for making it easier to do distributed tracing.c                   ó,   • \ rS rSrSrS rS\4S jrSrg)ÚTracingMiddlewareé   a?  Middleware for propagating distributed tracing context using LangSmith.

This middleware checks for the `'langsmith-trace'` header and propagates the
tracing context if present. It does not start new traces by default.

Designed to work with ASGI applications.

Attributes:
    app: The ASGI application being wrapped.
c                 ó(   • SSK Jn  X l        Xl        g)zInitialize the middleware.é    )Útracing_contextN)Úlangsmith.run_helpersr   Ú_with_headersÚapp)Úselfr
   r   s      ÚN/var/www/html/gaurav/venv/lib/python3.13/site-packages/langsmith/middleware.pyÚ__init__ÚTracingMiddleware.__init__   s   € å9à,ÔØ�ó    Úscopec              ƒ   ó  #   • US   S:X  aM  SU;   aG  [        US   5      nSU;   a3  U R                  US9   U R                  XU5      I Sh  v•N   SSS5        gU R                  XU5      I Sh  v•N   g N(! , (       d  f       g= f N7f)aê  Handle incoming requests and propagate tracing context if applicable.

Args:
    scope: A dict containing ASGI connection scope.
    receive (callable): An awaitable callable for receiving ASGI events.
    send (callable): An awaitable callable for sending ASGI events.

If the request is HTTP and contains the `'langsmith-trace'` header,
it propagates the tracing context before calling the wrapped application.

Otherwise, it calls the application directly without modifying the context.
ÚtypeÚhttpÚheaderss   langsmith-trace)ÚparentN)Údictr	   r
   )r   r   ÚreceiveÚsendr   s        r   Ú__call__ÚTracingMiddleware.__call__   s†   é € ð �‰=˜FÓ" y°EÓ'9Ü˜5 Ñ+Ó,ˆGØ! WÓ,Ø×'Ñ'¨wÐ'Ò7ØŸ(™( 5°4Ó8×8Ð8÷ 8àØ�h‰h�u tÓ,×,Ñ,ñ 9÷ 8Ô7àúÙ,ùs:   ‚3B	µA6ÁA4ÁA6ÁB	Á.BÁ/B	Á4A6Á6
BÂ B	)r	   r
   N)	Ú__name__Ú
__module__Ú__qualname__Ú__firstlineno__Ú__doc__r   r   r   Ú__static_attributes__© r   r   r   r      s   † ñ	òð- D÷ -r   r   N)r   r   r!   r   r   Ú<module>r"      s   ðÙ @÷&-ò &-r   