Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 8 additions & 8 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -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"
Expand All @@ -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 = [
Expand All @@ -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"]
Expand Down
16 changes: 0 additions & 16 deletions src/uipath_langchain/chat/_settings.py

This file was deleted.

12 changes: 3 additions & 9 deletions src/uipath_langchain/chat/bedrock.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,22 +12,18 @@
UiPathChatBedrockConverse as _UpstreamUiPathChatBedrockConverse,
)

from ._settings import _AgentHubConfigDefaultMixin

DEFAULT_MODEL_NAME = "anthropic.claude-haiku-4-5-20251001-v1:0"


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


Expand All @@ -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:
Expand Down
3 changes: 1 addition & 2 deletions src/uipath_langchain/chat/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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


Expand Down
8 changes: 2 additions & 6 deletions src/uipath_langchain/chat/openai.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,22 +7,18 @@
UiPathChatOpenAI as _UpstreamUiPathChatOpenAI,
)

from ._settings import _AgentHubConfigDefaultMixin

DEFAULT_MODEL_NAME = "gpt-4.1-mini-2025-04-14"


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


Expand Down
6 changes: 1 addition & 5 deletions src/uipath_langchain/chat/vertex.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,14 @@
UiPathChatGoogleGenerativeAI as _UpstreamUiPathChatGoogleGenerativeAI,
)

from ._settings import _AgentHubConfigDefaultMixin

DEFAULT_MODEL_NAME = "gemini-2.5-flash"


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


class UiPathChatGoogleGenerativeAI(
_AgentHubConfigDefaultMixin, _UpstreamUiPathChatGoogleGenerativeAI
):
class UiPathChatGoogleGenerativeAI(_UpstreamUiPathChatGoogleGenerativeAI):
pass


Expand Down
49 changes: 6 additions & 43 deletions tests/chat/test_agenthub_config_default.py
Original file line number Diff line number Diff line change
@@ -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

Expand Down Expand Up @@ -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"
28 changes: 14 additions & 14 deletions uv.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading