From 969fc1fbb6e8eced4eba52012d74939b125ae6e0 Mon Sep 17 00:00:00 2001 From: Cosmin Maria Date: Fri, 17 Apr 2026 13:47:22 +0300 Subject: [PATCH 1/5] Fix: detect Anthropic-family models by additional name keywords Expand the model-name heuristic to treat `anthropic`, `opus`, `sonnet`, `haiku`, and `mythos` as Claude-family indicators alongside `claude`. Applies to the Bedrock INVOKE factory routing and the normalized client's empty tool-call content workaround. Co-Authored-By: Claude Opus 4.7 (1M context) --- packages/uipath_langchain_client/CHANGELOG.md | 5 +++++ .../src/uipath_langchain_client/__version__.py | 2 +- .../clients/normalized/chat_models.py | 5 ++++- .../src/uipath_langchain_client/factory.py | 10 +++++++++- 4 files changed, 19 insertions(+), 3 deletions(-) diff --git a/packages/uipath_langchain_client/CHANGELOG.md b/packages/uipath_langchain_client/CHANGELOG.md index 7f03f5c..85b68ec 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.1] - 2026-04-17 + +### Fixed +- Detect Anthropic-family models by additional name keywords (`anthropic`, `opus`, `sonnet`, `haiku`, `mythos`) alongside `claude` — applies to Bedrock INVOKE factory routing and the normalized client's empty tool-call content workaround + ## [1.9.0] - 2026-04-17 ### Changed 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 0876433..93fe019 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.0" +__version__ = "1.9.1" 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 a1d545e..71bc240 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 @@ -412,7 +412,10 @@ def _preprocess_request( converted_message["content"] = "" if ( self.model_name - and "claude" in self.model_name.lower() + and any( + kw in self.model_name.lower() + for kw in ("anthropic", "claude", "opus", "sonnet", "haiku", "mythos") + ) and not converted_message["content"] ): converted_message["content"] = "tool_call" diff --git a/packages/uipath_langchain_client/src/uipath_langchain_client/factory.py b/packages/uipath_langchain_client/src/uipath_langchain_client/factory.py index d73b43e..afaba73 100644 --- a/packages/uipath_langchain_client/src/uipath_langchain_client/factory.py +++ b/packages/uipath_langchain_client/src/uipath_langchain_client/factory.py @@ -172,7 +172,15 @@ def get_chat_model( **model_kwargs, ) case VendorType.AWSBEDROCK: - if model_family == ModelFamily.ANTHROPIC_CLAUDE and api_flavor is None: + if ( + model_family == ModelFamily.ANTHROPIC_CLAUDE and api_flavor != ApiFlavor.CONVERSE + ) or ( + api_flavor == ApiFlavor.INVOKE + and any( + kw in model_name.lower() + for kw in ("anthropic", "claude", "opus", "sonnet", "haiku", "mythos") + ) + ): from uipath_langchain_client.clients.bedrock.chat_models import ( UiPathChatAnthropicBedrock, ) From b0db28efda91942cea217effa1dccf72f5b230fc Mon Sep 17 00:00:00 2001 From: Cosmin Maria Date: Fri, 17 Apr 2026 13:57:34 +0300 Subject: [PATCH 2/5] Fix: BYOM Claude detection in LiteLLM client via shared name helper BYOM discovery does not expose modelFamily, so the LiteLLM client's is_claude checks silently fell through for custom-named Claude deployments. Extract the keyword heuristic into a shared is_anthropic_model_name() helper in core and use it as a fallback whenever modelFamily is None. Refactor the two langchain call sites to consume the same helper. Core 1.9.0 -> 1.9.1. Langchain now requires core >= 1.9.1. Co-Authored-By: Claude Opus 4.7 (1M context) --- CHANGELOG.md | 8 +++++++ packages/uipath_langchain_client/CHANGELOG.md | 5 +++- .../uipath_langchain_client/pyproject.toml | 2 +- .../clients/normalized/chat_models.py | 12 ++++++---- .../src/uipath_langchain_client/factory.py | 9 ++----- .../src/uipath_langchain_client/settings.py | 2 ++ src/uipath/llm_client/__version__.py | 2 +- .../llm_client/clients/litellm/client.py | 24 +++++++++---------- src/uipath/llm_client/settings/constants.py | 16 +++++++++++++ 9 files changed, 53 insertions(+), 27 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 1fb1d74..bf78252 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,14 @@ All notable changes to `uipath_llm_client` (core package) will be documented in this file. +## [1.9.1] - 2026-04-17 + +### Added +- `is_anthropic_model_name()` helper and `ANTHROPIC_MODEL_NAME_KEYWORDS` tuple in `settings.constants` — name-based Claude detection for BYOM deployments where discovery does not expose `modelFamily` + +### Fixed +- `UiPathLiteLLM` now detects Claude-family models by name when `modelFamily` is unavailable (BYOM), correctly routing Bedrock/Vertex provider selection and default flavors + ## [1.9.0] - 2026-04-17 ### Added diff --git a/packages/uipath_langchain_client/CHANGELOG.md b/packages/uipath_langchain_client/CHANGELOG.md index 85b68ec..b26b1a5 100644 --- a/packages/uipath_langchain_client/CHANGELOG.md +++ b/packages/uipath_langchain_client/CHANGELOG.md @@ -5,7 +5,10 @@ All notable changes to `uipath_langchain_client` will be documented in this file ## [1.9.1] - 2026-04-17 ### Fixed -- Detect Anthropic-family models by additional name keywords (`anthropic`, `opus`, `sonnet`, `haiku`, `mythos`) alongside `claude` — applies to Bedrock INVOKE factory routing and the normalized client's empty tool-call content workaround +- Detect Anthropic-family models by additional name keywords (`anthropic`, `opus`, `sonnet`, `haiku`, `mythos`) alongside `claude` — applies to Bedrock INVOKE factory routing and the normalized client's empty tool-call content workaround. Uses the shared `is_anthropic_model_name()` helper from core 1.9.1. + +### Changed +- Minimum `uipath-llm-client` bumped to 1.9.1 for the shared `is_anthropic_model_name()` helper ## [1.9.0] - 2026-04-17 diff --git a/packages/uipath_langchain_client/pyproject.toml b/packages/uipath_langchain_client/pyproject.toml index fe516b2..edfc140 100644 --- a/packages/uipath_langchain_client/pyproject.toml +++ b/packages/uipath_langchain_client/pyproject.toml @@ -6,7 +6,7 @@ readme = "README.md" requires-python = ">=3.11" dependencies = [ "langchain>=1.2.15", - "uipath-llm-client>=1.9.0", + "uipath-llm-client>=1.9.1", ] [project.optional-dependencies] 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 71bc240..9870015 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 @@ -65,7 +65,12 @@ from pydantic import AliasChoices, BaseModel, Field from uipath_langchain_client.base_client import UiPathBaseChatModel -from uipath_langchain_client.settings import ApiType, RoutingMode, UiPathAPIConfig +from uipath_langchain_client.settings import ( + ApiType, + RoutingMode, + UiPathAPIConfig, + is_anthropic_model_name, +) _DictOrPydanticClass = Union[dict[str, Any], type[BaseModel], type] _DictOrPydantic = Union[dict[str, Any], BaseModel] @@ -412,10 +417,7 @@ def _preprocess_request( converted_message["content"] = "" if ( self.model_name - and any( - kw in self.model_name.lower() - for kw in ("anthropic", "claude", "opus", "sonnet", "haiku", "mythos") - ) + and is_anthropic_model_name(self.model_name) and not converted_message["content"] ): converted_message["content"] = "tool_call" diff --git a/packages/uipath_langchain_client/src/uipath_langchain_client/factory.py b/packages/uipath_langchain_client/src/uipath_langchain_client/factory.py index afaba73..77118ab 100644 --- a/packages/uipath_langchain_client/src/uipath_langchain_client/factory.py +++ b/packages/uipath_langchain_client/src/uipath_langchain_client/factory.py @@ -35,6 +35,7 @@ UiPathBaseSettings, VendorType, get_default_client_settings, + is_anthropic_model_name, ) @@ -174,13 +175,7 @@ def get_chat_model( case VendorType.AWSBEDROCK: if ( model_family == ModelFamily.ANTHROPIC_CLAUDE and api_flavor != ApiFlavor.CONVERSE - ) or ( - api_flavor == ApiFlavor.INVOKE - and any( - kw in model_name.lower() - for kw in ("anthropic", "claude", "opus", "sonnet", "haiku", "mythos") - ) - ): + ) or (api_flavor == ApiFlavor.INVOKE and is_anthropic_model_name(model_name)): from uipath_langchain_client.clients.bedrock.chat_models import ( UiPathChatAnthropicBedrock, ) diff --git a/packages/uipath_langchain_client/src/uipath_langchain_client/settings.py b/packages/uipath_langchain_client/src/uipath_langchain_client/settings.py index 20a1514..d12b997 100644 --- a/packages/uipath_langchain_client/src/uipath_langchain_client/settings.py +++ b/packages/uipath_langchain_client/src/uipath_langchain_client/settings.py @@ -31,6 +31,7 @@ ModelFamily, RoutingMode, VendorType, + is_anthropic_model_name, ) __all__ = [ @@ -47,4 +48,5 @@ "VendorType", "API_FLAVOR_TO_VENDOR_TYPE", "BYOM_TO_ROUTING_FLAVOR", + "is_anthropic_model_name", ] diff --git a/src/uipath/llm_client/__version__.py b/src/uipath/llm_client/__version__.py index b7d80f3..e2f783d 100644 --- a/src/uipath/llm_client/__version__.py +++ b/src/uipath/llm_client/__version__.py @@ -1,3 +1,3 @@ __title__ = "UiPath LLM Client" __description__ = "A Python client for interacting with UiPath's LLM services." -__version__ = "1.9.0" +__version__ = "1.9.1" diff --git a/src/uipath/llm_client/clients/litellm/client.py b/src/uipath/llm_client/clients/litellm/client.py index 0f9ca01..c1ef517 100644 --- a/src/uipath/llm_client/clients/litellm/client.py +++ b/src/uipath/llm_client/clients/litellm/client.py @@ -34,6 +34,7 @@ ModelFamily, RoutingMode, VendorType, + is_anthropic_model_name, ) from uipath.llm_client.utils.retry import RetryConfig @@ -191,7 +192,6 @@ def _discover_and_build_api_config( model_info = self._client_settings.get_model_info(self._model_name, vendor_type=vendor_type) model_family = model_info.get("modelFamily", None) - discovered_vendor = model_info.get("vendor", None) discovered_flavor = model_info.get("apiFlavor", None) @@ -217,20 +217,18 @@ def _discover_and_build_api_config( if resolved_flavor is None and resolved_vendor in ("openai", "azure"): resolved_flavor = ApiFlavor.CHAT_COMPLETIONS + # Claude detection: modelFamily from discovery, or name heuristic for BYOM + # (BYOM discovery does not expose modelFamily). + is_claude = model_family == ModelFamily.ANTHROPIC_CLAUDE or ( + model_family is None and is_anthropic_model_name(self._model_name) + ) + # Claude on Bedrock defaults to invoke - if ( - resolved_flavor is None - and resolved_vendor == "awsbedrock" - and model_family == ModelFamily.ANTHROPIC_CLAUDE - ): + if resolved_flavor is None and resolved_vendor == "awsbedrock" and is_claude: resolved_flavor = ApiFlavor.INVOKE # Claude on Vertex defaults to anthropic-claude - if ( - resolved_flavor is None - and resolved_vendor == "vertexai" - and model_family == ModelFamily.ANTHROPIC_CLAUDE - ): + if resolved_flavor is None and resolved_vendor == "vertexai" and is_claude: resolved_flavor = ApiFlavor.ANTHROPIC_CLAUDE api_config = UiPathAPIConfig( @@ -247,7 +245,9 @@ def _resolve_llm_provider(self) -> str: The model_family disambiguates cases where the same vendor hosts models from different providers (e.g. Claude on Vertex AI or Bedrock). """ - is_claude = self._model_family == ModelFamily.ANTHROPIC_CLAUDE + is_claude = self._model_family == ModelFamily.ANTHROPIC_CLAUDE or ( + self._model_family is None and is_anthropic_model_name(self._model_name) + ) vendor = str(self._api_config.vendor_type or "openai") # Claude on Vertex AI → vertex_ai (uses VertexAIAnthropicConfig) diff --git a/src/uipath/llm_client/settings/constants.py b/src/uipath/llm_client/settings/constants.py index 6f073b7..06c3c2e 100644 --- a/src/uipath/llm_client/settings/constants.py +++ b/src/uipath/llm_client/settings/constants.py @@ -70,3 +70,19 @@ class ByomApiFlavor(StrEnum): ByomApiFlavor.AWS_BEDROCK_INVOKE: ApiFlavor.INVOKE, ByomApiFlavor.AWS_BEDROCK_CONVERSE: ApiFlavor.CONVERSE, } + + +ANTHROPIC_MODEL_NAME_KEYWORDS: tuple[str, ...] = ( + "anthropic", + "claude", + "opus", + "sonnet", + "haiku", + "mythos", +) + + +def is_anthropic_model_name(model_name: str) -> bool: + """Heuristic fallback for when discovery's ``modelFamily`` is unavailable (e.g. BYOM).""" + lower = model_name.lower() + return any(kw in lower for kw in ANTHROPIC_MODEL_NAME_KEYWORDS) From e717775252d4b63b612480df4836cfe370ea9797 Mon Sep 17 00:00:00 2001 From: Cosmin Maria Date: Fri, 17 Apr 2026 14:04:13 +0300 Subject: [PATCH 3/5] Move is_anthropic_model_name helper to utils.model_family constants.py is for enums and mappings, not utility functions. Relocate the helper + keyword tuple to a dedicated utils module and update all call sites to import from the new path. Co-Authored-By: Claude Opus 4.7 (1M context) --- CHANGELOG.md | 2 +- .../clients/normalized/chat_models.py | 8 ++------ .../src/uipath_langchain_client/factory.py | 2 +- .../src/uipath_langchain_client/settings.py | 2 -- .../llm_client/clients/litellm/client.py | 2 +- src/uipath/llm_client/settings/constants.py | 16 --------------- src/uipath/llm_client/utils/model_family.py | 20 +++++++++++++++++++ 7 files changed, 25 insertions(+), 27 deletions(-) create mode 100644 src/uipath/llm_client/utils/model_family.py diff --git a/CHANGELOG.md b/CHANGELOG.md index bf78252..bdee1d0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,7 +5,7 @@ All notable changes to `uipath_llm_client` (core package) will be documented in ## [1.9.1] - 2026-04-17 ### Added -- `is_anthropic_model_name()` helper and `ANTHROPIC_MODEL_NAME_KEYWORDS` tuple in `settings.constants` — name-based Claude detection for BYOM deployments where discovery does not expose `modelFamily` +- `utils.model_family.is_anthropic_model_name()` helper and `ANTHROPIC_MODEL_NAME_KEYWORDS` tuple — name-based Claude detection for BYOM deployments where discovery does not expose `modelFamily` ### Fixed - `UiPathLiteLLM` now detects Claude-family models by name when `modelFamily` is unavailable (BYOM), correctly routing Bedrock/Vertex provider selection and default flavors 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 9870015..3a27d57 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 @@ -64,13 +64,9 @@ from langchain_core.utils.pydantic import is_basemodel_subclass from pydantic import AliasChoices, BaseModel, Field +from uipath.llm_client.utils.model_family import is_anthropic_model_name from uipath_langchain_client.base_client import UiPathBaseChatModel -from uipath_langchain_client.settings import ( - ApiType, - RoutingMode, - UiPathAPIConfig, - is_anthropic_model_name, -) +from uipath_langchain_client.settings import ApiType, RoutingMode, UiPathAPIConfig _DictOrPydanticClass = Union[dict[str, Any], type[BaseModel], type] _DictOrPydantic = Union[dict[str, Any], BaseModel] diff --git a/packages/uipath_langchain_client/src/uipath_langchain_client/factory.py b/packages/uipath_langchain_client/src/uipath_langchain_client/factory.py index 77118ab..0a6646b 100644 --- a/packages/uipath_langchain_client/src/uipath_langchain_client/factory.py +++ b/packages/uipath_langchain_client/src/uipath_langchain_client/factory.py @@ -22,6 +22,7 @@ from typing import Any +from uipath.llm_client.utils.model_family import is_anthropic_model_name from uipath_langchain_client.base_client import ( UiPathBaseChatModel, UiPathBaseEmbeddings, @@ -35,7 +36,6 @@ UiPathBaseSettings, VendorType, get_default_client_settings, - is_anthropic_model_name, ) diff --git a/packages/uipath_langchain_client/src/uipath_langchain_client/settings.py b/packages/uipath_langchain_client/src/uipath_langchain_client/settings.py index d12b997..20a1514 100644 --- a/packages/uipath_langchain_client/src/uipath_langchain_client/settings.py +++ b/packages/uipath_langchain_client/src/uipath_langchain_client/settings.py @@ -31,7 +31,6 @@ ModelFamily, RoutingMode, VendorType, - is_anthropic_model_name, ) __all__ = [ @@ -48,5 +47,4 @@ "VendorType", "API_FLAVOR_TO_VENDOR_TYPE", "BYOM_TO_ROUTING_FLAVOR", - "is_anthropic_model_name", ] diff --git a/src/uipath/llm_client/clients/litellm/client.py b/src/uipath/llm_client/clients/litellm/client.py index c1ef517..cfa4f9a 100644 --- a/src/uipath/llm_client/clients/litellm/client.py +++ b/src/uipath/llm_client/clients/litellm/client.py @@ -34,8 +34,8 @@ ModelFamily, RoutingMode, VendorType, - is_anthropic_model_name, ) +from uipath.llm_client.utils.model_family import is_anthropic_model_name from uipath.llm_client.utils.retry import RetryConfig # Route OpenAI chat completions through base_llm_http_handler (accepts HTTPHandler) diff --git a/src/uipath/llm_client/settings/constants.py b/src/uipath/llm_client/settings/constants.py index 06c3c2e..6f073b7 100644 --- a/src/uipath/llm_client/settings/constants.py +++ b/src/uipath/llm_client/settings/constants.py @@ -70,19 +70,3 @@ class ByomApiFlavor(StrEnum): ByomApiFlavor.AWS_BEDROCK_INVOKE: ApiFlavor.INVOKE, ByomApiFlavor.AWS_BEDROCK_CONVERSE: ApiFlavor.CONVERSE, } - - -ANTHROPIC_MODEL_NAME_KEYWORDS: tuple[str, ...] = ( - "anthropic", - "claude", - "opus", - "sonnet", - "haiku", - "mythos", -) - - -def is_anthropic_model_name(model_name: str) -> bool: - """Heuristic fallback for when discovery's ``modelFamily`` is unavailable (e.g. BYOM).""" - lower = model_name.lower() - return any(kw in lower for kw in ANTHROPIC_MODEL_NAME_KEYWORDS) diff --git a/src/uipath/llm_client/utils/model_family.py b/src/uipath/llm_client/utils/model_family.py new file mode 100644 index 0000000..a7c7618 --- /dev/null +++ b/src/uipath/llm_client/utils/model_family.py @@ -0,0 +1,20 @@ +"""Heuristic helpers for identifying a model's family from its name. + +Discovery metadata (``modelFamily``) is the authoritative source, but BYOM +deployments do not expose it. These helpers provide a name-based fallback. +""" + +ANTHROPIC_MODEL_NAME_KEYWORDS: tuple[str, ...] = ( + "anthropic", + "claude", + "opus", + "sonnet", + "haiku", + "mythos", +) + + +def is_anthropic_model_name(model_name: str) -> bool: + """Return True if ``model_name`` looks like an Anthropic Claude-family model.""" + lower = model_name.lower() + return any(kw in lower for kw in ANTHROPIC_MODEL_NAME_KEYWORDS) From 163fe7d272d47b3d0f7a468853504e5175261d83 Mon Sep 17 00:00:00 2001 From: Cosmin Maria Date: Fri, 17 Apr 2026 14:07:35 +0300 Subject: [PATCH 4/5] Re-export is_anthropic_model_name from langchain utils Expose the helper via uipath_langchain_client.utils alongside other re-exported core utilities (exceptions, RetryConfig). Internal callers now import from the package-local utils module instead of reaching across to uipath.llm_client.utils.model_family directly. Co-Authored-By: Claude Opus 4.7 (1M context) --- .../clients/normalized/chat_models.py | 2 +- .../src/uipath_langchain_client/factory.py | 2 +- .../src/uipath_langchain_client/utils.py | 6 ++++++ 3 files changed, 8 insertions(+), 2 deletions(-) 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 3a27d57..710e2d8 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 @@ -64,9 +64,9 @@ from langchain_core.utils.pydantic import is_basemodel_subclass from pydantic import AliasChoices, BaseModel, Field -from uipath.llm_client.utils.model_family import is_anthropic_model_name from uipath_langchain_client.base_client import UiPathBaseChatModel from uipath_langchain_client.settings import ApiType, RoutingMode, UiPathAPIConfig +from uipath_langchain_client.utils import is_anthropic_model_name _DictOrPydanticClass = Union[dict[str, Any], type[BaseModel], type] _DictOrPydantic = Union[dict[str, Any], BaseModel] diff --git a/packages/uipath_langchain_client/src/uipath_langchain_client/factory.py b/packages/uipath_langchain_client/src/uipath_langchain_client/factory.py index 0a6646b..de491ff 100644 --- a/packages/uipath_langchain_client/src/uipath_langchain_client/factory.py +++ b/packages/uipath_langchain_client/src/uipath_langchain_client/factory.py @@ -22,7 +22,6 @@ from typing import Any -from uipath.llm_client.utils.model_family import is_anthropic_model_name from uipath_langchain_client.base_client import ( UiPathBaseChatModel, UiPathBaseEmbeddings, @@ -37,6 +36,7 @@ VendorType, get_default_client_settings, ) +from uipath_langchain_client.utils import is_anthropic_model_name def get_chat_model( diff --git a/packages/uipath_langchain_client/src/uipath_langchain_client/utils.py b/packages/uipath_langchain_client/src/uipath_langchain_client/utils.py index b49e05a..0607b05 100644 --- a/packages/uipath_langchain_client/src/uipath_langchain_client/utils.py +++ b/packages/uipath_langchain_client/src/uipath_langchain_client/utils.py @@ -13,6 +13,10 @@ UiPathTooManyRequestsError, UiPathUnprocessableEntityError, ) +from uipath.llm_client.utils.model_family import ( + ANTHROPIC_MODEL_NAME_KEYWORDS, + is_anthropic_model_name, +) from uipath.llm_client.utils.retry import RetryConfig __all__ = [ @@ -30,4 +34,6 @@ "UiPathServiceUnavailableError", "UiPathGatewayTimeoutError", "UiPathTooManyRequestsError", + "ANTHROPIC_MODEL_NAME_KEYWORDS", + "is_anthropic_model_name", ] From 1e16e092de7dab0d551848aae7f5f6c78bed9a7f Mon Sep 17 00:00:00 2001 From: Cosmin Maria Date: Fri, 17 Apr 2026 14:10:57 +0300 Subject: [PATCH 5/5] clefixes --- .../src/uipath_langchain_client/base_client.py | 2 +- .../clients/litellm/chat_models.py | 9 +++++++-- .../clients/litellm/embeddings.py | 9 +++++++-- 3 files changed, 15 insertions(+), 5 deletions(-) diff --git a/packages/uipath_langchain_client/src/uipath_langchain_client/base_client.py b/packages/uipath_langchain_client/src/uipath_langchain_client/base_client.py index a79025e..7e7badd 100644 --- a/packages/uipath_langchain_client/src/uipath_langchain_client/base_client.py +++ b/packages/uipath_langchain_client/src/uipath_langchain_client/base_client.py @@ -48,12 +48,12 @@ get_captured_response_headers, set_captured_response_headers, ) -from uipath.llm_client.utils.retry import RetryConfig from uipath_langchain_client.settings import ( UiPathAPIConfig, UiPathBaseSettings, get_default_client_settings, ) +from uipath_langchain_client.utils import RetryConfig class UiPathBaseLLMClient(BaseModel, ABC): diff --git a/packages/uipath_langchain_client/src/uipath_langchain_client/clients/litellm/chat_models.py b/packages/uipath_langchain_client/src/uipath_langchain_client/clients/litellm/chat_models.py index 619106c..4bbc72b 100644 --- a/packages/uipath_langchain_client/src/uipath_langchain_client/clients/litellm/chat_models.py +++ b/packages/uipath_langchain_client/src/uipath_langchain_client/clients/litellm/chat_models.py @@ -22,9 +22,14 @@ from typing_extensions import Self from uipath.llm_client.clients.litellm import UiPathLiteLLM -from uipath.llm_client.settings.constants import ApiFlavor, ApiType, RoutingMode, VendorType from uipath_langchain_client.base_client import UiPathBaseChatModel -from uipath_langchain_client.settings import UiPathAPIConfig +from uipath_langchain_client.settings import ( + ApiFlavor, + ApiType, + RoutingMode, + UiPathAPIConfig, + VendorType, +) try: from langchain_litellm import ChatLiteLLM diff --git a/packages/uipath_langchain_client/src/uipath_langchain_client/clients/litellm/embeddings.py b/packages/uipath_langchain_client/src/uipath_langchain_client/clients/litellm/embeddings.py index 180d979..9648e22 100644 --- a/packages/uipath_langchain_client/src/uipath_langchain_client/clients/litellm/embeddings.py +++ b/packages/uipath_langchain_client/src/uipath_langchain_client/clients/litellm/embeddings.py @@ -16,9 +16,14 @@ from typing_extensions import Self from uipath.llm_client.clients.litellm import UiPathLiteLLM -from uipath.llm_client.settings.constants import ApiFlavor, ApiType, RoutingMode, VendorType from uipath_langchain_client.base_client import UiPathBaseEmbeddings -from uipath_langchain_client.settings import UiPathAPIConfig +from uipath_langchain_client.settings import ( + ApiFlavor, + ApiType, + RoutingMode, + UiPathAPIConfig, + VendorType, +) class UiPathLiteLLMEmbeddings(UiPathBaseEmbeddings):