o
    Zh)                     @   sh   d Z ddlmZ ddlmZmZ ddlmZ ddee deeef fdd	Z	ddee dd
fddZ
dS )zUtilities to init Vertex AI.    )metadata)OptionalTuple)
ClientInfoNmodulereturnc                 C   sL   zt d}W n t jy   d}Y nw | r| d|  n|}|d| fS )zReturns a custom user agent header.

    Args:
        module (Optional[str]):
            Optional. The module for a custom user agent header.
    Returns:
        Tuple[str, str]
    zlangchain-google-communityz0.0.0-zlangchain-google-community/)r   versionZPackageNotFoundError)r   Zlangchain_versionclient_library_version r   X/var/www/html/lang_env/lib/python3.10/site-packages/langchain_google_community/_utils.pyget_user_agent	   s   	r   r   c                 C   s   t | \}}t||dS )zReturns a client info object with a custom user agent header.

    Args:
        module (Optional[str]):
            Optional. The module for a custom user agent header.
    Returns:
        google.api_core.gapic_v1.client_info.ClientInfo
    )r
   
user_agent)r   r   )r   r
   r   r   r   r   get_client_info   s
   	r   )N)__doc__	importlibr   typingr   r   Z$google.api_core.gapic_v1.client_infor   strr   r   r   r   r   r   <module>   s     