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-runtime"
version = "0.2.8"
version = "0.2.9"
description = "Runtime abstractions and interfaces for building agents and automation scripts in the UiPath ecosystem"
readme = { file = "README.md", content-type = "text/markdown" }
requires-python = ">=3.11"
Expand Down
2 changes: 2 additions & 0 deletions src/uipath/runtime/result.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@ def to_dict(self) -> dict[str, Any]:
output_data = {}
elif isinstance(self.output, BaseModel):
output_data = self.output.model_dump()
elif isinstance(self.output, str):
output_data = {"output": self.output}
else:
output_data = self.output

Expand Down
13 changes: 13 additions & 0 deletions tests/test_context.py
Original file line number Diff line number Diff line change
Expand Up @@ -234,3 +234,16 @@ def test_from_config_loads_runtime_and_fps_properties(tmp_path: Path) -> None:
assert ctx.message_id == "msg-ghi"
assert ctx.mcp_server_id == "mcp-server-456"
assert ctx.mcp_server_slug == "test-server-slug"


def test_string_output_wrapped_in_dict() -> None:
"""Test that string output is wrapped in a dict with key 'output'."""
result = UiPathRuntimeResult(
status=UiPathRuntimeStatus.SUCCESSFUL,
output="primitive str",
)

result_dict = result.to_dict()

assert result_dict["output"] == {"output": "primitive str"}
assert result_dict["status"] == UiPathRuntimeStatus.SUCCESSFUL
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.