Skip to content

Commit 8184fd7

Browse files
authored
chore: drop _AgentHubConfigDefaultMixin (#836)
1 parent b64e3f1 commit 8184fd7

8 files changed

Lines changed: 35 additions & 103 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.19"
3+
version = "0.10.20"
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.1,<1.11.0",
26+
"uipath-langchain-client[openai]>=1.11.0,<1.12.0",
2727
]
2828

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

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

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

src/uipath_langchain/chat/_settings.py

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

src/uipath_langchain/chat/bedrock.py

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -12,22 +12,18 @@
1212
UiPathChatBedrockConverse as _UpstreamUiPathChatBedrockConverse,
1313
)
1414

15-
from ._settings import _AgentHubConfigDefaultMixin
16-
1715
DEFAULT_MODEL_NAME = "anthropic.claude-haiku-4-5-20251001-v1:0"
1816

1917

2018
def _default_factory() -> str:
2119
return os.getenv("UIPATH_MODEL_NAME", DEFAULT_MODEL_NAME)
2220

2321

24-
class UiPathChatBedrock(_AgentHubConfigDefaultMixin, _UpstreamUiPathChatBedrock):
22+
class UiPathChatBedrock(_UpstreamUiPathChatBedrock):
2523
pass
2624

2725

28-
class UiPathChatAnthropicBedrock(
29-
_AgentHubConfigDefaultMixin, _UpstreamUiPathChatAnthropicBedrock
30-
):
26+
class UiPathChatAnthropicBedrock(_UpstreamUiPathChatAnthropicBedrock):
3127
pass
3228

3329

@@ -36,9 +32,7 @@ class UiPathChatAnthropicBedrock(
3632
_cls.model_rebuild(force=True)
3733

3834

39-
class UiPathChatBedrockConverse(
40-
_AgentHubConfigDefaultMixin, _UpstreamUiPathChatBedrockConverse
41-
):
35+
class UiPathChatBedrockConverse(_UpstreamUiPathChatBedrockConverse):
4236
@model_validator(mode="before")
4337
@classmethod
4438
def _inject_default_model(cls, values: Any) -> Any:

src/uipath_langchain/chat/models.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
UiPathChat as _UpstreamUiPathChat,
55
)
66

7-
from ._settings import _AgentHubConfigDefaultMixin
87
from .openai import UiPathAzureChatOpenAI, UiPathChatOpenAI
98

109
DEFAULT_MODEL_NAME = "gpt-4.1-mini-2025-04-14"
@@ -14,7 +13,7 @@ def _default_factory() -> str:
1413
return os.getenv("UIPATH_MODEL_NAME", DEFAULT_MODEL_NAME)
1514

1615

17-
class UiPathChat(_AgentHubConfigDefaultMixin, _UpstreamUiPathChat):
16+
class UiPathChat(_UpstreamUiPathChat):
1817
pass
1918

2019

src/uipath_langchain/chat/openai.py

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,22 +7,18 @@
77
UiPathChatOpenAI as _UpstreamUiPathChatOpenAI,
88
)
99

10-
from ._settings import _AgentHubConfigDefaultMixin
11-
1210
DEFAULT_MODEL_NAME = "gpt-4.1-mini-2025-04-14"
1311

1412

1513
def _default_factory() -> str:
1614
return os.getenv("UIPATH_MODEL_NAME", DEFAULT_MODEL_NAME)
1715

1816

19-
class UiPathChatOpenAI(_AgentHubConfigDefaultMixin, _UpstreamUiPathChatOpenAI):
17+
class UiPathChatOpenAI(_UpstreamUiPathChatOpenAI):
2018
pass
2119

2220

23-
class UiPathAzureChatOpenAI(
24-
_AgentHubConfigDefaultMixin, _UpstreamUiPathAzureChatOpenAI
25-
):
21+
class UiPathAzureChatOpenAI(_UpstreamUiPathAzureChatOpenAI):
2622
pass
2723

2824

src/uipath_langchain/chat/vertex.py

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,18 +4,14 @@
44
UiPathChatGoogleGenerativeAI as _UpstreamUiPathChatGoogleGenerativeAI,
55
)
66

7-
from ._settings import _AgentHubConfigDefaultMixin
8-
97
DEFAULT_MODEL_NAME = "gemini-2.5-flash"
108

119

1210
def _default_factory() -> str:
1311
return os.getenv("UIPATH_MODEL_NAME", DEFAULT_MODEL_NAME)
1412

1513

16-
class UiPathChatGoogleGenerativeAI(
17-
_AgentHubConfigDefaultMixin, _UpstreamUiPathChatGoogleGenerativeAI
18-
):
14+
class UiPathChatGoogleGenerativeAI(_UpstreamUiPathChatGoogleGenerativeAI):
1915
pass
2016

2117

tests/chat/test_agenthub_config_default.py

Lines changed: 6 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,9 @@
1-
"""Tests for the chat-client agenthub_config default behavior.
2-
3-
Direct construction of UiPathChat / UiPathChatOpenAI / UiPathAzureChatOpenAI /
4-
UiPathChatBedrock / UiPathChatBedrockConverse / UiPathChatAnthropicBedrock /
5-
UiPathChatGoogleGenerativeAI / UiPathChatVertex must default
6-
client_settings.agenthub_config to None.
7-
8-
The upstream classes (used by chat_model_factory for low-code runtime)
9-
must keep the upstream library default of "agentsruntime", proving the
10-
local override does not leak globally onto the upstream class.
11-
"""
1+
"""Tests that direct construction of UiPathChat / UiPathChatOpenAI /
2+
UiPathAzureChatOpenAI / UiPathChatBedrock / UiPathChatBedrockConverse /
3+
UiPathChatAnthropicBedrock / UiPathChatGoogleGenerativeAI / UiPathChatVertex
4+
defaults ``client_settings.agenthub_config`` to None and omits the
5+
``x-uipath-agenthub-config`` header on the outgoing httpx client unless
6+
``UIPATH_AGENTHUB_CONFIG`` is set."""
127

138
import pytest
149

@@ -78,35 +73,3 @@ def test_env_var_is_honored_on_inner_http_client(self, cls, monkeypatch):
7873
pytest.skip(f"{cls.__name__} has no uipath_sync_client to inspect")
7974
normalized = {key.lower(): value for key, value in client.headers.items()}
8075
assert normalized.get("x-uipath-agenthub-config") == "agentsplayground"
81-
82-
83-
_UPSTREAM_CASES = [
84-
"uipath_langchain_client.clients.normalized.chat_models:UiPathChat",
85-
"uipath_langchain_client.clients.openai.chat_models:UiPathChatOpenAI",
86-
"uipath_langchain_client.clients.openai.chat_models:UiPathAzureChatOpenAI",
87-
"uipath_langchain_client.clients.bedrock.chat_models:UiPathChatBedrock",
88-
"uipath_langchain_client.clients.bedrock.chat_models:UiPathChatBedrockConverse",
89-
"uipath_langchain_client.clients.bedrock.chat_models:UiPathChatAnthropicBedrock",
90-
"uipath_langchain_client.clients.google.chat_models:UiPathChatGoogleGenerativeAI",
91-
]
92-
93-
94-
@pytest.mark.parametrize("upstream_path", _UPSTREAM_CASES)
95-
class TestUpstreamAgentHubConfigUntouched:
96-
"""Deployed runtimes go through chat_model_factory, which instantiates the
97-
upstream classes directly. Those must keep the upstream library default of
98-
'agentsruntime'."""
99-
100-
def _resolve(self, upstream_path: str):
101-
import importlib
102-
103-
module_name, attr = upstream_path.split(":")
104-
return getattr(importlib.import_module(module_name), attr)
105-
106-
def test_upstream_keeps_agentsruntime_default(self, upstream_path):
107-
# make sure model rebinds are not breaking the agenthub_config
108-
import uipath_langchain.chat # noqa: F401
109-
110-
upstream_cls = self._resolve(upstream_path)
111-
llm = upstream_cls(model="gpt-4.1-mini-2025-04-14")
112-
assert llm.client_settings.agenthub_config == "agentsruntime"

uv.lock

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

0 commit comments

Comments
 (0)