Skip to content

Commit 944e58d

Browse files
committed
fix: forward agenthub_config to upstream factory on new-clients path
1 parent cfca287 commit 944e58d

4 files changed

Lines changed: 64 additions & 21 deletions

File tree

pyproject.toml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[project]
22
name = "uipath-langchain"
3-
version = "0.10.18"
3+
version = "0.10.19"
44
description = "Python SDK that enables developers to build and deploy LangGraph agents to the UiPath Cloud Platform"
55
readme = { file = "README.md", content-type = "text/markdown" }
66
requires-python = ">=3.11"
@@ -23,7 +23,7 @@ dependencies = [
2323
"langchain-mcp-adapters==0.2.1",
2424
"pillow>=12.1.1",
2525
"a2a-sdk>=0.2.0,<1.0.0",
26-
"uipath-langchain-client[openai]>=1.10.0,<1.11.0",
26+
"uipath-langchain-client[openai]>=1.10.1,<1.11.0",
2727
]
2828

2929
classifiers = [
@@ -40,21 +40,21 @@ maintainers = [
4040

4141
[project.optional-dependencies]
4242
anthropic = [
43-
"uipath-langchain-client[anthropic]>=1.10.0,<1.11.0",
43+
"uipath-langchain-client[anthropic]>=1.10.1,<1.11.0",
4444
]
4545
vertex = [
46-
"uipath-langchain-client[google]>=1.10.0,<1.11.0",
47-
"uipath-langchain-client[vertexai]>=1.10.0,<1.11.0",
46+
"uipath-langchain-client[google]>=1.10.1,<1.11.0",
47+
"uipath-langchain-client[vertexai]>=1.10.1,<1.11.0",
4848
]
4949
bedrock = [
50-
"uipath-langchain-client[bedrock]>=1.10.0,<1.11.0",
50+
"uipath-langchain-client[bedrock]>=1.10.1,<1.11.0",
5151
"boto3-stubs>=1.41.4",
5252
]
5353
fireworks = [
54-
"uipath-langchain-client[fireworks]>=1.10.0,<1.11.0",
54+
"uipath-langchain-client[fireworks]>=1.10.1,<1.11.0",
5555
]
5656
all = [
57-
"uipath-langchain-client[all]>=1.10.0,<1.11.0",
57+
"uipath-langchain-client[all]>=1.10.1,<1.11.0",
5858
]
5959

6060
[project.entry-points."uipath.middlewares"]

src/uipath_langchain/chat/chat_model_factory.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,6 @@ def get_chat_model(
4444
timeout: float | None = DEFAULT_TIMEOUT_SECONDS,
4545
max_retries: int | None = DEFAULT_MAX_RETRIES,
4646
callbacks: Callbacks = _UNSET,
47-
# Legacy-only arguments
4847
agenthub_config: str | None = None,
4948
use_new_llm_clients: bool = True,
5049
**kwargs: Any,
@@ -74,7 +73,7 @@ def get_chat_model(
7473
``BaseCallbackManager``. Forwarded only when explicitly set.
7574
Ignored by the legacy factory.
7675
agenthub_config: AgentHub config header value. Required by the legacy
77-
factory; ignored by the new factory.
76+
factory; forwarded to the new factory.
7877
use_new_llm_clients: Routes to the new ``uipath_langchain_client``
7978
factory when True (default). When False, routes to the legacy
8079
in-repo clients.
@@ -115,6 +114,7 @@ def get_chat_model(
115114
vendor_type=vendor_type,
116115
api_flavor=api_flavor,
117116
custom_class=custom_class,
117+
agenthub_config=agenthub_config,
118118
**optional_kwargs,
119119
**kwargs,
120120
)
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
"""Tests that ``chat_model_factory.get_chat_model`` forwards ``agenthub_config``
2+
to the upstream ``uipath_langchain_client`` factory on the new-clients path."""
3+
4+
from unittest.mock import MagicMock
5+
6+
import pytest
7+
8+
from uipath_langchain.chat.chat_model_factory import get_chat_model
9+
10+
11+
class TestForwardAgentHubConfig:
12+
def test_agenthub_config_forwarded_on_new_path(self, mocker):
13+
"""The kwarg the caller passes must reach the upstream factory verbatim."""
14+
upstream = mocker.patch(
15+
"uipath_langchain.chat.chat_model_factory.get_chat_model_factory",
16+
return_value=MagicMock(),
17+
)
18+
19+
get_chat_model(
20+
"gpt-4o",
21+
agenthub_config="agentsplayground",
22+
use_new_llm_clients=True,
23+
)
24+
25+
_, kwargs = upstream.call_args
26+
assert kwargs.get("agenthub_config") == "agentsplayground"
27+
28+
def test_agenthub_config_none_forwarded_on_new_path(self, mocker):
29+
"""Pass-through preserves None so upstream applies its own default."""
30+
upstream = mocker.patch(
31+
"uipath_langchain.chat.chat_model_factory.get_chat_model_factory",
32+
return_value=MagicMock(),
33+
)
34+
35+
get_chat_model("gpt-4o", use_new_llm_clients=True)
36+
37+
_, kwargs = upstream.call_args
38+
assert kwargs.get("agenthub_config") is None
39+
40+
def test_legacy_path_still_requires_agenthub_config(self, mocker):
41+
"""Legacy factory contract is unchanged: missing agenthub_config raises."""
42+
with pytest.raises(ValueError, match="agenthub_config is required"):
43+
get_chat_model("gpt-4o", use_new_llm_clients=False)

uv.lock

Lines changed: 11 additions & 11 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)