
     `il                    R    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
Z
ddZdS )    )annotations)TYPE_CHECKINGAnycast   )google_auth)Credentials
project_id
str | Nonereturntuple[Credentials, str]c                   	 ddl m} n"# t          $ r}t          d          |d }~ww xY wt	          j        dg          \  }}t          t          |          }|                     |                       | s|} | st          d          t          | t                    st          dt          |                      || 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_idz(Expected project_id to be a str but got )google.auth.transport.requestsr   ModuleNotFoundErrorRuntimeErrorr   defaultr   r   refresh
ValueError
isinstancestr	TypeErrortype)r
   r   errcredentialsloaded_project_ids        n/home/jaya/work/projects/VOICE-AGENT/VIET/agent-env/lib/python3.11/site-packages/anthropic/lib/vertex/_auth.py	load_authr       s   :::::::   m
 
	
 &1%8@A& & &"K" sK((K		""" '&
 97888j#&& WU4
CSCSUUVVV
""s   	 
(#(r   r	   Nonec                L    ddl m} |                      |                       d S )Nr   r   )r   r   r   )r   r   s     r   refresh_authr#   ,   s4    666666		"""""    N)r
   r   r   r   )r   r	   r   r!   )
__future__r   typingr   r   r   _extrasr   google.auth.credentialsr	   r    r#    r$   r   <module>r*      s    " " " " " " + + + + + + + + + + ! ! ! ! ! ! 4333333# # # #4# # # # # #r$   