Skip to content
Open
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
18 changes: 9 additions & 9 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[project]
name = "uipath-langchain"
version = "0.15.3"
version = "0.15.4"
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 @@ -9,7 +9,7 @@ dependencies = [
"uipath-core>=0.5.29, <0.6.0",
"uipath-platform>=0.2.15, <0.3.0",
"uipath-runtime>=0.12.5, <0.13.0",
"uipath-llm-client>=1.17.1, <1.18.0",
"uipath-llm-client>=1.18.0, <1.19.0",
"langgraph>=1.1.8, <2.0.0",
"langchain-core>=1.2.27, <2.0.0",
"langgraph-checkpoint-sqlite>=3.0.3, <4.0.0",
Expand All @@ -26,7 +26,7 @@ dependencies = [
"pillow>=12.1.1",
"rdflib>=7.0.0, <8.0.0",
"a2a-sdk>=0.2.0,<1.0.0",
"uipath-langchain-client[openai]>=1.17.1,<1.18.0",
"uipath-langchain-client[openai]>=1.18.0, <1.19.0",
]

classifiers = [
Expand All @@ -43,21 +43,21 @@ maintainers = [

[project.optional-dependencies]
anthropic = [
"uipath-langchain-client[anthropic]>=1.17.1,<1.18.0",
"uipath-langchain-client[anthropic]>=1.18.0, <1.19.0",
]
vertex = [
"uipath-langchain-client[google]>=1.17.1,<1.18.0",
"uipath-langchain-client[vertexai]>=1.17.1,<1.18.0",
"uipath-langchain-client[google]>=1.18.0, <1.19.0",
"uipath-langchain-client[vertexai]>=1.18.0, <1.19.0",
]
bedrock = [
"uipath-langchain-client[bedrock]>=1.17.1,<1.18.0",
"uipath-langchain-client[bedrock]>=1.18.0, <1.19.0",
"boto3-stubs>=1.41.4",
]
fireworks = [
"uipath-langchain-client[fireworks]>=1.17.1,<1.18.0",
"uipath-langchain-client[fireworks]>=1.18.0, <1.19.0",
]
all = [
"uipath-langchain-client[all]>=1.17.1,<1.18.0",
"uipath-langchain-client[all]>=1.18.0, <1.19.0",
]

[project.entry-points."uipath.middlewares"]
Expand Down
40 changes: 35 additions & 5 deletions tests/chat/test_agenthub_config_default.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,14 @@
"""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."""
defaults ``client_settings.agenthub_config`` based on the execution context.

Since ``uipath-llm-client`` 1.18.0, a design-time run (local, Studio Web, or a
debug session) defaults ``agenthub_config`` to ``codedagentsplayground`` so coded
agents draw the CodedAgents.Playground licensing pool, while a deployed run (a real
Orchestrator job that is not a Studio Web project and not rooted to a debug session)
keeps it ``None`` and omits the ``x-uipath-agenthub-config`` header. An explicit
``UIPATH_AGENTHUB_CONFIG`` always wins."""

import pytest

Expand All @@ -24,6 +29,8 @@
"signature"
)

_CODED_PLAYGROUND = "codedagentsplayground"


@pytest.fixture(autouse=True)
def _platform_env(monkeypatch):
Expand All @@ -33,6 +40,9 @@ def _platform_env(monkeypatch):
monkeypatch.setenv("UIPATH_ORGANIZATION_ID", "org")
monkeypatch.delenv("UIPATH_AGENTHUB_CONFIG", raising=False)
monkeypatch.delenv("UIPATH_MODEL_NAME", raising=False)
# No job key by default -> design-time context.
monkeypatch.delenv("UIPATH_JOB_KEY", raising=False)
monkeypatch.delenv("UIPATH_PROJECT_ID", raising=False)


_DIRECT_CTOR_CASES = [
Expand All @@ -49,7 +59,14 @@ def _platform_env(monkeypatch):

@pytest.mark.parametrize("cls", _DIRECT_CTOR_CASES)
class TestDirectConstructorAgentHubConfig:
def test_default_is_none(self, cls):
def test_default_is_coded_playground_at_design_time(self, cls):
"""No job key -> design-time -> codedagentsplayground."""
llm = cls()
assert llm.client_settings.agenthub_config == _CODED_PLAYGROUND

def test_default_is_none_when_deployed(self, cls, monkeypatch):
"""Deployed job (not a studio project, not a debug session) -> None."""
monkeypatch.setenv("UIPATH_JOB_KEY", "deployed-job")
llm = cls()
assert llm.client_settings.agenthub_config is None

Expand All @@ -58,7 +75,20 @@ def test_env_var_is_honored(self, cls, monkeypatch):
llm = cls()
assert llm.client_settings.agenthub_config == "agentsplayground"

def test_no_agenthub_header_on_inner_http_client(self, cls):
def test_coded_playground_header_on_inner_http_client_at_design_time(self, cls):
"""Design-time run emits the coded-playground header on the httpx client."""
llm = cls()
client = getattr(llm, "uipath_sync_client", None)
if client is None:
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") == _CODED_PLAYGROUND

def test_no_agenthub_header_on_inner_http_client_when_deployed(
self, cls, monkeypatch
):
"""Deployed run omits the agenthub-config header."""
monkeypatch.setenv("UIPATH_JOB_KEY", "deployed-job")
llm = cls()
client = getattr(llm, "uipath_sync_client", None)
if client is None:
Expand Down