Skip to content

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

Merged
tudormatei1 merged 2 commits into
mainfrom
feat/model-specific-settings
Sep 2, 2026
Merged

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

Conversation

@tudormatei1

Copy link
Copy Markdown
Contributor

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
@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

@tudormatei1
tudormatei1 force-pushed the feat/model-specific-settings branch from 91d2fee to 7dc8358 Compare September 2, 2026 08:46
@github-actions

github-actions Bot commented Sep 2, 2026

Copy link
Copy Markdown

🚨 Heads up: uipath-langchain cross-tests are FAILING 🚨

Your changes may break the uipath-langchain-python integration.

⚠️ These checks are NOT enforced by branch protection rules. Please review the failures before merging.

🔍 Inspect the failed run →

@sonarqubecloud

sonarqubecloud Bot commented Sep 2, 2026

Copy link
Copy Markdown

@tudormatei1
tudormatei1 merged commit 5f80998 into main Sep 2, 2026
259 of 261 checks passed
@tudormatei1
tudormatei1 deleted the feat/model-specific-settings branch September 2, 2026 09:13
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.

3 participants