From a76e5e9ce59e4290324556f3bab0974a6870614e Mon Sep 17 00:00:00 2001 From: Andrei Ancuta Date: Wed, 10 Dec 2025 18:16:37 +0200 Subject: [PATCH 1/4] feat: add content_tokens to message model --- src/uipath/agent/models/agent.py | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/src/uipath/agent/models/agent.py b/src/uipath/agent/models/agent.py index b1e23e341..800113ad8 100644 --- a/src/uipath/agent/models/agent.py +++ b/src/uipath/agent/models/agent.py @@ -75,6 +75,14 @@ class AgentGuardrailActionType(str, Enum): UNKNOWN = "unknown" # fallback branch discriminator +class TextTokenType(str, Enum): + """Text token type enumeration.""" + + SIMPLE_TEXT = "simpleText" + VARIABLE = "variable" + EXPRESSION = "expression" + + class BaseCfg(BaseModel): """Base configuration model with common settings.""" @@ -83,6 +91,13 @@ class BaseCfg(BaseModel): ) +class TextToken(BaseCfg): + """Text token model.""" + + type: TextTokenType + raw_string: str = Field(alias="rawString") + + class BaseResourceProperties(BaseCfg): """Base resource properties model.""" @@ -594,6 +609,7 @@ class AgentMessage(BaseCfg): role: Literal[AgentMessageRole.SYSTEM, AgentMessageRole.USER] content: str + content_tokens: Optional[List[TextToken]] = Field(None, alias="contentTokens") @field_validator("role", mode="before") @classmethod From 8f0318934f9f3952881700aebdbf5fc62158d718 Mon Sep 17 00:00:00 2001 From: Andrei Ancuta Date: Wed, 10 Dec 2025 18:40:37 +0200 Subject: [PATCH 2/4] feat: add argument_properties to agent model --- src/uipath/agent/models/agent.py | 61 ++++++++++++++++++++++++++++++++ 1 file changed, 61 insertions(+) diff --git a/src/uipath/agent/models/agent.py b/src/uipath/agent/models/agent.py index 800113ad8..23bd17fea 100644 --- a/src/uipath/agent/models/agent.py +++ b/src/uipath/agent/models/agent.py @@ -75,6 +75,15 @@ class AgentGuardrailActionType(str, Enum): UNKNOWN = "unknown" # fallback branch discriminator +class AgentToolArgumentPropertiesVariant(str, Enum): + """Agent tool argument properties variant enumeration.""" + + DYNAMIC = "dynamic" + ARGUMENT = "argument" + STATIC = "static" + TEXT_BUILDER = "textBuilder" + + class TextTokenType(str, Enum): """Text token type enumeration.""" @@ -98,6 +107,52 @@ class TextToken(BaseCfg): raw_string: str = Field(alias="rawString") +class BaseAgentToolArgumentProperties(BaseCfg): + """Base tool argument properties model.""" + + variant: AgentToolArgumentPropertiesVariant + is_sensitive: bool = Field(alias="isSensitive") + + +class AgentToolStaticArgumentProperties(BaseAgentToolArgumentProperties): + """Static tool argument properties model.""" + + variant: Literal[AgentToolArgumentPropertiesVariant.STATIC] = Field( + default=AgentToolArgumentPropertiesVariant.STATIC, frozen=True + ) + value: Optional[Any] + + +class AgentToolArgumentArgumentProperties(BaseAgentToolArgumentProperties): + """Agent argument argument properties model.""" + + variant: Literal[AgentToolArgumentPropertiesVariant.ARGUMENT] = Field( + default=AgentToolArgumentPropertiesVariant.ARGUMENT, + frozen=True, + ) + argument_path: str = Field(alias="argumentPath") + + +class AgentToolTextBuilderArgumentProperties(BaseAgentToolArgumentProperties): + """Agent text builder argument properties model.""" + + variant: Literal[AgentToolArgumentPropertiesVariant.TEXT_BUILDER] = Field( + default=AgentToolArgumentPropertiesVariant.TEXT_BUILDER, + frozen=True, + ) + tokens: List[TextToken] + + +AgentToolArgumentProperties = Annotated[ + Union[ + AgentToolStaticArgumentProperties, + AgentToolArgumentArgumentProperties, + AgentToolTextBuilderArgumentProperties, + ], + Field(discriminator="variant"), +] + + class BaseResourceProperties(BaseCfg): """Base resource properties model.""" @@ -204,6 +259,9 @@ class AgentMcpTool(BaseCfg): name: str = Field(..., alias="name") description: str = Field(..., alias="description") input_schema: Dict[str, Any] = Field(..., alias="inputSchema") + argument_properties: Dict[str, AgentToolArgumentProperties] = Field( + {}, alias="argumentProperties" + ) class AgentMcpResourceConfig(BaseAgentResourceConfig): @@ -297,6 +355,9 @@ class AgentProcessToolProperties(BaseResourceProperties): folder_path: Optional[str] = Field(None, alias="folderPath") process_name: Optional[str] = Field(None, alias="processName") + argument_properties: Dict[str, AgentToolArgumentProperties] = Field( + {}, alias="argumentProperties" + ) class AgentProcessToolResourceConfig(BaseAgentToolResourceConfig): From fef851960d0d977f9b1f9abc4b64bdb8ae73d5c8 Mon Sep 17 00:00:00 2001 From: Andrei Ancuta Date: Wed, 10 Dec 2025 18:43:12 +0200 Subject: [PATCH 3/4] feat: bump version --- pyproject.toml | 2 +- uv.lock | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 460e0a52a..2276a3980 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "uipath" -version = "2.2.30" +version = "2.2.31" 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" diff --git a/uv.lock b/uv.lock index dd5f91feb..4e7f21aed 100644 --- a/uv.lock +++ b/uv.lock @@ -2477,7 +2477,7 @@ wheels = [ [[package]] name = "uipath" -version = "2.2.30" +version = "2.2.31" source = { editable = "." } dependencies = [ { name = "click" }, From ad7def4c00daa37480dbbfdaa28a82c68037c5f7 Mon Sep 17 00:00:00 2001 From: Andrei Ancuta Date: Thu, 11 Dec 2025 15:19:20 +0200 Subject: [PATCH 4/4] feat: add new fields to test json --- tests/agent/models/test_agent.py | 52 +++++++++++++++++++++++++++++++- 1 file changed, 51 insertions(+), 1 deletion(-) diff --git a/tests/agent/models/test_agent.py b/tests/agent/models/test_agent.py index 4b5358852..3c1af5c5a 100644 --- a/tests/agent/models/test_agent.py +++ b/tests/agent/models/test_agent.py @@ -38,10 +38,41 @@ def test_agent_with_all_tool_types_loads(self): "name": "Agent with All Tools", "metadata": {"isConversational": False, "storageVersion": "22.0.0"}, "messages": [ - {"role": "System", "content": "You are an agentic assistant."}, + { + "role": "System", + "content": "You are an agentic assistant.", + "contentTokens": [ + { + "type": "simpleText", + "rawString": "You are an agentic assistant.", + } + ], + }, { "role": "User", "content": "Use the provided tools. Execute {{task}} the number of {{times}}.", + "contentTokens": [ + { + "type": "simpleText", + "rawString": "Use the provided tools. Execute ", + }, + { + "type": "variable", + "rawString": "input.task", + }, + { + "type": "simpleText", + "rawString": " the number of ", + }, + { + "type": "variable", + "rawString": "input.times", + }, + { + "type": "simpleText", + "rawString": ".", + }, + ], }, ], "inputSchema": { @@ -225,6 +256,13 @@ def test_agent_with_all_tool_types_loads(self): "properties": {"output": {"type": "string"}}, }, "settings": {}, + "argumentProperties": { + "task": { + "variant": "argument", + "argumentPath": "$['task']", + "isSensitive": False, + } + }, "properties": { "processName": "Basic RPA Process", "folderPath": "TestFolder/Complete Solution 30 Sept", @@ -270,6 +308,18 @@ def test_agent_with_all_tool_types_loads(self): }, "required": ["timezone"], }, + "argumentProperties": { + "timezone": { + "variant": "textBuilder", + "tokens": [ + { + "type": "simpleText", + "rawString": "Europe/London", + }, + ], + "isSensitive": False, + }, + }, }, { "name": "convert_time",