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
31 changes: 24 additions & 7 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[project]
name = "uipath-langchain"
version = "0.9.32"
version = "0.10.0"
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 @@ -12,7 +12,6 @@ dependencies = [
"langgraph>=1.1.8, <2.0.0",
"langchain-core>=1.2.11, <2.0.0",
"langgraph-checkpoint-sqlite>=3.0.3, <4.0.0",
"langchain-openai>=1.0.0, <2.0.0",
"langchain>=1.0.0, <2.0.0",
"pydantic-settings>=2.6.0",
"python-dotenv>=1.0.1",
Expand All @@ -23,7 +22,8 @@ dependencies = [
"mcp==1.26.0",
"langchain-mcp-adapters==0.2.1",
"pillow>=12.1.1",
"a2a-sdk>=0.2.0",
"a2a-sdk>=0.2.0,<1.0.0",
"uipath-langchain-client[openai]>=1.9.5",
]

classifiers = [
Expand All @@ -39,8 +39,23 @@ maintainers = [
]

[project.optional-dependencies]
vertex = ["langchain-google-genai>=2.0.0", "google-generativeai>=0.8.0"]
bedrock = ["langchain-aws>=0.2.35", "boto3-stubs>=1.41.4"]
anthropic = [
"uipath-langchain-client[anthropic]>=1.9.5",
]
vertex = [
"uipath-langchain-client[google]>=1.9.5",
"uipath-langchain-client[vertexai]>=1.9.5",
]
bedrock = [
"uipath-langchain-client[bedrock]>=1.9.5",
"boto3-stubs>=1.41.4",
]
fireworks = [
"uipath-langchain-client[fireworks]>=1.9.5",
]
all = [
"uipath-langchain-client[all]>=1.9.5",
]

[project.entry-points."uipath.middlewares"]
register = "uipath_langchain.middlewares:register_middleware"
Expand Down Expand Up @@ -71,6 +86,7 @@ dev = [
"numpy>=1.24.0",
"pytest_httpx>=0.35.0",
"rust-just>=1.39.0",
"pyright>=1.1.408",
]

[tool.hatch.build.targets.wheel]
Expand All @@ -86,8 +102,8 @@ select = ["E", "F", "B", "I"]

[tool.ruff.lint.per-file-ignores]
"*" = ["E501"]
"src/uipath_langchain/chat/bedrock.py" = ["E402"]
"src/uipath_langchain/chat/vertex.py" = ["E402"]
"src/uipath_langchain/chat/_legacy/bedrock.py" = ["E402"]
"src/uipath_langchain/chat/_legacy/vertex.py" = ["E402"]

[tool.ruff.format]
quote-style = "double"
Expand Down Expand Up @@ -121,3 +137,4 @@ name = "testpypi"
url = "https://test.pypi.org/simple/"
publish-url = "https://test.pypi.org/legacy/"
explicit = true

16 changes: 16 additions & 0 deletions pyrightconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"include": ["src"],
"exclude": ["samples", "testcases", "template"],
"pythonVersion": "3.11",
"typeCheckingMode": "basic",
"reportCallIssue": "none",
"reportArgumentType": "none",
"reportAttributeAccessIssue": "none",
"reportIndexIssue": "none",
"reportInvalidTypeForm": "none",
"reportReturnType": "warning",
"reportAssignmentType": "warning",
"reportPossiblyUnbound": "error",
"reportGeneralTypeIssues": "warning",
"reportUnsupportedDunderAll": "none"
}
5 changes: 4 additions & 1 deletion src/uipath_langchain/_utils/_request_mixin.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,10 @@
get_uipath_token_header,
)
from uipath_langchain._utils._sleep_policy import before_sleep_log
from uipath_langchain.chat.http_client import build_uipath_headers, resolve_gateway_url
from uipath_langchain.chat._legacy.http_client import (
build_uipath_headers,
resolve_gateway_url,
)
from uipath_langchain.runtime.errors import (
LangGraphErrorCode,
LangGraphRuntimeError,
Expand Down
1 change: 1 addition & 0 deletions src/uipath_langchain/agent/react/init_node.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ def create_init_node(
):
def graph_state_init(state: Any) -> Any:
resolved_messages: Sequence[SystemMessage | HumanMessage] | Overwrite
preserved_messages: Sequence[Any] = []
if callable(messages):
resolved_messages = list(messages(state))
else:
Expand Down
89 changes: 73 additions & 16 deletions src/uipath_langchain/chat/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,56 +11,113 @@
Instead, all exports are loaded on-demand when first accessed.
"""

from .hitl import (
request_approval,
request_conversational_tool_confirmation,
requires_approval,
)


def __getattr__(name):
if name == "UiPathAzureChatOpenAI":
from .models import UiPathAzureChatOpenAI
if name == "get_chat_model":
from .chat_model_factory import get_chat_model

return UiPathAzureChatOpenAI
return get_chat_model
if name == "UiPathChat":
from .models import UiPathChat
from uipath_langchain_client.clients.normalized.chat_models import (
UiPathChat,
)

return UiPathChat
if name == "UiPathAzureChatOpenAI":
from uipath_langchain_client.clients.openai.chat_models import (
UiPathAzureChatOpenAI,
)

return UiPathAzureChatOpenAI
if name == "UiPathChatOpenAI":
from .openai import UiPathChatOpenAI
from uipath_langchain_client.clients.openai.chat_models import (
UiPathChatOpenAI,
)

return UiPathChatOpenAI
if name == "requires_approval":
from .hitl import requires_approval
if name == "UiPathChatGoogleGenerativeAI":
from uipath_langchain_client.clients.google.chat_models import (
UiPathChatGoogleGenerativeAI,
)

return UiPathChatGoogleGenerativeAI
if name == "UiPathChatBedrock":
from uipath_langchain_client.clients.bedrock.chat_models import (
UiPathChatBedrock,
)

return requires_approval
if name in ("UiPathChatBedrock", "UiPathChatBedrockConverse"):
from .bedrock import UiPathChatBedrock, UiPathChatBedrockConverse
return UiPathChatBedrock
if name == "UiPathChatBedrockConverse":
from uipath_langchain_client.clients.bedrock.chat_models import (
UiPathChatBedrockConverse,
)

if name == "UiPathChatBedrock":
return UiPathChatBedrock
return UiPathChatBedrockConverse
if name == "UiPathChatAnthropicBedrock":
from uipath_langchain_client.clients.bedrock.chat_models import (
UiPathChatAnthropicBedrock,
)

return UiPathChatAnthropicBedrock
if name == "UiPathChatAnthropic":
from uipath_langchain_client.clients.anthropic.chat_models import (
UiPathChatAnthropic,
)

return UiPathChatAnthropic
if name == "UiPathChatAnthropicVertex":
from uipath_langchain_client.clients.vertexai.chat_models import (
UiPathChatAnthropicVertex,
)

return UiPathChatAnthropicVertex
if name == "UiPathChatFireworks":
from uipath_langchain_client.clients.fireworks.chat_models import (
UiPathChatFireworks,
)

return UiPathChatFireworks
if name == "UiPathChatVertex":
from .vertex import UiPathChatVertex
from uipath_langchain.chat._legacy.vertex import UiPathChatVertex

return UiPathChatVertex
if name in ("OpenAIModels", "BedrockModels", "GeminiModels"):
from . import supported_models
from uipath_langchain.chat._legacy import supported_models

return getattr(supported_models, name)
if name in ("LLMProvider", "APIFlavor"):
from . import types
from uipath_langchain.chat._legacy import types

return getattr(types, name)

raise AttributeError(f"module {__name__!r} has no attribute {name!r}")


__all__ = [
"get_chat_model",
"UiPathChat",
"UiPathAzureChatOpenAI",
"UiPathChatOpenAI",
"UiPathChatGoogleGenerativeAI",
"UiPathChatBedrock",
"UiPathChatBedrockConverse",
"UiPathChatAnthropicBedrock",
"UiPathChatAnthropic",
"UiPathChatAnthropicVertex",
"UiPathChatFireworks",
"UiPathChatVertex",
"OpenAIModels",
"BedrockModels",
"GeminiModels",
"requires_approval",
"LLMProvider",
"APIFlavor",
"request_approval",
"request_conversational_tool_confirmation",
"requires_approval",
]
6 changes: 6 additions & 0 deletions src/uipath_langchain/chat/_legacy/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
"""Legacy LLM client implementation retained for the EnabledNewLlmClients feature flag.
This package hosts the pre-commit-3f7da07d chat client code. It is used when the
``EnabledNewLlmClients`` feature flag is False so that behavior matches the
implementation that preceded the ``uipath_langchain_client`` migration.
"""
Loading
Loading