Team Ai
Datasetpublic

codekingpro/portable-devtools

sourceHugging Faceupdated 5mo agoView on Hugging Face
1likes14kdownloads
middleware.cpython-313.pyc27 linesDownload Raw Back to __pycache__
1�

2��jT���Sr"SS5rg)z:Middleware for making it easier to do distributed tracing.c�,�\rSrSrSrSrS\4SjrSrg)�TracingMiddleware�a?Middleware for propagating distributed tracing context using LangSmith.3 4This middleware checks for the `'langsmith-trace'` header and propagates the5tracing context if present. It does not start new traces by default.6 7Designed to work with ASGI applications.8 9Attributes:10    app: The ASGI application being wrapped.11c�(�SSKJn X lXlg)zInitialize the middleware.�)�tracing_contextN)�langsmith.run_helpersr�
_with_headers�app)�selfr12rs   �ZD:\code\apps\devtools\python\user_packages\Python313\site-packages\langsmith/middleware.py�__init__�TracingMiddleware.__init__s��9�,�����scopec��# �USS:XaMSU;aG[US5nSU;a3URUS9 URXU5IShv�N SSS5 gURXU5IShv�N gN(!,(df   g=fN7f)a�Handle incoming requests and propagate tracing context if applicable.13 14Args:15    scope: A dict containing ASGI connection scope.16    receive (callable): An awaitable callable for receiving ASGI events.17    send (callable): An awaitable callable for sending ASGI events.18 19If the request is HTTP and contains the `'langsmith-trace'` header,20it propagates the tracing context before calling the wrapped application.21 22Otherwise, it calls the application directly without modifying the context.23�type�http�headersslangsmith-trace)�parentN)�dictr	r24)rr�receive�sendrs     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	�4A6�625B�B	)r	r26N)	�__name__�27__module__�__qualname__�__firstlineno__�__doc__r
rr�__static_attributes__�rrrrs��	��-�D�-rrN)rrr!rr�<module>r"s��@�&-�&-r
codekingpro/portable-devtools · Team Ai