Skip to content
Closed
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.10"
version = "0.14.11"
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.17.0, <1.18.0",
"uipath-llm-client>=1.17.1, <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.17.0,<1.18.0",
"uipath-langchain-client[openai]>=1.17.1,<1.18.0",
]

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

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

[project.entry-points."uipath.middlewares"]
Expand Down
4 changes: 3 additions & 1 deletion src/uipath_langchain/chat/_legacy/chat_model_factory.py
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,9 @@ def _get_model_info(
matching_models = [m for m in matching_models if m.get("byomDetails") is None]

if not matching_models:
raise ValueError(
from uipath.llm_client.utils.exceptions import ModelNotFoundError

raise ModelNotFoundError(
f"model='{model}' and byo_connection_id={byo_connection_id}"
+ " is not available. It was not returned by the discovery API."
)
Comment thread
tudormatei1 marked this conversation as resolved.
Expand Down
37 changes: 37 additions & 0 deletions tests/chat/test_chat_model_factory.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
_API_FLAVOR_TO_PROVIDER,
_DEFAULT_API_FLAVOR,
_compute_vendor_and_api_flavor,
_get_model_info,
get_chat_model,
)
from uipath_langchain.chat._legacy.types import APIFlavor, LLMProvider
Expand Down Expand Up @@ -493,3 +494,39 @@ def test_default_max_retries_forwarded_to_new_client_factory(self, mocker):

_, kwargs = mock_factory.call_args
assert kwargs["max_retries"] == 5


class TestGetModelInfo:
"""Test cases for _get_model_info discovery lookups."""

def test_raises_model_not_found_when_absent_from_discovery(self, mocker):
"""A model missing from discovery raises the typed ModelNotFoundError."""
from uipath.llm_client.utils.exceptions import ModelNotFoundError

mocker.patch(
"uipath_langchain.chat._legacy.chat_model_factory._fetch_discovery",
return_value=[{"modelName": "gpt-4o"}],
)

with pytest.raises(ModelNotFoundError) as exc_info:
_get_model_info("does-not-exist", "agentsruntime", None)

assert isinstance(exc_info.value, ValueError)
assert "does-not-exist" in str(exc_info.value)

def test_raises_model_not_found_when_byo_connection_mismatch(self, mocker):
"""A model present but under a different BYO connection is not a match."""
from uipath.llm_client.utils.exceptions import ModelNotFoundError

mocker.patch(
"uipath_langchain.chat._legacy.chat_model_factory._fetch_discovery",
return_value=[
{
"modelName": "gpt-4o",
"byomDetails": {"integrationServiceConnectionId": "conn-a"},
}
],
)

with pytest.raises(ModelNotFoundError):
_get_model_info("gpt-4o", "agentsruntime", "conn-b")
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