diff --git a/pyproject.toml b/pyproject.toml index 99beed168..de2205318 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "uipath-langchain" -version = "0.10.19" +version = "0.10.20" description = "Python SDK that enables developers to build and deploy LangGraph agents to the UiPath Cloud Platform" readme = { file = "README.md", content-type = "text/markdown" } requires-python = ">=3.11" @@ -23,7 +23,7 @@ dependencies = [ "langchain-mcp-adapters==0.2.1", "pillow>=12.1.1", "a2a-sdk>=0.2.0,<1.0.0", - "uipath-langchain-client[openai]>=1.10.1,<1.11.0", + "uipath-langchain-client[openai]>=1.11.0,<1.12.0", ] classifiers = [ @@ -40,21 +40,21 @@ maintainers = [ [project.optional-dependencies] anthropic = [ - "uipath-langchain-client[anthropic]>=1.10.1,<1.11.0", + "uipath-langchain-client[anthropic]>=1.11.0,<1.12.0", ] vertex = [ - "uipath-langchain-client[google]>=1.10.1,<1.11.0", - "uipath-langchain-client[vertexai]>=1.10.1,<1.11.0", + "uipath-langchain-client[google]>=1.11.0,<1.12.0", + "uipath-langchain-client[vertexai]>=1.11.0,<1.12.0", ] bedrock = [ - "uipath-langchain-client[bedrock]>=1.10.1,<1.11.0", + "uipath-langchain-client[bedrock]>=1.11.0,<1.12.0", "boto3-stubs>=1.41.4", ] fireworks = [ - "uipath-langchain-client[fireworks]>=1.10.1,<1.11.0", + "uipath-langchain-client[fireworks]>=1.11.0,<1.12.0", ] all = [ - "uipath-langchain-client[all]>=1.10.1,<1.11.0", + "uipath-langchain-client[all]>=1.11.0,<1.12.0", ] [project.entry-points."uipath.middlewares"] diff --git a/src/uipath_langchain/chat/_settings.py b/src/uipath_langchain/chat/_settings.py deleted file mode 100644 index 6442450bd..000000000 --- a/src/uipath_langchain/chat/_settings.py +++ /dev/null @@ -1,16 +0,0 @@ -import os - -from pydantic import field_validator - - -class _AgentHubConfigDefaultMixin: - @field_validator("client_settings", mode="after") - @classmethod - def _clear_agenthub_config_default(cls, client_settings): - if ( - client_settings is not None - and os.getenv("UIPATH_AGENTHUB_CONFIG") is None - and hasattr(client_settings, "agenthub_config") - ): - client_settings.agenthub_config = None - return client_settings diff --git a/src/uipath_langchain/chat/bedrock.py b/src/uipath_langchain/chat/bedrock.py index b1ce00a25..58cf8a39a 100644 --- a/src/uipath_langchain/chat/bedrock.py +++ b/src/uipath_langchain/chat/bedrock.py @@ -12,8 +12,6 @@ UiPathChatBedrockConverse as _UpstreamUiPathChatBedrockConverse, ) -from ._settings import _AgentHubConfigDefaultMixin - DEFAULT_MODEL_NAME = "anthropic.claude-haiku-4-5-20251001-v1:0" @@ -21,13 +19,11 @@ def _default_factory() -> str: return os.getenv("UIPATH_MODEL_NAME", DEFAULT_MODEL_NAME) -class UiPathChatBedrock(_AgentHubConfigDefaultMixin, _UpstreamUiPathChatBedrock): +class UiPathChatBedrock(_UpstreamUiPathChatBedrock): pass -class UiPathChatAnthropicBedrock( - _AgentHubConfigDefaultMixin, _UpstreamUiPathChatAnthropicBedrock -): +class UiPathChatAnthropicBedrock(_UpstreamUiPathChatAnthropicBedrock): pass @@ -36,9 +32,7 @@ class UiPathChatAnthropicBedrock( _cls.model_rebuild(force=True) -class UiPathChatBedrockConverse( - _AgentHubConfigDefaultMixin, _UpstreamUiPathChatBedrockConverse -): +class UiPathChatBedrockConverse(_UpstreamUiPathChatBedrockConverse): @model_validator(mode="before") @classmethod def _inject_default_model(cls, values: Any) -> Any: diff --git a/src/uipath_langchain/chat/models.py b/src/uipath_langchain/chat/models.py index 79f48900d..26a4fd068 100644 --- a/src/uipath_langchain/chat/models.py +++ b/src/uipath_langchain/chat/models.py @@ -4,7 +4,6 @@ UiPathChat as _UpstreamUiPathChat, ) -from ._settings import _AgentHubConfigDefaultMixin from .openai import UiPathAzureChatOpenAI, UiPathChatOpenAI DEFAULT_MODEL_NAME = "gpt-4.1-mini-2025-04-14" @@ -14,7 +13,7 @@ def _default_factory() -> str: return os.getenv("UIPATH_MODEL_NAME", DEFAULT_MODEL_NAME) -class UiPathChat(_AgentHubConfigDefaultMixin, _UpstreamUiPathChat): +class UiPathChat(_UpstreamUiPathChat): pass diff --git a/src/uipath_langchain/chat/openai.py b/src/uipath_langchain/chat/openai.py index 3c16c96bb..5c84674d9 100644 --- a/src/uipath_langchain/chat/openai.py +++ b/src/uipath_langchain/chat/openai.py @@ -7,8 +7,6 @@ UiPathChatOpenAI as _UpstreamUiPathChatOpenAI, ) -from ._settings import _AgentHubConfigDefaultMixin - DEFAULT_MODEL_NAME = "gpt-4.1-mini-2025-04-14" @@ -16,13 +14,11 @@ def _default_factory() -> str: return os.getenv("UIPATH_MODEL_NAME", DEFAULT_MODEL_NAME) -class UiPathChatOpenAI(_AgentHubConfigDefaultMixin, _UpstreamUiPathChatOpenAI): +class UiPathChatOpenAI(_UpstreamUiPathChatOpenAI): pass -class UiPathAzureChatOpenAI( - _AgentHubConfigDefaultMixin, _UpstreamUiPathAzureChatOpenAI -): +class UiPathAzureChatOpenAI(_UpstreamUiPathAzureChatOpenAI): pass diff --git a/src/uipath_langchain/chat/vertex.py b/src/uipath_langchain/chat/vertex.py index 30232a7f2..a22488e3e 100644 --- a/src/uipath_langchain/chat/vertex.py +++ b/src/uipath_langchain/chat/vertex.py @@ -4,8 +4,6 @@ UiPathChatGoogleGenerativeAI as _UpstreamUiPathChatGoogleGenerativeAI, ) -from ._settings import _AgentHubConfigDefaultMixin - DEFAULT_MODEL_NAME = "gemini-2.5-flash" @@ -13,9 +11,7 @@ def _default_factory() -> str: return os.getenv("UIPATH_MODEL_NAME", DEFAULT_MODEL_NAME) -class UiPathChatGoogleGenerativeAI( - _AgentHubConfigDefaultMixin, _UpstreamUiPathChatGoogleGenerativeAI -): +class UiPathChatGoogleGenerativeAI(_UpstreamUiPathChatGoogleGenerativeAI): pass diff --git a/tests/chat/test_agenthub_config_default.py b/tests/chat/test_agenthub_config_default.py index cd117e166..9666736bf 100644 --- a/tests/chat/test_agenthub_config_default.py +++ b/tests/chat/test_agenthub_config_default.py @@ -1,14 +1,9 @@ -"""Tests for the chat-client agenthub_config default behavior. - -Direct construction of UiPathChat / UiPathChatOpenAI / UiPathAzureChatOpenAI / -UiPathChatBedrock / UiPathChatBedrockConverse / UiPathChatAnthropicBedrock / -UiPathChatGoogleGenerativeAI / UiPathChatVertex must default -client_settings.agenthub_config to None. - -The upstream classes (used by chat_model_factory for low-code runtime) -must keep the upstream library default of "agentsruntime", proving the -local override does not leak globally onto the upstream class. -""" +"""Tests that direct construction of UiPathChat / UiPathChatOpenAI / +UiPathAzureChatOpenAI / UiPathChatBedrock / UiPathChatBedrockConverse / +UiPathChatAnthropicBedrock / UiPathChatGoogleGenerativeAI / UiPathChatVertex +defaults ``client_settings.agenthub_config`` to None and omits the +``x-uipath-agenthub-config`` header on the outgoing httpx client unless +``UIPATH_AGENTHUB_CONFIG`` is set.""" import pytest @@ -78,35 +73,3 @@ def test_env_var_is_honored_on_inner_http_client(self, cls, monkeypatch): pytest.skip(f"{cls.__name__} has no uipath_sync_client to inspect") normalized = {key.lower(): value for key, value in client.headers.items()} assert normalized.get("x-uipath-agenthub-config") == "agentsplayground" - - -_UPSTREAM_CASES = [ - "uipath_langchain_client.clients.normalized.chat_models:UiPathChat", - "uipath_langchain_client.clients.openai.chat_models:UiPathChatOpenAI", - "uipath_langchain_client.clients.openai.chat_models:UiPathAzureChatOpenAI", - "uipath_langchain_client.clients.bedrock.chat_models:UiPathChatBedrock", - "uipath_langchain_client.clients.bedrock.chat_models:UiPathChatBedrockConverse", - "uipath_langchain_client.clients.bedrock.chat_models:UiPathChatAnthropicBedrock", - "uipath_langchain_client.clients.google.chat_models:UiPathChatGoogleGenerativeAI", -] - - -@pytest.mark.parametrize("upstream_path", _UPSTREAM_CASES) -class TestUpstreamAgentHubConfigUntouched: - """Deployed runtimes go through chat_model_factory, which instantiates the - upstream classes directly. Those must keep the upstream library default of - 'agentsruntime'.""" - - def _resolve(self, upstream_path: str): - import importlib - - module_name, attr = upstream_path.split(":") - return getattr(importlib.import_module(module_name), attr) - - def test_upstream_keeps_agentsruntime_default(self, upstream_path): - # make sure model rebinds are not breaking the agenthub_config - import uipath_langchain.chat # noqa: F401 - - upstream_cls = self._resolve(upstream_path) - llm = upstream_cls(model="gpt-4.1-mini-2025-04-14") - assert llm.client_settings.agenthub_config == "agentsruntime" diff --git a/uv.lock b/uv.lock index 5b89ed70c..00f0c9847 100644 --- a/uv.lock +++ b/uv.lock @@ -4375,7 +4375,7 @@ wheels = [ [[package]] name = "uipath-langchain" -version = "0.10.19" +version = "0.10.20" source = { editable = "." } dependencies = [ { name = "a2a-sdk" }, @@ -4452,13 +4452,13 @@ requires-dist = [ { name = "python-dotenv", specifier = ">=1.0.1" }, { name = "uipath", specifier = ">=2.10.61,<2.11.0" }, { name = "uipath-core", specifier = ">=0.5.15,<0.6.0" }, - { name = "uipath-langchain-client", extras = ["all"], marker = "extra == 'all'", specifier = ">=1.10.1,<1.11.0" }, - { name = "uipath-langchain-client", extras = ["anthropic"], marker = "extra == 'anthropic'", specifier = ">=1.10.1,<1.11.0" }, - { name = "uipath-langchain-client", extras = ["bedrock"], marker = "extra == 'bedrock'", specifier = ">=1.10.1,<1.11.0" }, - { name = "uipath-langchain-client", extras = ["fireworks"], marker = "extra == 'fireworks'", specifier = ">=1.10.1,<1.11.0" }, - { name = "uipath-langchain-client", extras = ["google"], marker = "extra == 'vertex'", specifier = ">=1.10.1,<1.11.0" }, - { name = "uipath-langchain-client", extras = ["openai"], specifier = ">=1.10.1,<1.11.0" }, - { name = "uipath-langchain-client", extras = ["vertexai"], marker = "extra == 'vertex'", specifier = ">=1.10.1,<1.11.0" }, + { name = "uipath-langchain-client", extras = ["all"], marker = "extra == 'all'", specifier = ">=1.11.0,<1.12.0" }, + { name = "uipath-langchain-client", extras = ["anthropic"], marker = "extra == 'anthropic'", specifier = ">=1.11.0,<1.12.0" }, + { name = "uipath-langchain-client", extras = ["bedrock"], marker = "extra == 'bedrock'", specifier = ">=1.11.0,<1.12.0" }, + { name = "uipath-langchain-client", extras = ["fireworks"], marker = "extra == 'fireworks'", specifier = ">=1.11.0,<1.12.0" }, + { name = "uipath-langchain-client", extras = ["google"], marker = "extra == 'vertex'", specifier = ">=1.11.0,<1.12.0" }, + { name = "uipath-langchain-client", extras = ["openai"], specifier = ">=1.11.0,<1.12.0" }, + { name = "uipath-langchain-client", extras = ["vertexai"], marker = "extra == 'vertex'", specifier = ">=1.11.0,<1.12.0" }, { name = "uipath-platform", specifier = ">=0.1.45,<0.2.0" }, { name = "uipath-runtime", specifier = ">=0.10.0,<0.11.0" }, ] @@ -4482,15 +4482,15 @@ dev = [ [[package]] name = "uipath-langchain-client" -version = "1.10.1" +version = "1.11.0" source = { registry = "https://pypi.org/simple" } dependencies = [ { name = "langchain" }, { name = "uipath-llm-client" }, ] -sdist = { url = "https://files.pythonhosted.org/packages/41/b8/5034d1a12a24e34138b2f3e0bba389d9ff870daf3511dbe71bee121e5e03/uipath_langchain_client-1.10.1.tar.gz", hash = "sha256:151ab00cd10c173df575ba64e3a81a9ba2ced268eaec9e4b822a8109e4863c8b", size = 36113, upload-time = "2026-05-08T11:39:49.538Z" } +sdist = { url = "https://files.pythonhosted.org/packages/ab/12/9e49451b141097835708247062c380084c4518983c5e8f3b0628f9e125b0/uipath_langchain_client-1.11.0.tar.gz", hash = "sha256:45d0e687d91f0d75bb3eae8639d272e74d9f379ff93f95d3ae4f69e91027951f", size = 36070, upload-time = "2026-05-08T12:40:59.703Z" } wheels = [ - { url = "https://files.pythonhosted.org/packages/3c/03/73aed19e0271f5cb2c62d15b7bba3274e110c9a738815ad975fb8348d8dc/uipath_langchain_client-1.10.1-py3-none-any.whl", hash = "sha256:73a72ffb3c0b992d295650d331f5b4c58f4d18709bfffe1e2f699525d951da10", size = 46184, upload-time = "2026-05-08T11:39:50.607Z" }, + { url = "https://files.pythonhosted.org/packages/b9/90/f7de72c74375ccfa76415b7fb5c1366bb4869e877fe63a16888ff4280ea9/uipath_langchain_client-1.11.0-py3-none-any.whl", hash = "sha256:1dae1e0c559eda66f7d19025e09741350db97c35d41a6a93feb289361aa4565f", size = 46181, upload-time = "2026-05-08T12:40:58.598Z" }, ] [package.optional-dependencies] @@ -4527,7 +4527,7 @@ vertexai = [ [[package]] name = "uipath-llm-client" -version = "1.10.0" +version = "1.11.0" source = { registry = "https://pypi.org/simple" } dependencies = [ { name = "httpx" }, @@ -4536,9 +4536,9 @@ dependencies = [ { name = "tenacity" }, { name = "uipath-platform" }, ] -sdist = { url = "https://files.pythonhosted.org/packages/58/55/4ec7610922210380bfd762216e9fa4f34e03fe3f3e2932ac1d302c051b8e/uipath_llm_client-1.10.0.tar.gz", hash = "sha256:69aeec2fb9e1cabd3134204a63c1bc469ede8c719295f403f16aebb829591379", size = 12151393, upload-time = "2026-04-23T18:13:43.096Z" } +sdist = { url = "https://files.pythonhosted.org/packages/0c/d0/89614e6cfcdb700c9d64913bca67178d84d4255bd3f443578dfc1a929498/uipath_llm_client-1.11.0.tar.gz", hash = "sha256:3c594e1ed8ec7f69c37e51b1d55e55744caa06217c35fee1eaeca820a9220653", size = 12152230, upload-time = "2026-05-08T12:31:09.264Z" } wheels = [ - { url = "https://files.pythonhosted.org/packages/48/8d/16484bdf266052b9c71e4425f2b1a3f2457efe4db5944e7c7128f6789285/uipath_llm_client-1.10.0-py3-none-any.whl", hash = "sha256:6452396f07c36f17908413e2081bc7bed476a80c4e5ab70a100d505796dde082", size = 65012, upload-time = "2026-04-23T18:13:41.352Z" }, + { url = "https://files.pythonhosted.org/packages/19/16/c982a24b0da2d5f5c5d4ee6cf7fad2c442200149b1a13b531c736115dadd/uipath_llm_client-1.11.0-py3-none-any.whl", hash = "sha256:baeb597730a98b29b6316a662be5c992381a25b05a02e7409a5f5ecff8c6dcc7", size = 65006, upload-time = "2026-05-08T12:31:06.667Z" }, ] [[package]]