Skip to content
Merged
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
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[project]
name = "uipath-langchain"
version = "0.9.18"
version = "0.9.19"
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 Down
12 changes: 11 additions & 1 deletion src/uipath_langchain/agent/guardrails/guardrails_factory.py
Original file line number Diff line number Diff line change
Expand Up @@ -315,8 +315,18 @@ def _compute_field_sources_for_guardrail(

# Deterministic guardrails have one single tool
if guardrail.selector.match_names and len(guardrail.selector.match_names) > 0:
match_name = guardrail.selector.match_names[0]
matching_tool = next(
(t for t in tools if t.name == guardrail.selector.match_names[0]), None
(
t
for t in tools
if t.name == match_name
or (
isinstance(t.metadata, dict)
and t.metadata.get("display_name") == match_name
)
),
None,
)

if matching_tool:
Expand Down
1 change: 1 addition & 0 deletions tests/agent/guardrails/test_guardrails_factory.py
Original file line number Diff line number Diff line change
Expand Up @@ -1179,6 +1179,7 @@ def test_convert_with_nonexistent_tool_raises_error(self) -> None:

mock_tool = Mock(spec=BaseTool)
mock_tool.name = "different_tool"
mock_tool.metadata = None

agent_guardrail = AgentCustomGuardrail.model_validate(
{
Expand Down
2 changes: 1 addition & 1 deletion uv.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading