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.18"
version = "0.10.19"
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.0,<1.11.0",
"uipath-langchain-client[openai]>=1.10.1,<1.11.0",
]

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

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

[project.entry-points."uipath.middlewares"]
Expand Down
4 changes: 2 additions & 2 deletions src/uipath_langchain/chat/chat_model_factory.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@ def get_chat_model(
timeout: float | None = DEFAULT_TIMEOUT_SECONDS,
max_retries: int | None = DEFAULT_MAX_RETRIES,
callbacks: Callbacks = _UNSET,
# Legacy-only arguments
agenthub_config: str | None = None,
use_new_llm_clients: bool = True,
**kwargs: Any,
Expand Down Expand Up @@ -74,7 +73,7 @@ def get_chat_model(
``BaseCallbackManager``. Forwarded only when explicitly set.
Ignored by the legacy factory.
agenthub_config: AgentHub config header value. Required by the legacy
factory; ignored by the new factory.
factory; forwarded to the new factory.
use_new_llm_clients: Routes to the new ``uipath_langchain_client``
factory when True (default). When False, routes to the legacy
in-repo clients.
Expand Down Expand Up @@ -115,6 +114,7 @@ def get_chat_model(
vendor_type=vendor_type,
api_flavor=api_flavor,
custom_class=custom_class,
agenthub_config=agenthub_config,
**optional_kwargs,
**kwargs,
)
Expand Down
43 changes: 43 additions & 0 deletions tests/chat/test_chat_model_factory_agenthub.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
"""Tests that ``chat_model_factory.get_chat_model`` forwards ``agenthub_config``
to the upstream ``uipath_langchain_client`` factory on the new-clients path."""

from unittest.mock import MagicMock

import pytest

from uipath_langchain.chat.chat_model_factory import get_chat_model


class TestForwardAgentHubConfig:
def test_agenthub_config_forwarded_on_new_path(self, mocker):
"""The kwarg the caller passes must reach the upstream factory verbatim."""
upstream = mocker.patch(
"uipath_langchain.chat.chat_model_factory.get_chat_model_factory",
return_value=MagicMock(),
)

get_chat_model(
"gpt-4o",
agenthub_config="agentsplayground",
use_new_llm_clients=True,
)

_, kwargs = upstream.call_args
assert kwargs.get("agenthub_config") == "agentsplayground"

def test_agenthub_config_none_forwarded_on_new_path(self, mocker):
"""Pass-through preserves None so upstream applies its own default."""
upstream = mocker.patch(
"uipath_langchain.chat.chat_model_factory.get_chat_model_factory",
return_value=MagicMock(),
)

get_chat_model("gpt-4o", use_new_llm_clients=True)

_, kwargs = upstream.call_args
assert kwargs.get("agenthub_config") is None

def test_legacy_path_still_requires_agenthub_config(self, mocker):
"""Legacy factory contract is unchanged: missing agenthub_config raises."""
with pytest.raises(ValueError, match="agenthub_config is required"):
get_chat_model("gpt-4o", use_new_llm_clients=False)
22 changes: 11 additions & 11 deletions uv.lock

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

Loading