Skip to content

Commit 421a9f3

Browse files
author
Paweł Kędzia
committed
Remove urllib dependency and simplify endpoint URL construction by manually concatenating host and path, trimming slashes.
1 parent 9261190 commit 421a9f3

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

llm_router_api/endpoints/httprequest.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@
2121
"""
2222

2323
import json
24-
import urllib
2524

2625
import requests
2726
import datetime
@@ -121,7 +120,6 @@ def call_http_request(
121120
)
122121

123122
full_url = self._prepare_full_url_ep(ep_url)
124-
125123
if not headers:
126124
headers = {"Content-Type": "application/json"}
127125

@@ -234,7 +232,10 @@ def stream_response(
234232
# Private helpers
235233
# ------------------------------------------------------------------
236234
def _prepare_full_url_ep(self, ep_url: str) -> str:
237-
return urllib.parse.urljoin(self._endpoint.api_model.api_host, ep_url)
235+
full_url = (
236+
self._endpoint.api_model.api_host.rstrip("/") + "/" + ep_url.lstrip("/")
237+
)
238+
return full_url
238239

239240
def _call_for_each_user_message(
240241
self,

0 commit comments

Comments
 (0)