
    j9	                        d dl Zd dlZd dlZd dlZd dlZd dlZd dlmZmZ d dl	Z	ddl
mZ  ej                  e      Zej                  deeef   fd       Zej                  deeef   fd       Zej                  deeef   fd       Zy)	    N)AnyDict   )environmentreturnc            	          t        j                         t        j                         t        j                         dj	                  d t        d      D              d} t               }| j                  |       | S )N c              3   b   K   | ]'  }t        j                  t        j                         ) y w)N)randomchoicestringascii_letters).0_s     /Users/manta/Documents/Projects/TheRoad-I1/backend/.venv/lib/python3.12/site-packages/opik/error_tracking/environment_details.py	<genexpr>z'collect_context_once.<locals>.<genexpr>   s      T8afmmF,@,@A8s   -/	   )pidospython_version_verbose
session_id)r   get_pidget_osget_python_version_verbosejoinrange_get_installed_packages_detailsupdate)resultinstalled_packages_detailss     r   collect_context_oncer!      sd     ""$  ""-"H"H"JggT5QR8TT	F "A!B
MM,-M    c            
      Z   t        j                         t        j                         t        j                  t        j
                         t        j                         t        j                         t        j                         t        j                         t        j                         d	} | S )z
    Some of the tags may be affected by the configurations set by the user
    after opik has been already imported, so we need to collect this data
    as late as possible.
    )	os_typepython_versionreleasejupytercolab
aws_lambdagithub_actionspytestinstallation_type)r   get_os_typeget_python_versionopik__version__
in_jupyterin_colabin_aws_lambdain_github_actions	in_pytestget_installation_type)r   s    r   collect_tags_oncer7      s{     **,%88:##))+%%'!//1%779'')(>>@
F Mr"   c                      g d} i }| D ]%  }	 t         j                  j                  |      ||<   ' |S # t        $ r Y 5w xY w)N)pydanticlitellmopenaizopenai-agents	anthropicz
google-adkzgoogle-genai	langchainzlangchain-communityzlangchain-anthropiczlangchain-openaizlangchain-google-vertexaizlangchain-google-genaicrewaidspyzllama-indexzhaystack-ai)	importlibmetadataversion	Exception)DISTRIBUTION_NAMESr   distribution_names      r   r   r   6   s[    & F
 0	(1(:(:(B(BCT(UF$% 0 M  		s   "3	??)importlib.metadatar@   logging	functoolsr   r   typingr   r   r/   r	   r   	getLogger__name__LOGGER	lru_cachestrr!   r7   r    r"   r   <module>rP      s            			8	$ d38n   4S>  , c3h  r"   