Skip to content

Commit cfb4fea

Browse files
cosminachoclaude
andauthored
Feat: use _UNSET sentinel to exclude unset UiPathChat params from payload (#70)
Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent 4ad3bcf commit cfb4fea

3 files changed

Lines changed: 10 additions & 4 deletions

File tree

packages/uipath_langchain_client/CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,11 @@
22

33
All notable changes to `uipath_langchain_client` will be documented in this file.
44

5+
## [1.9.7] - 2026-04-22
6+
7+
### Changed
8+
- **Behavior change:** `UiPathChat._default_params` now uses pydantic's `model_fields_set` to decide which params to include in the request payload instead of filtering on `v is not None`. Fields that were not explicitly passed are omitted; fields explicitly set to `None` (e.g. `UiPathChat(temperature=None)`) now forward `null` to the API. Previously both "not passed" and "explicitly `None`" were silently dropped.
9+
510
## [1.9.6] - 2026-04-22
611

712
### Added
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
__title__ = "UiPath LangChain Client"
22
__description__ = "A Python client for interacting with UiPath's LLM services via LangChain."
3-
__version__ = "1.9.6"
3+
__version__ = "1.9.7"

packages/uipath_langchain_client/src/uipath_langchain_client/clients/normalized/chat_models.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -214,12 +214,12 @@ def _identifying_params(self) -> dict[str, Any]:
214214
@property
215215
def _default_params(self) -> dict[str, Any]:
216216
"""Get the default parameters for the normalized API request."""
217-
exclude_if_none = {
217+
candidates: dict[str, Any] = {
218218
"max_tokens": self.max_tokens,
219219
"temperature": self.temperature,
220220
"top_p": self.top_p,
221221
"top_k": self.top_k,
222-
"stop": self.stop or None,
222+
"stop": self.stop,
223223
"n": self.n,
224224
"frequency_penalty": self.frequency_penalty,
225225
"presence_penalty": self.presence_penalty,
@@ -242,8 +242,9 @@ def _default_params(self) -> dict[str, Any]:
242242
"verbosity": self.verbosity,
243243
}
244244

245+
set_fields = self.model_fields_set
245246
return {
246-
**{k: v for k, v in exclude_if_none.items() if v is not None},
247+
**{k: v for k, v in candidates.items() if k in set_fields},
247248
**self.model_kwargs,
248249
}
249250

0 commit comments

Comments
 (0)