From d6ee96deb968d5a3b18c281eaa07c4d8ca4a64cd Mon Sep 17 00:00:00 2001 From: Akshaya Shanbhogue Date: Thu, 9 Oct 2025 18:46:08 -0700 Subject: [PATCH] feat(MockingOverrides): allow schema overrides for mockable Similar to ``@tool(args_schema=..`, we now support overriding `input_schema` and `output_schema` for `@mockable` functions. This will help with dynamic schemas from resources. --- pyproject.toml | 2 +- src/uipath/eval/mocks/mockable.py | 6 ++++-- uv.lock | 2 +- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 49359634f..4f24945e0 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "uipath" -version = "2.1.78" +version = "2.1.79" 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.10" diff --git a/src/uipath/eval/mocks/mockable.py b/src/uipath/eval/mocks/mockable.py index bf659561e..a8e03e625 100644 --- a/src/uipath/eval/mocks/mockable.py +++ b/src/uipath/eval/mocks/mockable.py @@ -82,6 +82,8 @@ def get_input_schema(func): def mockable( name: Optional[str] = None, description: Optional[str] = None, + input_schema: Optional[dict[str, Any]] = None, + output_schema: Optional[dict[str, Any]] = None, example_calls: Optional[List[ExampleCall]] = None, **kwargs, ): @@ -91,8 +93,8 @@ def decorator(func): params = { "name": name or func.__name__, "description": description or func.__doc__, - "input_schema": get_input_schema(func), - "output_schema": get_output_schema(func), + "input_schema": input_schema or get_input_schema(func), + "output_schema": output_schema or get_output_schema(func), "example_calls": example_calls, **kwargs, } diff --git a/uv.lock b/uv.lock index a2539d5db..6d6023349 100644 --- a/uv.lock +++ b/uv.lock @@ -2146,7 +2146,7 @@ wheels = [ [[package]] name = "uipath" -version = "2.1.78" +version = "2.1.79" source = { editable = "." } dependencies = [ { name = "azure-monitor-opentelemetry" },