File tree Expand file tree Collapse file tree 1 file changed +9
-8
lines changed
packages/mistralai_gcp/src/mistralai_gcp Expand file tree Collapse file tree 1 file changed +9
-8
lines changed Original file line number Diff line number Diff line change @@ -46,16 +46,17 @@ def __init__(
4646 :param async_client: The Async HTTP client to use for all asynchronous methods
4747 :param retry_config: The retry configuration to use for all supported methods
4848 """
49-
50- credentials , loaded_project_id = google .auth .default (
51- scopes = ["https://www.googleapis.com/auth/cloud-platform" ],
52- )
53- credentials .refresh (google .auth .transport .requests .Request ())
5449
55- if not isinstance ( credentials , google . auth . credentials . Credentials ) :
56- raise models . SDKError (
57- "credentials must be an instance of google.auth.credentials.Credentials"
50+ if not access_token :
51+ credentials , loaded_project_id = google . auth . default (
52+ scopes = [ "https://www.googleapis.com/auth/cloud-platform" ],
5853 )
54+ credentials .refresh (google .auth .transport .requests .Request ())
55+
56+ if not isinstance (credentials , google .auth .credentials .Credentials ):
57+ raise models .SDKError (
58+ "credentials must be an instance of google.auth.credentials.Credentials"
59+ )
5960
6061 project_id = project_id or loaded_project_id
6162 if project_id is None :
You can’t perform that action at this time.
0 commit comments