Skip to content

Commit 0dce3d2

Browse files
Merge pull request #375 from UiPath/fix/recipient-breaking-change
fix: agent escalation recipient tests breaking change on types imports
2 parents 46dd2bc + bf13d7d commit 0dce3d2

4 files changed

Lines changed: 21 additions & 19 deletions

File tree

pyproject.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
[project]
22
name = "uipath-langchain"
3-
version = "0.1.40"
3+
version = "0.1.41"
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 = [
8-
"uipath>=2.2.35, <2.3.0",
8+
"uipath>=2.2.41, <2.3.0",
99
"langgraph>=1.0.0, <2.0.0",
1010
"langchain-core>=1.0.0, <2.0.0",
1111
"aiosqlite==0.21.0",

src/uipath_langchain/agent/guardrails/guardrails_factory.py

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
AgentUnknownGuardrail,
1818
AgentWordOperator,
1919
AgentWordRule,
20+
StandardRecipient,
2021
)
2122
from uipath.core.guardrails import (
2223
BooleanRule,
@@ -273,17 +274,18 @@ def build_guardrails_with_actions(
273274
)
274275
)
275276
elif isinstance(action, AgentGuardrailEscalateAction):
276-
result.append(
277-
(
278-
converted_guardrail,
279-
EscalateAction(
280-
app_name=action.app.name,
281-
app_folder_path=action.app.folder_name,
282-
version=action.app.version,
283-
assignee=action.recipient.value,
284-
),
277+
if isinstance(action.recipient, StandardRecipient):
278+
result.append(
279+
(
280+
converted_guardrail,
281+
EscalateAction(
282+
app_name=action.app.name,
283+
app_folder_path=action.app.folder_name,
284+
version=action.app.version,
285+
assignee=action.recipient.value,
286+
),
287+
)
285288
)
286-
)
287289
elif isinstance(action, AgentGuardrailFilterAction):
288290
result.append((converted_guardrail, FilterAction(fields=action.fields)))
289291
return result

tests/agent/guardrails/test_guardrails_factory.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99
AgentBooleanOperator,
1010
AgentBooleanRule,
1111
AgentCustomGuardrail,
12-
AgentEscalationRecipient,
1312
AgentEscalationRecipientType,
1413
AgentGuardrailActionType,
1514
AgentGuardrailBlockAction,
@@ -24,6 +23,7 @@
2423
AgentWordOperator,
2524
AgentWordRule,
2625
FieldReference,
26+
StandardRecipient,
2727
)
2828
from uipath.agent.models.agent import (
2929
AgentGuardrail as AgentGuardrailModel,
@@ -139,7 +139,7 @@ def test_escalate_action_is_mapped_with_app_and_recipient(self) -> None:
139139
folder_name="/TestFolder",
140140
version=2,
141141
)
142-
recipient = AgentEscalationRecipient(
142+
recipient = StandardRecipient(
143143
type=AgentEscalationRecipientType.USER_EMAIL,
144144
value="admin@example.com",
145145
)

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)