Uname : Linux premium36.web-hosting.com 4.18.0-553.44.1.lve.el8.x86_64 #1 SMP Thu Mar 13 14:29:12 UTC 2025 x86_64
Soft : LiteSpeed
Ip : 198.54.115.237
Port : 443
~
/
opt
/
hc_python
/
lib
/
python3.12
/
site-packages
/
sentry_sdk
/
integrations
/
pydantic_ai
/
__pycache__
[ HOME ]
Exec
Submit
utils.cpython-312.pyc
� w�/i � � � d dl Z d dlmZ d dlmZ d dlmZ d dlmZ d dl m Z mZ d dlm Z e rd dlmZmZ ed g � � Zdd�Zd� Zd � Zd� Zd� Zd� Zd� Zd� Zd� Zd� Zy)� N)� ContextVar)�SPANDATA)�should_send_default_pii)�set_span_errored)�event_from_exception�safe_serialize)� TYPE_CHECKING)�Any�Optional�pydantic_ai_agent_context_stack)�defaultc � � t j � j � }|j | |d�� t j |� y)zCPush an agent context onto the stack along with its streaming flag.)�agent�is_streamingN)�_agent_context_stack�get�copy�append�set)r r �stacks �X/opt/hc_python/lib/python3.12/site-packages/sentry_sdk/integrations/pydantic_ai/utils.py� push_agentr s: � � !�$�$�&�+�+�-�E� �L�L�5�,�?�@����U�#� c � � t j � j � } | r| j � t j | � y)z$Pop an agent context from the stack.N)r r r �popr �r s r � pop_agentr s5 � � !�$�$�&�+�+�-�E�� � � �����U�#r c �@ � t j � } | r| d d S y)z0Get the current agent from the contextvar stack.���r N�r r r s r �get_current_agentr! $ s'