mirror of
https://github.com/BerriAI/litellm.git
synced 2025-04-25 10:44:24 +00:00
fix(vertex_ai/common_utils.py): fix handling constructed url with default vertex config
This commit is contained in:
parent
b44b3bd36b
commit
06e69a414e
4 changed files with 98 additions and 17 deletions
|
@ -463,13 +463,8 @@ async def vertex_proxy_route(
|
|||
location=vertex_location,
|
||||
)
|
||||
|
||||
if vertex_credentials is None:
|
||||
raise Exception(
|
||||
f"No matching vertex credentials found, for project_id: {vertex_project}, location: {vertex_location}. No default_vertex_config set either."
|
||||
)
|
||||
|
||||
# Use headers from the incoming request if no vertex credentials are found
|
||||
if vertex_credentials.vertex_project is None:
|
||||
if vertex_credentials is None or vertex_credentials.vertex_project is None:
|
||||
headers = dict(request.headers) or {}
|
||||
verbose_proxy_logger.debug(
|
||||
"default_vertex_config not set, incoming request headers %s", headers
|
||||
|
@ -518,8 +513,8 @@ async def vertex_proxy_route(
|
|||
updated_url = construct_target_url(
|
||||
base_url=base_target_url,
|
||||
requested_route=encoded_endpoint,
|
||||
default_vertex_location=vertex_location,
|
||||
default_vertex_project=vertex_project,
|
||||
vertex_location=vertex_location,
|
||||
vertex_project=vertex_project,
|
||||
)
|
||||
# base_url = httpx.URL(base_target_url)
|
||||
# updated_url = base_url.copy_with(path=encoded_endpoint)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue