Skip to content

Commit e6b413b

Browse files
author
Paweł Kędzia
committed
Replace manual endpoint URL assembly with get_proper_endpoint helper and remove unused chat_ep call.
1 parent 35c49ca commit e6b413b

File tree

1 file changed

+5
-9
lines changed

1 file changed

+5
-9
lines changed

llm_router_api/endpoints/endpoint_i.py

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -712,12 +712,12 @@ def run_ep(
712712

713713
use_streaming = bool((params or {}).get("stream", False))
714714

715-
if simple_proxy and not use_streaming:
716-
ep_pref = ""
717-
if self.add_api_prefix and DEFAULT_API_PREFIX:
718-
ep_pref = DEFAULT_API_PREFIX.strip()
719-
ep_url = ep_pref.strip("/") + "/" + self.name.lstrip("/")
715+
# Prepare proper endpoint url
716+
ep_url = self._api_type_dispatcher.get_proper_endpoint(
717+
api_type=api_model_provider.api_type, endpoint_url=self.name
718+
)
720719

720+
if simple_proxy and not use_streaming:
721721
return self._return_response_or_rerun(
722722
api_model_provider=api_model_provider,
723723
ep_url=ep_url,
@@ -732,10 +732,6 @@ def run_ep(
732732
self.logger.debug(f" -> prompt_name: {prompt_name}")
733733
self.logger.debug(f" -> prompt_str: {str(prompt_str)[:40]}...")
734734

735-
ep_url = self._api_type_dispatcher.chat_ep(
736-
api_type=api_model_provider.api_type
737-
)
738-
739735
if api_model_provider.api_type in ["openai"]:
740736
params = self._filter_params_to_acceptable(
741737
api_type=api_model_provider.api_type, params=params

0 commit comments

Comments
 (0)