PATH:
opt
/
hc_python
/
lib
/
python3.12
/
site-packages
/
sentry_sdk
/
integrations
/
pydantic_ai
/
spans
/
__pycache__
� o0i � �r � d dl Z d dlmZmZ d dlmZ ddlmZ ddlm Z m Z d dlmZ erd dlm Z mZ dd �Zd � Zy)� N)�OP�SPANDATA)�safe_serialize� )�SPAN_ORIGIN)�_set_agent_data�_should_send_prompts)� TYPE_CHECKING)�Any�Optionalc � � t j t j d| � �t �� }|j t j d� |j t j |� |j t j | � t ||� t � r+|�)|j t j t |� � |S )a# Create a span for tool execution. Args: tool_name: The name of the tool being executed tool_args: The arguments passed to the tool agent: The agent executing the tool tool_type: The type of tool ("function" for regular tools, "mcp" for MCP services) z execute_tool )�op�name�origin�execute_tool)� sentry_sdk� start_spanr �GEN_AI_EXECUTE_TOOLr �set_datar �GEN_AI_OPERATION_NAME�GEN_AI_TOOL_TYPE�GEN_AI_TOOL_NAMEr r �GEN_AI_TOOL_INPUTr )� tool_name� tool_args�agent� tool_type�spans �e/opt/hc_python/lib/python3.12/site-packages/sentry_sdk/integrations/pydantic_ai/spans/execute_tool.py�execute_tool_spanr s� � � � � � �!�!��Y�K� (���D� �M�M�(�0�0�.�A��M�M�(�+�+�Y�7��M�M�(�+�+�Y�7��D�%� ���)�"7�� � �h�0�0�.��2K�L��K� c �x � | syt � r-|�*| j t j t |� � yyy)z-Update the execute tool span with the result.N)r r r �GEN_AI_TOOL_OUTPUTr )r �results r �update_execute_tool_spanr% * s6 � � ����&�"4�� � �h�1�1�>�&�3I�J� #5�r! )�function)r �sentry_sdk.constsr r �sentry_sdk.utilsr �constsr �utilsr r �typingr r r r r% � r! r �<module>r- s( �� � *� +� � 9� ��$��8Kr!
[-] invoke_agent.cpython-312.pyc
[edit]
[+]
..
[-] __init__.cpython-312.pyc
[edit]
[-] ai_client.cpython-312.pyc
[edit]
[-] execute_tool.cpython-312.pyc
[edit]