Skip to content

Commit 1dd5bb1

Browse files
authored
Fixes to embedding requests on agenthub (#2)
1 parent 0b8bcd1 commit 1dd5bb1

8 files changed

Lines changed: 34 additions & 33 deletions

File tree

CHANGELOG.md

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,17 @@
22

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

5-
## [1.0.1] - 2025-01-30
5+
## [1.0.2] - 2026-02-02
6+
7+
### Bug Fixes
8+
- Fixed endpoints on AgentHub Settings
9+
10+
## [1.0.1] - 2026-01-30
611

712
### Bug Fixes
813
- Map 400 Bad requests on S2S to 401 Unauthorized for better readability
914

10-
## [1.0.0] - 2025-01-30
15+
## [1.0.0] - 2026-01-30
1116

1217
### Official Release
1318
- First stable release of the UiPath LLM Client
@@ -21,7 +26,7 @@ All notable changes to `uipath_llm_client` (core package) will be documented in
2126
- Full async/sync support with streaming capabilities
2227
- Robust error handling and retry logic
2328

24-
## [0.3.x] - 2025-01-29
29+
## [0.3.x] - 2026-01-29
2530

2631
### Release
2732
- First public release accessible to test.pypi of the UiPath LLM Client
@@ -37,7 +42,7 @@ All notable changes to `uipath_llm_client` (core package) will be documented in
3742
- Added `UIPATH_LLM_BACKEND` environment variable for runtime backend switching
3843
- Improved error handling with `UiPathAPIError` hierarchy for specific HTTP status codes
3944

40-
## [0.2.x] - 2025-01-15
45+
## [0.2.x] - 2026-01-15
4146

4247
### Architecture
4348
- Split monolithic package into two separate packages:
@@ -56,7 +61,7 @@ All notable changes to `uipath_llm_client` (core package) will be documented in
5661
- Package structure changed; imports need to be updated from `uipath_llmgw_client` to `uipath_llm_client`
5762
- Settings classes renamed for consistency
5863

59-
## [0.1.x] - 2024-12-20
64+
## [0.1.x] - 2025-12-20
6065

6166
### Initial Development Release
6267
- Core HTTP client with authentication and request handling

packages/uipath_langchain_client/CHANGELOG.md

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,12 @@
22

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

5-
## [1.0.0] - 2025-01-30
5+
## [1.0.1] - 2026-02-02
6+
7+
### Bug Fix
8+
- Fixed Api Version on OpenAI Embeddings
9+
10+
## [1.0.0] - 2026-01-30
611

712
### Official Release
813
- First stable release of the UiPath LangChain Client
@@ -15,7 +20,7 @@ All notable changes to `uipath_langchain_client` will be documented in this file
1520
- Comprehensive support for chat completions, embeddings, and streaming
1621
- Seamless integration with both AgentHub and LLMGateway backends
1722

18-
## [0.3.x] - 2025-01-29
23+
## [0.3.x] - 2026-01-29
1924

2025
### Release
2126
- First public release of the UiPath LangChain Client
@@ -39,7 +44,7 @@ All notable changes to `uipath_langchain_client` will be documented in this file
3944
- Vertex AI
4045
- Azure AI
4146

42-
## [0.2.x] - 2025-01-15
47+
## [0.2.x] - 2026-01-15
4348

4449
### Architecture
4550
- Extracted from monolithic package into dedicated LangChain integration package
@@ -72,7 +77,7 @@ All notable changes to `uipath_langchain_client` will be documented in this file
7277
- Package renamed from internal module to `uipath_langchain_client`
7378
- Import paths changed; update imports accordingly
7479

75-
## [0.1.x] - 2024-12-20
80+
## [0.1.x] - 2025-12-20
7681

7782
### Initial Development Release
7883
- LangChain-compatible chat models wrapping UiPath LLM services
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
__title__ = "UiPath LangChain Client"
22
__description__ = "A Python client for interacting with UiPath's LLM services via LangChain."
3-
__version__ = "1.0.0"
3+
__version__ = "1.0.1"

packages/uipath_langchain_client/src/uipath_langchain_client/clients/openai/embeddings.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ class UiPathOpenAIEmbeddings(UiPathBaseLLMClient, OpenAIEmbeddings):
2222
client_type="passthrough",
2323
vendor_type="openai",
2424
freeze_base_url=True,
25+
api_version="2025-03-01-preview",
2526
)
2627

2728
# Override fields to avoid errors when instantiating the class
@@ -53,6 +54,7 @@ class UiPathAzureOpenAIEmbeddings(UiPathBaseLLMClient, AzureOpenAIEmbeddings):
5354
client_type="passthrough",
5455
vendor_type="openai",
5556
freeze_base_url=True,
57+
api_version="2025-03-01-preview",
5658
)
5759

5860
# Override fields to avoid errors when instantiating the class
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
__titile__ = "UiPath LLM Client"
22
__description__ = "A Python client for interacting with UiPath's LLM services."
3-
__version__ = "1.0.1"
3+
__version__ = "1.0.2"

src/uipath_llm_client/httpx_client.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,7 @@ def send(self, request: Request, *, stream: bool = False, **kwargs: Any) -> Resp
193193
Response with patched raise_for_status() that raises UiPath exceptions.
194194
"""
195195
if self._freeze_base_url:
196-
request.url = URL(self.base_url)
196+
request.url = URL(str(self.base_url).rstrip("/"))
197197
request.headers[self._streaming_header] = str(stream).lower()
198198
response = super().send(request, stream=stream, **kwargs)
199199
return patch_raise_for_status(response)
@@ -313,7 +313,7 @@ async def send(self, request: Request, *, stream: bool = False, **kwargs: Any) -
313313
Response with patched raise_for_status() that raises UiPath exceptions.
314314
"""
315315
if self._freeze_base_url:
316-
request.url = URL(self.base_url)
316+
request.url = URL(str(self.base_url).rstrip("/"))
317317
request.headers[self._streaming_header] = str(stream).lower()
318318
response = await super().send(request, stream=stream, **kwargs)
319319
return patch_raise_for_status(response)

src/uipath_llm_client/settings/agenthub/settings.py

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@
88
from pydantic import Field, SecretStr, model_validator
99
from pydantic_settings import SettingsConfigDict
1010
from uipath._cli._auth._auth_service import AuthService
11+
from uipath.utils import EndpointManager
1112

12-
from uipath_llm_client.settings.agenthub.utils import AgentHubEndpoints
1313
from uipath_llm_client.settings.base import UiPathAPIConfig, UiPathBaseSettings
1414

1515

@@ -99,13 +99,16 @@ def build_base_url(
9999
api_config: UiPathAPIConfig | None = None,
100100
) -> str:
101101
"""Build the base URL for API requests."""
102-
if api_config is not None and api_config.client_type == "normalized":
103-
url = f"{self.base_url}/{AgentHubEndpoints.NORMALIZED_ENDPOINT.value.format(api_type=api_config.api_type)}"
102+
assert model_name is not None
103+
assert api_config is not None
104+
if api_config.client_type == "normalized" and api_config.api_type == "completions":
105+
url = f"{self.base_url}/{EndpointManager.get_normalized_endpoint()}"
106+
elif api_config.client_type == "passthrough" and api_config.api_type == "embeddings":
107+
assert api_config.api_version is not None
108+
url = f"{self.base_url}/{EndpointManager.get_embeddings_endpoint().format(model=model_name, api_version=api_config.api_version)}"
104109
else:
105-
assert api_config is not None
106-
assert api_config.api_type is not None
107110
assert api_config.vendor_type is not None
108-
url = f"{self.base_url}/{AgentHubEndpoints.PASSTHROUGH_ENDPOINT.value.format(model=model_name, vendor=api_config.vendor_type, api_type=api_config.api_type)}"
111+
url = f"{self.base_url}/{EndpointManager.get_vendor_endpoint().format(model=model_name, vendor=api_config.vendor_type)}"
109112
return url
110113

111114
@override

src/uipath_llm_client/settings/agenthub/utils.py

Lines changed: 0 additions & 14 deletions
This file was deleted.

0 commit comments

Comments
 (0)