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
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.14.9"
version = "0.14.10"
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.10, <0.3.0",
"uipath-runtime>=0.12.1, <0.13.0",
"uipath-llm-client>=1.16.3, <1.17.0",
"uipath-llm-client>=1.17.0, <1.18.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.16.1,<1.17.0",
"uipath-langchain-client[openai]>=1.17.0,<1.18.0",
]

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

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

[project.entry-points."uipath.middlewares"]
Expand Down
7 changes: 5 additions & 2 deletions src/uipath_langchain/chat/chat_model_factory.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,9 @@ def on_llm_start(
DEFAULT_TIMEOUT_SECONDS: Final[float] = 895.0
DEFAULT_MAX_TOKENS: Final[int] = 1000
DEFAULT_TEMPERATURE: Final[float] = 0.0
DEFAULT_MAX_RETRIES: Final[int] = 3
# 5 total attempts (initial request + up to 4 retries) for parity with the
# legacy in-repo retryers (BedrockRetryer / VertexRetryer) and uipath-llm-client defaults.
DEFAULT_MAX_RETRIES: Final[int] = 5
Comment thread
vldcmp-uipath marked this conversation as resolved.


def get_chat_model(
Expand Down Expand Up @@ -99,7 +101,8 @@ def get_chat_model(
forward an explicit unset value (lets the underlying client apply
its own default or use no limit).
timeout: Request timeout in seconds. Defaults to 895 seconds.
max_retries: Max retry count. Defaults to 3.
max_retries: Maximum number of attempts (ignored when
use_new_llm_clients=False). Defaults to 5.
callbacks: LangChain callbacks (handlers or a manager) attached to the
returned chat model. Accepts ``list[BaseCallbackHandler]`` or a
``BaseCallbackManager``. Forwarded only when explicitly set.
Expand Down
28 changes: 28 additions & 0 deletions tests/chat/test_chat_model_factory.py
Original file line number Diff line number Diff line change
Expand Up @@ -465,3 +465,31 @@ def test_gemini_vertex_forwards_temperature(self, mocker):

_, kwargs = mock_cls.call_args
assert kwargs.get("temperature") == 0.5


class TestDefaultMaxRetriesForwarding:
"""Pins ``DEFAULT_MAX_RETRIES`` to 5 (parity with the legacy in-repo
retryers) and asserts the default reaches the ``uipath_langchain_client``
factory on the new-clients path, so the old default cannot be silently
reintroduced."""

def test_default_max_retries_is_5(self):
from uipath_langchain.chat.chat_model_factory import DEFAULT_MAX_RETRIES

assert DEFAULT_MAX_RETRIES == 5

def test_default_max_retries_forwarded_to_new_client_factory(self, mocker):
from uipath_langchain.chat import chat_model_factory as outer_factory

mock_factory = mocker.patch(
"uipath_langchain.chat.chat_model_factory.get_chat_model_factory"
)

outer_factory.get_chat_model(
"gpt-test",
agenthub_config="cfg",
use_new_llm_clients=True,
)

_, kwargs = mock_factory.call_args
assert kwargs["max_retries"] == 5
30 changes: 15 additions & 15 deletions uv.lock

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

Loading