From 8217435da1c1c54bac5d1e60ccb991b80d82d6b3 Mon Sep 17 00:00:00 2001 From: Vlad Cimpeanu Date: Wed, 24 Jun 2026 12:32:27 +0300 Subject: [PATCH 1/2] feat(platform): support per-service URL overrides for local dev Use resolve_service_url to redirect requests to a local server when UIPATH_SERVICE_URL_ is set, falling back to the platform base URL otherwise. Co-Authored-By: Claude Opus 4.8 (1M context) --- .../llm_client/settings/platform/settings.py | 21 +++++++++--- tests/core/features/settings/test_platform.py | 34 +++++++++++++++++++ 2 files changed, 50 insertions(+), 5 deletions(-) diff --git a/src/uipath/llm_client/settings/platform/settings.py b/src/uipath/llm_client/settings/platform/settings.py index 7c4f63c7..278dc810 100644 --- a/src/uipath/llm_client/settings/platform/settings.py +++ b/src/uipath/llm_client/settings/platform/settings.py @@ -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, @@ -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 @@ -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 @@ -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( diff --git a/tests/core/features/settings/test_platform.py b/tests/core/features/settings/test_platform.py index 69297e35..e64cfbc9 100644 --- a/tests/core/features/settings/test_platform.py +++ b/tests/core/features/settings/test_platform.py @@ -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_ 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 ): From 5db8491346c20f5bca34b089d9fc0cbd84f4563d Mon Sep 17 00:00:00 2001 From: Vlad Cimpeanu Date: Fri, 3 Jul 2026 14:27:41 +0300 Subject: [PATCH 2/2] chore: bump versions to 1.16.0 for service URL overrides release Core 1.15.1 -> 1.16.0, langchain 1.15.2 -> 1.16.0 (re-synced after the uipath-platform bump took 1.15.1/1.15.2 on main). Co-Authored-By: Claude Fable 5 --- CHANGELOG.md | 5 +++++ packages/uipath_langchain_client/CHANGELOG.md | 5 +++++ packages/uipath_langchain_client/pyproject.toml | 2 +- .../src/uipath_langchain_client/__version__.py | 2 +- src/uipath/llm_client/__version__.py | 2 +- 5 files changed, 13 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 908f0196..c3c0c651 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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_` 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 diff --git a/packages/uipath_langchain_client/CHANGELOG.md b/packages/uipath_langchain_client/CHANGELOG.md index 00001c5f..e55a3e8a 100644 --- a/packages/uipath_langchain_client/CHANGELOG.md +++ b/packages/uipath_langchain_client/CHANGELOG.md @@ -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_` env vars). Bumped the `uipath-llm-client` floor to `>=1.16.0`. + ## [1.15.2] - 2026-07-03 ### Changed diff --git a/packages/uipath_langchain_client/pyproject.toml b/packages/uipath_langchain_client/pyproject.toml index 457022fe..44ef969e 100644 --- a/packages/uipath_langchain_client/pyproject.toml +++ b/packages/uipath_langchain_client/pyproject.toml @@ -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] diff --git a/packages/uipath_langchain_client/src/uipath_langchain_client/__version__.py b/packages/uipath_langchain_client/src/uipath_langchain_client/__version__.py index 6bf3d01f..f8d61b09 100644 --- a/packages/uipath_langchain_client/src/uipath_langchain_client/__version__.py +++ b/packages/uipath_langchain_client/src/uipath_langchain_client/__version__.py @@ -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" diff --git a/src/uipath/llm_client/__version__.py b/src/uipath/llm_client/__version__.py index 25d09d9f..8dc06440 100644 --- a/src/uipath/llm_client/__version__.py +++ b/src/uipath/llm_client/__version__.py @@ -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"