Skip to content

Commit 9a4bed5

Browse files
Apply suggestions from code review
Co-authored-by: Jordan Stephens <jordan@stephens.io>
1 parent cdb9474 commit 9a4bed5

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/api/routers/vertex.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ def get_proxy_target(model, path):
8282
else:
8383
return f"https://{location}-aiplatform.googleapis.com/v1/projects/{project_id}/locations/{location}/{model}:rawPredict"
8484

85-
def get_header(model, request, path):
85+
def get_headers(model, request, path):
8686
path_no_prefix = f"/{path.lstrip('/')}".removeprefix(API_ROUTE_PREFIX)
8787
target_url = get_proxy_target(model, path_no_prefix)
8888

@@ -159,12 +159,12 @@ async def handle_proxy(request: Request, path: str):
159159
conversion_target = "anthropic"
160160

161161
# Build safe target URL
162-
target_url, headers = get_header(model, request, path)
162+
target_url, request_headers = get_headers(model, request, path)
163163
async with httpx.AsyncClient() as client:
164164
response = await client.request(
165165
method=request.method,
166166
url=target_url,
167-
headers=headers,
167+
headers=request_headers,
168168
content=json.dumps(content_json),
169169
params=request.query_params,
170170
timeout=5.0,

0 commit comments

Comments
 (0)