Skip to content
Closed
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 packages/uipath/pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[project]
name = "uipath"
version = "2.10.81"
version = "2.10.82"
description = "Python SDK and CLI for UiPath Platform, enabling programmatic interaction with automation services, process management, and deployment tools."
readme = { file = "README.md", content-type = "text/markdown" }
requires-python = ">=3.11"
Expand Down
3 changes: 3 additions & 0 deletions packages/uipath/src/uipath/eval/evaluators/base_evaluator.py
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,9 @@ def validate_model(cls, values: Any) -> Any:
ValueError: If types cannot be determined or are inconsistent
"""
if isinstance(values, dict):
# The C# layer sends evaluatorConfig: null when omitted — treat as {}
if values.get("evaluatorConfig", {}) is None:
values["evaluatorConfig"] = {}
if "description" in values and "evaluatorConfig" in values:
values["evaluatorConfig"]["description"] = values.pop("description")
Comment on lines +124 to 128
if "name" in values and "evaluatorConfig" in values:
Expand Down
41 changes: 41 additions & 0 deletions packages/uipath/tests/evaluators/test_evaluator_factory.py
Original file line number Diff line number Diff line change
Expand Up @@ -448,3 +448,44 @@ def test_property_setters_work(self) -> None:

assert evaluator.name == "UpdatedName"
assert evaluator.description == "Updated description"


class TestNullToleranceInEvaluatorCreation:
"""Null evaluatorConfig must not break evaluator creation.

The C# layer (EvaluatorConfigDto) sends explicit JSON nulls for omitted fields,
so a payload like {"name": "x", "evaluatorConfig": null} must behave the same
as one with an empty config object.
"""

def test_null_evaluator_config_with_top_level_name(self) -> None:
"""evaluatorConfig: null with a top-level name creates the evaluator."""
evaluator = EvaluatorFactory.create_evaluator(
{
"version": "1.0",
"id": "TestExactMatch",
"name": "evaluator-exact-match",
"evaluatorTypeId": "uipath-exact-match",
"evaluatorConfig": None,
}
)

assert isinstance(evaluator, ExactMatchEvaluator)
assert evaluator.name == "evaluator-exact-match"
assert evaluator.evaluator_config.default_evaluation_criteria is None

def test_null_evaluator_config_with_description(self) -> None:
"""evaluatorConfig: null alongside a top-level description is tolerated."""
evaluator = EvaluatorFactory.create_evaluator(
{
"version": "1.0",
"id": "TestToolCallCount",
"name": "evaluator-tool-call-count",
"description": "counts tool calls",
"evaluatorTypeId": "uipath-tool-call-count",
"evaluatorConfig": None,
}
)

assert isinstance(evaluator, ToolCallCountEvaluator)
assert evaluator.description == "counts tool calls"
2 changes: 1 addition & 1 deletion packages/uipath/uv.lock

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

Loading