o
    cÛ·iØ  ã                   @   s   d dl Z dd„ ZdS )é    Nc                    s   t  ˆ j¡‰‡ ‡fdd„}|S )z®
    A decorator that wraps the passed in function and logs exceptions instead of throwing them.

    @param func: The function to wrap
    @return: The wrapper function
    c               
      s\   zˆ | i |¤ŽW S  t y- } zˆ dˆ jt|ƒ¡ ˆ dt|ƒ¡ W Y d }~d S d }~ww )NzFailed to execute %s, error: %sz3Failed to set attributes for openai span, error: %s)Ú	ExceptionÚwarningÚ__name__Ústr)ÚargsÚkwargsÚe©ÚfuncÚlogger© úT/home/ubuntu/vllm_env/lib/python3.10/site-packages/opentelemetry/semconv_ai/utils.pyÚwrapper   s   ÿÿ€üzdont_throw.<locals>.wrapper)ÚloggingÚ	getLoggerÚ
__module__)r
   r   r   r	   r   Ú
dont_throw   s   r   )r   r   r   r   r   r   Ú<module>   s    