Skip to content

feat(agent): add modelSettings to agent settings [PC-4672] - #1837

Open
tudormatei1 wants to merge 2 commits into
mainfrom
feat/model-specific-settings
Open

feat(agent): add modelSettings to agent settings [PC-4672]#1837
tudormatei1 wants to merge 2 commits into
mainfrom
feat/model-specific-settings

Conversation

@tudormatei1

Copy link
Copy Markdown

Add a modelSettings block to settings in agent.json, parsed into AgentSettings.model_settings. It's a native bag (ModelSettings(BaseCfg), no declared fields); keys are the target model's own parameter names and are forwarded verbatim, so discovery stays the source of truth for the shape. Absent modelSettings parses to None, keeping existing agent.json working.

@github-actions github-actions Bot added test:uipath-langchain Triggers tests in the uipath-langchain-python repository test:uipath-runtime test:uipath-integrations labels Jul 31, 2026
@tudormatei1 tudormatei1 changed the title feat(agent): add modelSettings to agent settings feat(agent): add modelSettings to agent settings [PC-4672] Jul 31, 2026
@tudormatei1
tudormatei1 force-pushed the feat/model-specific-settings branch from 3cee6ff to 2ded5a6 Compare August 3, 2026 09:31
@tudormatei1
tudormatei1 force-pushed the feat/model-specific-settings branch from cad9cdf to be0b0c6 Compare August 13, 2026 15:32
@tudormatei1
tudormatei1 marked this pull request as ready for review August 13, 2026 15:33
Copilot AI lite review requested due to automatic review settings August 13, 2026 15:33

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds support in the UiPath Python SDK’s agent definition models for a provider-native settings.modelSettings block (a free-form “bag” of model parameters) so agent.json can carry model-specific tuning options without the SDK needing a fixed schema.

Changes:

  • Introduce ModelSettings and add AgentSettings.model_settings (aliased to modelSettings) to preserve arbitrary provider parameters.
  • Add unit tests validating modelSettings is optional and round-trips verbatim via alias-based dump.
  • Bump uipath package version to 2.15.0 and update the lockfile accordingly.

Reviewed changes

Copilot reviewed 3 out of 4 changed files in this pull request and generated no comments.

File Description
packages/uipath/src/uipath/agent/models/agent.py Adds ModelSettings bag model and wires modelSettings into AgentSettings.
packages/uipath/tests/agent/models/test_agent.py Adds coverage for absent/present modelSettings behavior and verbatim round-trip.
packages/uipath/pyproject.toml Bumps package version to 2.15.0.
packages/uipath/uv.lock Updates locked uipath version entry to 2.15.0.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@tudormatei1
tudormatei1 force-pushed the feat/model-specific-settings branch from be0b0c6 to 91d2fee Compare August 18, 2026 08:27
@sonarqubecloud

Copy link
Copy Markdown

@UiPath UiPath deleted a comment from github-actions Bot Aug 18, 2026
@tudormatei1
tudormatei1 requested a lite review from Copilot August 18, 2026 08:50

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 3 out of 4 changed files in this pull request and generated no new comments.

Suppressed comments (3)

packages/uipath/src/uipath/agent/models/agent.py:1427

  • ModelSettings is an empty Pydantic model, which makes the public API for a 'native bag' ambiguous: consumers will get a ModelSettings instance (not a dict), and whether arbitrary keys are accepted/preserved depends implicitly on BaseCfg's extra behavior. To make the passthrough contract explicit and stable, consider modeling this as Optional[dict[str, Any]] (most direct) or as a RootModel[dict[str, Any]] / explicitly configuring ModelSettings to allow and preserve extra keys (so future BaseCfg changes won't break this).
class ModelSettings(BaseCfg):
    """Provider-native model settings bag (``settings.modelSettings``).

    Keys are the target model's own parameter names, forwarded verbatim — no fixed
    schema; discovery is the source of truth for the shape.
    """


packages/uipath/src/uipath/agent/models/agent.py:1438

  • ModelSettings is an empty Pydantic model, which makes the public API for a 'native bag' ambiguous: consumers will get a ModelSettings instance (not a dict), and whether arbitrary keys are accepted/preserved depends implicitly on BaseCfg's extra behavior. To make the passthrough contract explicit and stable, consider modeling this as Optional[dict[str, Any]] (most direct) or as a RootModel[dict[str, Any]] / explicitly configuring ModelSettings to allow and preserve extra keys (so future BaseCfg changes won't break this).
    model_settings: Optional[ModelSettings] = Field(None, alias="modelSettings")

packages/uipath/tests/agent/models/test_agent.py:4780

  • The tests cover non-empty passthrough via alias, but they don't cover the edge case of an explicitly empty bag. Adding a case asserting that modelSettings={} round-trips to {} (and is not coerced to None / omitted) would better lock in the 'verbatim bag' behavior.
    def test_native_bag_survives_verbatim_by_alias(self):
        native = {
            "thinking": {"type": "enabled", "budget_tokens": 2048},
            "output_config": {"effort": "high"},
        }
        settings = AgentSettings.model_validate(
            self._agent_settings(modelSettings=native)
        )
        assert settings.model_dump(by_alias=True)["modelSettings"] == native

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

test:uipath-integrations test:uipath-langchain Triggers tests in the uipath-langchain-python repository test:uipath-runtime

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants