o
    î6Wjì  ã                   @  sT   d dl mZ d dlmZmZmZ ddlmZ erd dlm	Z	 dd
d„Z
ddd„ZdS )é    )Úannotations)ÚTYPE_CHECKINGÚAnyÚcasté   )Úgoogle_auth)ÚCredentialsÚ
project_idú
str | NoneÚreturnútuple[Credentials, str]c              
   C  sx   zddl m} W n ty } ztdƒ|‚d }~ww tjdgd�\}}tt|ƒ}| |ƒ ¡ | s2|} | s8t	dƒ‚|| fS )Nr   ©ÚRequestz^Could not import google.auth, you need to install the SDK with `pip install anthropic[vertex]`z.https://www.googleapis.com/auth/cloud-platform)ÚscopeszCould not resolve project_id)
Úgoogle.auth.transport.requestsr   ÚModuleNotFoundErrorÚRuntimeErrorr   Údefaultr   r   ÚrefreshÚ
ValueError)r	   r   ÚerrÚcredentialsÚloaded_project_id© r   úi/home/esfera/Documents/content_generation/venv/lib/python3.10/site-packages/anthropic/lib/vertex/_auth.pyÚ	load_auth   s(   ÿþ€ÿ
ÿ
r   r   r   ÚNonec                 C  s   ddl m} |  |ƒ ¡ d S )Nr   r   )r   r   r   )r   r   r   r   r   Úrefresh_auth)   s   r   N)r	   r
   r   r   )r   r   r   r   )Ú
__future__r   Útypingr   r   r   Ú_extrasr   Úgoogle.auth.credentialsr   r   r   r   r   r   r   Ú<module>   s    

