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 packages/uipath/pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[project]
name = "uipath"
version = "2.14.35"
version = "2.14.36"
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
5 changes: 3 additions & 2 deletions packages/uipath/src/uipath/agent/models/agent.py
Original file line number Diff line number Diff line change
Expand Up @@ -1242,10 +1242,11 @@ class AgentInternalJevClassifierSettings(BaseCfg):

Only the configuration that is never a call argument: the ``state`` and
``questions`` the tool sends to Jev are declared in the resource's
``inputSchema`` and supplied through its ``argumentProperties``.
``inputSchema`` and supplied through its ``argumentProperties``. The model
is required: there is no default Jev model.
"""

model: str = Field("jev-latest")
model: str = Field(..., min_length=1)


class AgentIntegrationToolResourceConfig(BaseAgentToolResourceConfig):
Expand Down
22 changes: 16 additions & 6 deletions packages/uipath/tests/agent/models/test_jev_classifier_tool.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,12 +83,18 @@
assert _settings(resource).model_dump() == {"model": "jev-1.13.0"}


def test_model_defaults_to_latest() -> None:
assert _settings(_validate(_resource())).model == "jev-latest"
@pytest.mark.parametrize(
"settings",
[pytest.param({}, id="missing"), pytest.param({"model": ""}, id="empty")],
)
def test_model_is_required(settings: dict[str, Any]) -> None:
# No default Jev model: a tool without one fails to load.
with pytest.raises(ValidationError, match="model"):

Check warning on line 92 in packages/uipath/tests/agent/models/test_jev_classifier_tool.py

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Refactor this exception test to have only one invocation possibly throwing an exception.

See more on https://sonarcloud.io/project/issues?id=UiPath_uipath-python&issues=AaEWuDaIJByHtQf2_d-e&open=AaEWuDaIJByHtQf2_d-e&pullRequest=1930
_validate(_resource(**settings))


def test_tool_type_is_case_insensitive() -> None:
data = _resource()
data = _resource(model="jev-1.13.0")
data["properties"]["toolType"] = "Jev-Classifier"

assert isinstance(
Expand All @@ -100,11 +106,15 @@
# BaseCfg allows extra fields: settings written before questions and state
# moved to inputSchema still parse, but nothing reads or validates them.
resource = _validate(
_resource(state={"type": "number"}, questions=[{"type": "freeform"}])
_resource(
model="jev-1.13.0",
state={"type": "number"},
questions=[{"type": "freeform"}],
)
)

settings = _settings(resource)
assert settings.model == "jev-latest"
assert settings.model == "jev-1.13.0"
assert not hasattr(AgentInternalJevClassifierSettings, "questions")
assert settings.model_extra == {
"state": {"type": "number"},
Expand Down Expand Up @@ -207,7 +217,7 @@


def test_parses_object_builder_argument_properties() -> None:
raw = _resource()
raw = _resource(model="jev-1.13.0")
raw["argumentProperties"] = {
"$['questions']": {"variant": "ObjectBuilder"},
"$['questions']['department']": {"variant": "objectBuilder"},
Expand Down
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