Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@

All notable changes to `uipath_llm_client` (core package) will be documented in this file.

## [1.16.0] - 2026-07-03

### Added
- Per-service URL overrides for local development. `build_base_url` now consults `resolve_service_url(endpoint_path)` (from `uipath.platform.common`) before constructing the final URL. When a `UIPATH_SERVICE_URL_<SERVICE>` env var is set (e.g. `UIPATH_SERVICE_URL_AGENTHUB=http://localhost:8080`), requests are redirected to that local server with the org/tenant and service prefix stripped. Without an override, behaviour is unchanged — the URL is still `{base_url}/{endpoint_path}`.

## [1.15.1] - 2026-07-03

### Changed
Expand Down
5 changes: 5 additions & 0 deletions packages/uipath_langchain_client/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@

All notable changes to `uipath_langchain_client` will be documented in this file.

## [1.16.0] - 2026-07-03

### Changed
- Picks up core `uipath-llm-client` 1.16.0, which adds per-service URL overrides for local development (`UIPATH_SERVICE_URL_<SERVICE>` env vars). Bumped the `uipath-llm-client` floor to `>=1.16.0`.

## [1.15.2] - 2026-07-03

### Changed
Expand Down
2 changes: 1 addition & 1 deletion packages/uipath_langchain_client/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ readme = "README.md"
requires-python = ">=3.11"
dependencies = [
"langchain>=1.2.15,<2.0.0",
"uipath-llm-client>=1.15.1,<2.0.0",
"uipath-llm-client>=1.16.0,<2.0.0",
]

[project.optional-dependencies]
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
__title__ = "UiPath LangChain Client"
__description__ = "A Python client for interacting with UiPath's LLM services via LangChain."
__version__ = "1.15.2"
__version__ = "1.16.0"
2 changes: 1 addition & 1 deletion src/uipath/llm_client/__version__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
__title__ = "UiPath LLM Client"
__description__ = "A Python client for interacting with UiPath's LLM services."
__version__ = "1.15.1"
__version__ = "1.16.0"
21 changes: 16 additions & 5 deletions src/uipath/llm_client/settings/platform/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
from pydantic import Field, SecretStr, model_validator
from typing_extensions import override
from uipath.platform import UiPath
from uipath.platform.common import EndpointManager
from uipath.platform.common import EndpointManager, resolve_service_url
from uipath.platform.common._config import UiPathConfig
from uipath.platform.common.constants import (
ENV_BASE_URL,
Expand Down Expand Up @@ -121,7 +121,7 @@ def build_base_url(
api_config.routing_mode == RoutingMode.NORMALIZED
and api_config.api_type == ApiType.COMPLETIONS
):
url = f"{self.base_url}/{EndpointManager.get_normalized_endpoint()}"
endpoint_path = EndpointManager.get_normalized_endpoint()
elif (
api_config.routing_mode == RoutingMode.NORMALIZED
and api_config.api_type == ApiType.EMBEDDINGS
Expand All @@ -135,7 +135,12 @@ def build_base_url(
and api_config.api_type == ApiType.COMPLETIONS
):
endpoint = EndpointManager.get_vendor_endpoint()
url = f"{self.base_url}/{self._format_endpoint(endpoint, model=model_name, vendor=api_config.vendor_type, api_version=api_config.api_version)}"
endpoint_path = self._format_endpoint(
endpoint,
model=model_name,
vendor=api_config.vendor_type,
api_version=api_config.api_version,
)
elif (
api_config.routing_mode == RoutingMode.PASSTHROUGH
and api_config.api_type == ApiType.EMBEDDINGS
Expand All @@ -146,10 +151,16 @@ def build_base_url(
f"got vendor_type='{api_config.vendor_type}'."
)
endpoint = EndpointManager.get_embeddings_endpoint()
url = f"{self.base_url}/{self._format_endpoint(endpoint, model=model_name, api_version=api_config.api_version)}"
endpoint_path = self._format_endpoint(
endpoint, model=model_name, api_version=api_config.api_version
)
else:
raise ValueError(f"Invalid API configuration: {api_config}")
return url

override_url = resolve_service_url(endpoint_path)
if override_url:
return override_url
return f"{self.base_url}/{endpoint_path}"

@override
def build_auth_headers(
Expand Down
34 changes: 34 additions & 0 deletions tests/core/features/settings/test_platform.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,40 @@ def test_build_base_url_normalized(
)
assert "agenthub_/llm/api/chat/completions" in url

def test_build_base_url_uses_service_override_when_set(
self, platform_env_vars, mock_platform_auth, normalized_api_config
):
"""A UIPATH_SERVICE_URL_<SERVICE> override redirects to the local server,
stripping the org/tenant and service prefix."""
env = {
**platform_env_vars,
"UIPATH_SERVICE_URL_AGENTHUB": "http://localhost:8080",
}
with patch.dict(os.environ, env, clear=True):
settings = PlatformSettings()
url = settings.build_base_url(
model_name="gpt-4o",
api_config=normalized_api_config,
)
assert url == "http://localhost:8080/llm/api/chat/completions"

def test_build_base_url_ignores_unrelated_service_override(
self, platform_env_vars, mock_platform_auth, normalized_api_config
):
"""An override for a different service must not affect the built URL."""
env = {
**platform_env_vars,
"UIPATH_SERVICE_URL_ORCHESTRATOR": "http://localhost:8080",
}
with patch.dict(os.environ, env, clear=True):
settings = PlatformSettings()
url = settings.build_base_url(
model_name="gpt-4o",
api_config=normalized_api_config,
)
assert "localhost" not in url
assert "agenthub_/llm/api/chat/completions" in url

def test_build_auth_headers_omits_agenthub_config_by_default(
self, platform_env_vars, mock_platform_auth
):
Expand Down
Loading