Skip to content

Commit c914f29

Browse files
valentinabojanValentina Bojan
andauthored
fix: add missing data on guardrail node metadata (#480)
Co-authored-by: Valentina Bojan <valentina.bojan@uipath.com>
1 parent eff3740 commit c914f29

6 files changed

Lines changed: 18 additions & 2 deletions

File tree

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[project]
22
name = "uipath-langchain"
3-
version = "0.5.5"
3+
version = "0.5.6"
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"

src/uipath_langchain/agent/guardrails/actions/block_action.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ async def _node(_state: AgentGuardrailsGraphState):
4444
"guardrail": guardrail,
4545
"scope": scope,
4646
"execution_stage": execution_stage,
47+
"action_type": "Block",
4748
}
4849

4950
return node_name, _node

src/uipath_langchain/agent/guardrails/actions/escalate_action.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -165,6 +165,13 @@ async def _node(
165165
detail=f"Please contact your administrator. Action was rejected after reviewing the task created by guardrail [{guardrail.name}], with reason: {escalation_result.data['Reason']}",
166166
)
167167

168+
_node.__metadata__ = { # type: ignore[attr-defined]
169+
"guardrail": guardrail,
170+
"scope": scope,
171+
"execution_stage": execution_stage,
172+
"action_type": "Escalate",
173+
}
174+
168175
return node_name, _node
169176

170177

src/uipath_langchain/agent/guardrails/actions/filter_action.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,13 @@ async def _node(
7575
category=UiPathErrorCategory.USER,
7676
)
7777

78+
_node.__metadata__ = { # type: ignore[attr-defined]
79+
"guardrail": guardrail,
80+
"scope": scope,
81+
"execution_stage": execution_stage,
82+
"action_type": "Filter",
83+
}
84+
7885
return node_name, _node
7986

8087

src/uipath_langchain/agent/guardrails/actions/log_action.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@ async def _node(_state: AgentGuardrailsGraphState) -> dict[str, Any]:
6060
"guardrail": guardrail,
6161
"scope": scope,
6262
"execution_stage": execution_stage,
63+
"action_type": "Log",
6364
}
6465

6566
return node_name, _node

uv.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)