
    gh                     `    S SK Jr  S SKrSSKJr  SSKJr  S SKJr  \(       a  S SKJ	r	J
r
  S rg)	    wrapsN   )agent_workflow_span)_capture_exception)TYPE_CHECKING)AnyCallablec                 0   ^  [        T 5      U 4S j5       nU$ )z
Wraps the agents.Runner.run methods to create a root span for the agent workflow runs.

Note agents.Runner.run_sync() is a wrapper around agents.Runner.run(),
so it does not need to be wrapped separately.
c                    >#    [         R                  " 5          U S   n[        U5         S n T" U 0 UD6I S h  vN nUsS S S 5        sS S S 5        $  N! [         aK  n[	        U5        [         R
                  " 5       nUb   UR                  c  UR                  S S S 5        US eS nAff = f! , (       d  f       O= f S S S 5        g ! , (       d  f       g = f7f)Nr   )
sentry_sdkisolation_scoper   	Exceptionr   get_current_span	timestamp__exit__)argskwargsagentresultexccurrent_spanoriginal_funcs         w/home/kali/devsecops-assessor/venv/lib/python3.13/site-packages/sentry_sdk/integrations/openai_agents/patches/runner.pywrapper$_create_run_wrapper.<locals>.wrapper   s     
 '')GE$U+(#0$#A&#AAF!	 ,+ *)
 B  (&s+ $.#>#>#@L#/L4J4J4R$--dD$?4'( ,++ *))sf   CCB,AAA	C
CA
B)AB$$B))B,,
B:	6C>	C
CCr   )r   r   s   ` r   _create_run_wrapperr      s#     =( (* N    )	functoolsr   r   spansr   utilsr   typingr   r	   r
   r    r   r   <module>r$      s      ' &  $r   