fix(main.py): support env var 'VERTEX_PROJECT' and 'VERTEX_LOCATION'

This commit is contained in:
Krrish Dholakia 2024-05-10 07:57:41 -07:00
parent a671046b45
commit 9a31f3d3d9
3 changed files with 47 additions and 3 deletions

View file

@ -2960,17 +2960,20 @@ def embedding(
or optional_params.pop("vertex_ai_project", None)
or litellm.vertex_project
or get_secret("VERTEXAI_PROJECT")
or get_secret("VERTEX_PROJECT")
)
vertex_ai_location = (
optional_params.pop("vertex_location", None)
or optional_params.pop("vertex_ai_location", None)
or litellm.vertex_location
or get_secret("VERTEXAI_LOCATION")
or get_secret("VERTEX_LOCATION")
)
vertex_credentials = (
optional_params.pop("vertex_credentials", None)
or optional_params.pop("vertex_ai_credentials", None)
or get_secret("VERTEXAI_CREDENTIALS")
or get_secret("VERTEX_CREDENTIALS")
)
response = vertex_ai.embedding(