관리-도구
편집 파일: utils.cpython-38.pyc
U �Mg� � @ sH d dl mZ erd dl mZ d dlmZ d dlmZ dd� Zdd� Zd S ) � )� TYPE_CHECKING)�Any)�Span)�loggerc C s� t | d�rLz | �� W S tk rJ } zt�d|� | W Y �S d }~X Y nX t| t�r�t| �dkrnt| d �S tdd� | D ��S t| t �r�dd� | � � D �S | S ) N� model_dumpz+Could not convert pydantic data to JSON: %s� r c s s | ]}t |�V qd S �N��_normalize_data)�.0�x� r �A/opt/hc_python/lib/python3.8/site-packages/sentry_sdk/ai/utils.py� <genexpr> s z"_normalize_data.<locals>.<genexpr>c S s i | ]\}}|t |��qS r r )r �k�vr r r � <dictcomp> s z#_normalize_data.<locals>.<dictcomp>)�hasattrr � Exceptionr �warning� isinstance�list�lenr �dict�items)�data�er r r r s r c C s t |�}| �||� d S r )r �set_data)�span�key�value� normalizedr r r �set_data_normalized s r"