PATH:
opt
/
hc_python
/
lib
/
python3.12
/
site-packages
/
sentry_sdk
/
integrations
/
pydantic_ai
/
patches
/
__pycache__
� o0i� � �~ � d dl mZ d dlmZ d dlmZ d dlmZ ddl m Z mZ erd dlmZ d � Z y # e$ r ed� �w xY w)� )�wraps)� TYPE_CHECKING)�DidNotEnable)�modelszpydantic-ai not installed� ��ai_client_span�update_ai_client_span)�Anyc � �� t t d� rCt j j �t �� �fd�� } | t j _ yy)z� Patches model request execution to create AI client spans. In pydantic-ai, model requests are handled through the Model interface. We need to patch the request method on models to create spans. �Modelc � � �K � t |d | d � 5 } �| |g|��i |��� d { ��� }t ||� |cd d d � S 7 �# 1 sw Y y xY w�w)Nr )�self�messages�args�kwargs�span�result�original_requests ��h/opt/hc_python/lib/python3.12/site-packages/sentry_sdk/integrations/pydantic_ai/patches/model_request.py�wrapped_requestz-_patch_model_request.<locals>.wrapped_request sS �� �� � ��$��d�;�t�/��h�P��P��P�P��%�d�F�3�� <�;�P�� <�;�s) �A �A�?�A� A �A�A �A N)�hasattrr r �requestr )r r s @r �_patch_model_requestr sJ �� � �v�w��!�<�<�/�/�� �� � � !� � /����� � N)� functoolsr �typingr �sentry_sdk.integrationsr �pydantic_air �ImportError�spansr r r r � r r �<module>r# sE �� � � 0�4�"� :� ��/�� � 4� �2� 3�3�4�s �. �<
[-] graph_nodes.cpython-312.pyc
[edit]
[-] agent_run.cpython-312.pyc
[edit]
[+]
..
[-] tools.cpython-312.pyc
[edit]
[-] __init__.cpython-312.pyc
[edit]
[-] model_request.cpython-312.pyc
[edit]