fix(llm): exclude sampling params for reasoning models#1822
Conversation
…s (o1, o3, o4) Bump uipath to 2.13.13. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
There was a problem hiding this comment.
Pull request overview
This PR updates the UiPath LLM Gateway client(s) to avoid sending OpenAI sampling parameters that cause 400s for OpenAI “reasoning” models (o1/o3/o4), and bumps the uipath package version accordingly.
Changes:
- Filter out
temperaturefor reasoning models inUiPathOpenAIService.chat_completions. - Filter out
temperature,n,frequency_penalty,presence_penalty, andtop_pfor reasoning models inUiPathLlmChatService.chat_completions. - Add tests covering reasoning-model filtering for the normalized LLM service; bump
uipathto2.13.13.
Reviewed changes
Copilot reviewed 3 out of 4 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| packages/uipath-platform/src/uipath/platform/chat/_llm_gateway_service.py | Adds reasoning-model detection and excludes unsupported params from request bodies. |
| packages/uipath-platform/tests/services/test_llm_service.py | Adds tests asserting reasoning models exclude sampling params (normalized API). |
| packages/uipath/pyproject.toml | Bumps uipath version to 2.13.13. |
| packages/uipath/uv.lock | Updates lockfile version entry for uipath to 2.13.13. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…ests Covers the passthrough (non-normalized) API path that also conditionally omits temperature for o1/o3/o4 models. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
|
| # Build request body - some models don't support certain parameters | ||
| model_lower = model.lower() | ||
| is_claude_model = "claude" in model_lower | ||
| is_reasoning_model = model_lower.startswith(("o1", "o3", "o4")) |
There was a problem hiding this comment.
using model name is unreliable sadly. But I think this is a best effort we can live with.
Chibionos
left a comment
There was a problem hiding this comment.
closest fix as BYOM can bring custom names too.
0.2.11 was released to PyPI from main (#1822) without this change, so this PR ships as 0.2.12. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>



Jira
SRE-625200
Summary
temperature,n,frequency_penalty,presence_penalty, andtop_pfor OpenAI reasoning models (o1, o3, o4) which don't support these parameters and return 400 errors when they're included.UiPathOpenAIServiceandUiPathLlmChatService.uipathversion to 2.13.13.Failure Details (from SRE-625200)
Alert:
agents-eu-prd-agents-evalrun-failed-urt-[Agent Evaluations]-logalertv2-jaeDescription: Monitors
EvalRun.FailedandEvalSetRun.Failedevents with URT runtime whenErrorMessageis not null. The alert fired in thejae(Japan East) region on 2026-07-18.Alert details:
jae(Japan East)2026-07-18T06:12:26Zand2026-07-18T06:27:26ZRoot cause: OpenAI reasoning models (o1, o3, o4) do not support
temperatureand other sampling parameters (n,frequency_penalty,presence_penalty,top_p). Sending these parameters causes 400 errors, which surface asEvalRun.Failedevents.Search query that triggered the alert:
Test plan
🤖 Generated with Claude Code