diff --git a/packages/uipath_langchain_client/CHANGELOG.md b/packages/uipath_langchain_client/CHANGELOG.md index c42e951..da3519e 100644 --- a/packages/uipath_langchain_client/CHANGELOG.md +++ b/packages/uipath_langchain_client/CHANGELOG.md @@ -2,6 +2,11 @@ All notable changes to `uipath_langchain_client` will be documented in this file. +## [1.9.7] - 2026-04-22 + +### Changed +- **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. + ## [1.9.6] - 2026-04-22 ### Added diff --git a/packages/uipath_langchain_client/src/uipath_langchain_client/__version__.py b/packages/uipath_langchain_client/src/uipath_langchain_client/__version__.py index cc17247..40fb322 100644 --- a/packages/uipath_langchain_client/src/uipath_langchain_client/__version__.py +++ b/packages/uipath_langchain_client/src/uipath_langchain_client/__version__.py @@ -1,3 +1,3 @@ __title__ = "UiPath LangChain Client" __description__ = "A Python client for interacting with UiPath's LLM services via LangChain." -__version__ = "1.9.6" +__version__ = "1.9.7" diff --git a/packages/uipath_langchain_client/src/uipath_langchain_client/clients/normalized/chat_models.py b/packages/uipath_langchain_client/src/uipath_langchain_client/clients/normalized/chat_models.py index 7a26887..88a7040 100644 --- a/packages/uipath_langchain_client/src/uipath_langchain_client/clients/normalized/chat_models.py +++ b/packages/uipath_langchain_client/src/uipath_langchain_client/clients/normalized/chat_models.py @@ -214,12 +214,12 @@ def _identifying_params(self) -> dict[str, Any]: @property def _default_params(self) -> dict[str, Any]: """Get the default parameters for the normalized API request.""" - exclude_if_none = { + candidates: dict[str, Any] = { "max_tokens": self.max_tokens, "temperature": self.temperature, "top_p": self.top_p, "top_k": self.top_k, - "stop": self.stop or None, + "stop": self.stop, "n": self.n, "frequency_penalty": self.frequency_penalty, "presence_penalty": self.presence_penalty, @@ -242,8 +242,9 @@ def _default_params(self) -> dict[str, Any]: "verbosity": self.verbosity, } + set_fields = self.model_fields_set return { - **{k: v for k, v in exclude_if_none.items() if v is not None}, + **{k: v for k, v in candidates.items() if k in set_fields}, **self.model_kwargs, }