Skip to content

Commit

Permalink
fix(vertex): also refresh auth if there is no token
Browse files Browse the repository at this point in the history
  • Loading branch information
RobertCraigie committed Jul 17, 2024
1 parent 4ff067f commit 4a8d02d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/anthropic/lib/vertex/_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ def _ensure_access_token(self) -> str:
if not self.project_id:
self.project_id = project_id

if self.credentials.expired:
if self.credentials.expired or not self.credentials.token:
refresh_auth(self.credentials)

if not self.credentials.token:
Expand Down Expand Up @@ -330,7 +330,7 @@ async def _ensure_access_token(self) -> str:
if not self.project_id:
self.project_id = project_id

if self.credentials.expired:
if self.credentials.expired or not self.credentials.token:
await asyncify(refresh_auth)(self.credentials)

if not self.credentials.token:
Expand Down

0 comments on commit 4a8d02d

Please sign in to comment.