Skip to content

Commit 5f80998

Browse files
authored
feat(agent): add modelSettings to agent settings [PC-4672] (#1837)
1 parent 97a1630 commit 5f80998

4 files changed

Lines changed: 39 additions & 2 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.10"
3+
version = "2.14.11"
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: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1417,6 +1417,14 @@ class AgentByomProperties(BaseCfg):
14171417
connector_key: str = Field(alias="connectorKey")
14181418

14191419

1420+
class ModelSettings(BaseCfg):
1421+
"""Provider-native model settings bag (``settings.modelSettings``).
1422+
1423+
Keys are the target model's own parameter names, forwarded verbatim — no fixed
1424+
schema; discovery is the source of truth for the shape.
1425+
"""
1426+
1427+
14201428
class AgentSettings(BaseCfg):
14211429
"""Agent settings model."""
14221430

@@ -1427,6 +1435,7 @@ class AgentSettings(BaseCfg):
14271435
byom_properties: Optional[AgentByomProperties] = Field(None, alias="byomProperties")
14281436
max_iterations: Optional[int] = Field(None, alias="maxIterations")
14291437
persona: Optional[str] = Field(None, alias="persona")
1438+
model_settings: Optional[ModelSettings] = Field(None, alias="modelSettings")
14301439

14311440

14321441
class AgentDefinition(BaseModel):

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

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@
3939
AgentProcessToolResourceConfig,
4040
AgentQuickFormChannelProperties,
4141
AgentResourceType,
42+
AgentSettings,
4243
AgentToolArgumentPropertiesVariant,
4344
AgentToolType,
4445
AgentUnknownGuardrail,
@@ -4750,3 +4751,30 @@ def test_literal_recipient_without_source_still_parses_to_literal_class(self):
47504751
).validate_python(payload)
47514752
assert isinstance(recipient, CustomAssigneesRecipient)
47524753
assert not isinstance(recipient, ToolOutputRecipient)
4754+
4755+
4756+
class TestAgentModelSettings:
4757+
"""settings.modelSettings is a native bag forwarded verbatim (no schema)."""
4758+
4759+
def _agent_settings(self, **extra: Any) -> dict[str, Any]:
4760+
return {
4761+
"engine": "basic-v2",
4762+
"model": "anthropic.claude-opus-4-6-v1",
4763+
"maxTokens": 49047,
4764+
"temperature": 0.63,
4765+
**extra,
4766+
}
4767+
4768+
def test_absent_model_settings_is_none(self):
4769+
settings = AgentSettings.model_validate(self._agent_settings())
4770+
assert settings.model_settings is None
4771+
4772+
def test_native_bag_survives_verbatim_by_alias(self):
4773+
native = {
4774+
"thinking": {"type": "enabled", "budget_tokens": 2048},
4775+
"output_config": {"effort": "high"},
4776+
}
4777+
settings = AgentSettings.model_validate(
4778+
self._agent_settings(modelSettings=native)
4779+
)
4780+
assert settings.model_dump(by_alias=True)["modelSettings"] == native

‎packages/uipath/uv.lock‎

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)