File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -82,7 +82,7 @@ def get_proxy_target(model, path):
82
82
else :
83
83
return f"https://{ location } -aiplatform.googleapis.com/v1/projects/{ project_id } /locations/{ location } /{ model } :rawPredict"
84
84
85
- def get_header (model , request , path ):
85
+ def get_headers (model , request , path ):
86
86
path_no_prefix = f"/{ path .lstrip ('/' )} " .removeprefix (API_ROUTE_PREFIX )
87
87
target_url = get_proxy_target (model , path_no_prefix )
88
88
@@ -159,12 +159,12 @@ async def handle_proxy(request: Request, path: str):
159
159
conversion_target = "anthropic"
160
160
161
161
# Build safe target URL
162
- target_url , headers = get_header (model , request , path )
162
+ target_url , request_headers = get_headers (model , request , path )
163
163
async with httpx .AsyncClient () as client :
164
164
response = await client .request (
165
165
method = request .method ,
166
166
url = target_url ,
167
- headers = headers ,
167
+ headers = request_headers ,
168
168
content = json .dumps (content_json ),
169
169
params = request .query_params ,
170
170
timeout = 5.0 ,
You can’t perform that action at this time.
0 commit comments