Skip to content

Commit a2bbd46

Browse files
authored
Merge branch 'main' into feat/python-job-api-user-token
2 parents 595e2d0 + 80d6735 commit a2bbd46

4 files changed

Lines changed: 62 additions & 4 deletions

File tree

‎packages/uipath/pyproject.toml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[project]
22
name = "uipath"
3-
version = "2.14.25"
3+
version = "2.14.26"
44
description = "Python SDK and CLI for UiPath Platform, enabling programmatic interaction with automation services, process management, and deployment tools."
55
readme = { file = "README.md", content-type = "text/markdown" }
66
requires-python = ">=3.11"

‎packages/uipath/src/uipath/agent/models/agent.py‎

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,7 @@ class AgentInternalToolType(str, CaseInsensitiveEnum):
128128
DEEP_RAG = "deep-rag"
129129
BATCH_TRANSFORM = "batch-transform"
130130
HTTP_REQUEST = "http-request"
131+
GENERATE_FILE = "generate-file"
131132

132133

133134
class AgentEscalationRecipientType(str, CaseInsensitiveEnum):
@@ -1066,12 +1067,21 @@ class AgentInternalHttpRequestToolProperties(BaseResourceProperties):
10661067
)
10671068

10681069

1070+
class AgentInternalGenerateFileToolProperties(BaseResourceProperties):
1071+
"""Agent internal generate file tool properties model."""
1072+
1073+
tool_type: Literal[AgentInternalToolType.GENERATE_FILE] = Field(
1074+
alias="toolType", default=AgentInternalToolType.GENERATE_FILE, frozen=True
1075+
)
1076+
1077+
10691078
AgentInternalToolProperties = Annotated[
10701079
Union[
10711080
AgentInternalAnalyzeFilesToolProperties,
10721081
AgentInternalDeepRagToolProperties,
10731082
AgentInternalBatchTransformToolProperties,
10741083
AgentInternalHttpRequestToolProperties,
1084+
AgentInternalGenerateFileToolProperties,
10751085
],
10761086
Field(discriminator="tool_type"),
10771087
_case_insensitive_enum_validator("tool_type", AgentInternalToolType, "toolType"),

‎packages/uipath/tests/agent/models/test_agent.py‎

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828
AgentIntegrationToolResourceConfig,
2929
AgentInternalBatchTransformToolProperties,
3030
AgentInternalDeepRagToolProperties,
31+
AgentInternalGenerateFileToolProperties,
3132
AgentInternalHttpRequestToolProperties,
3233
AgentInternalToolResourceConfig,
3334
AgentInternalToolType,
@@ -1757,6 +1758,53 @@ def test_agent_with_unknown_resource_type(self):
17571758
assert unknown_resource.name == "Future Resource"
17581759
assert unknown_resource.description == "A resource type that doesn't exist yet"
17591760

1761+
def test_agent_with_generate_file_tool(self):
1762+
json_data = {
1763+
"id": "test-generate-file",
1764+
"name": "Agent with Generate File",
1765+
"version": "1.0.0",
1766+
"settings": {
1767+
"model": "gpt-4o-2024-11-20",
1768+
"maxTokens": 16384,
1769+
"temperature": 0,
1770+
"engine": "basic-v1",
1771+
},
1772+
"inputSchema": {"type": "object", "properties": {}},
1773+
"outputSchema": {"type": "object", "properties": {}},
1774+
"resources": [
1775+
{
1776+
"$resourceType": "tool",
1777+
"type": "internal",
1778+
"referenceKey": None,
1779+
"name": "Generate File",
1780+
"isEnabled": True,
1781+
"description": "Create a file and attach it to the job.",
1782+
"properties": {"toolType": "generate-file"},
1783+
"inputSchema": {
1784+
"type": "object",
1785+
"properties": {"file_name": {"type": "string"}},
1786+
"required": ["file_name"],
1787+
},
1788+
"outputSchema": {"type": "object", "properties": {}},
1789+
"settings": {},
1790+
"argumentProperties": {},
1791+
"guardrail": {"policies": []},
1792+
}
1793+
],
1794+
"messages": [{"role": "system", "content": "Test system message"}],
1795+
}
1796+
1797+
config: AgentDefinition = TypeAdapter(AgentDefinition).validate_python(
1798+
json_data
1799+
)
1800+
1801+
tool_resource = config.resources[0]
1802+
assert isinstance(tool_resource, AgentInternalToolResourceConfig)
1803+
assert isinstance(
1804+
tool_resource.properties, AgentInternalGenerateFileToolProperties
1805+
)
1806+
assert tool_resource.properties.tool_type == AgentInternalToolType.GENERATE_FILE
1807+
17601808
def test_agent_with_unknown_tool_type(self):
17611809
"""Test that AgentDefinition handles unknown tool types gracefully"""
17621810

‎packages/uipath/uv.lock‎

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)