Skip to content

Commit b2f211c

Browse files
fix: use empty pydantic model for ixp escalation tool (#731)
1 parent 9f99874 commit b2f211c

File tree

4 files changed

+21
-18
lines changed

4 files changed

+21
-18
lines changed

pyproject.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
[project]
22
name = "uipath-langchain"
3-
version = "0.9.9"
3+
version = "0.9.10"
44
description = "Python SDK that enables developers to build and deploy LangGraph agents to the UiPath Cloud Platform"
55
readme = { file = "README.md", content-type = "text/markdown" }
66
requires-python = ">=3.11"
77
dependencies = [
88
"uipath>=2.10.29, <2.11.0",
99
"uipath-core>=0.5.2, <0.6.0",
10-
"uipath-platform>=0.1.7, <0.2.0",
10+
"uipath-platform>=0.1.10, <0.2.0",
1111
"uipath-runtime>=0.10.0, <0.11.0",
1212
"langgraph>=1.0.0, <2.0.0",
1313
"langchain-core>=1.2.11, <2.0.0",

src/uipath_langchain/agent/tools/ixp_escalation_tool.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,10 @@ class StructuredToolWithWrapper(StructuredToolWithOutputType, ToolWrapperMixin):
3838
pass
3939

4040

41+
class EmptyInput(BaseModel):
42+
pass
43+
44+
4145
def create_ixp_escalation_tool(
4246
resource: AgentIxpVsEscalationResourceConfig,
4347
) -> StructuredTool:
@@ -148,7 +152,7 @@ async def ixp_escalation_tool_wrapper(
148152
tool = StructuredToolWithWrapper(
149153
name=tool_name,
150154
description=resource.description,
151-
args_schema={},
155+
args_schema=EmptyInput,
152156
coroutine=ixp_escalation_tool,
153157
output_type=OutputSchema,
154158
metadata={

tests/agent/tools/test_ixp_escalation_tool.py

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55

66
import pytest
77
from langchain_core.messages import ToolCall
8+
from pydantic import BaseModel
89
from uipath.agent.models.agent import (
910
AgentEscalationChannel,
1011
AgentEscalationChannelProperties,
@@ -18,13 +19,8 @@
1819
)
1920

2021
from uipath_langchain.agent.exceptions import AgentRuntimeError
21-
from uipath_langchain.agent.react.types import (
22-
AgentGraphState,
23-
InnerAgentGraphState,
24-
)
25-
from uipath_langchain.agent.tools.ixp_escalation_tool import (
26-
create_ixp_escalation_tool,
27-
)
22+
from uipath_langchain.agent.react.types import AgentGraphState, InnerAgentGraphState
23+
from uipath_langchain.agent.tools.ixp_escalation_tool import create_ixp_escalation_tool
2824

2925

3026
def _passthrough_task(fn):
@@ -119,10 +115,13 @@ def test_tool_has_wrapper_configured(self, escalation_resource):
119115
assert hasattr(tool, "awrapper")
120116
assert tool.awrapper is not None
121117

122-
def test_tool_uses_empty_input_schema(self, escalation_resource):
123-
"""Test that tool uses empty dict as input schema."""
118+
def test_tool_args_schema_is_pydantic_model(self, escalation_resource):
119+
"""Test that args_schema is an empty Pydantic BaseModel."""
124120
tool = create_ixp_escalation_tool(escalation_resource)
125-
assert tool.args_schema == {}
121+
assert tool.args_schema is not None
122+
assert isinstance(tool.args_schema, type)
123+
assert issubclass(tool.args_schema, BaseModel)
124+
assert tool.args_schema.model_fields == {}
126125

127126
def test_tool_has_vs_escalation_metadata(self, escalation_resource):
128127
"""Test that tool has vs_escalation metadata with ixp_tool_id and storage_bucket_name."""

uv.lock

Lines changed: 5 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)