mirror of
https://github.com/BerriAI/litellm.git
synced 2026-09-11 22:51:28 +00:00
fix(vertex_llm_base.py): handle default vertex location
This commit is contained in:
parent
18f7316b08
commit
cc780ecf5a
1 changed files with 7 additions and 2 deletions
|
|
@ -135,15 +135,20 @@ class VertexBase:
|
|||
|
||||
return google_auth.default(scopes=scopes)
|
||||
|
||||
def get_default_vertex_location(self) -> str:
|
||||
return "us-central1"
|
||||
|
||||
def get_api_base(
|
||||
self, api_base: Optional[str], vertex_location: Optional[str]
|
||||
) -> str:
|
||||
if api_base:
|
||||
return api_base
|
||||
elif vertex_location and vertex_location == "global":
|
||||
elif vertex_location == "global":
|
||||
return "https://aiplatform.googleapis.com"
|
||||
else:
|
||||
elif vertex_location:
|
||||
return f"https://{vertex_location}-aiplatform.googleapis.com"
|
||||
else:
|
||||
return f"https://{self.get_default_vertex_location()}-aiplatform.googleapis.com"
|
||||
|
||||
def refresh_auth(self, credentials: Any) -> None:
|
||||
from google.auth.transport.requests import (
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue