Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 28 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@ on:
- "uv.lock"
- ".python-version"

permissions:
contents: read

jobs:
type_check:
name: Type Check and Lint
Expand Down Expand Up @@ -41,6 +44,31 @@ jobs:
- name: Pyright
run: uv run pyright .

import_without_extras:
name: Import Without Extras
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6

- name: Install uv
uses: astral-sh/setup-uv@v7
with:
version: "0.9.27"
enable-cache: true

- name: Set up Python
uses: actions/setup-python@v6
with:
python-version-file: ".python-version"

- name: Install without extras
run: uv sync --no-dev --package uipath-langchain-client

- name: Import packages
run: |
uv run --no-sync python -c "import uipath.llm_client"
uv run --no-sync python -c "import uipath_langchain_client"

test:
name: Test
runs-on: ubuntu-latest
Expand Down
5 changes: 5 additions & 0 deletions packages/uipath_langchain_client/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@

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

## [1.16.1] - 2026-07-03

### Fixed
- `import uipath_langchain_client` no longer requires the `bedrock` extra (regression in 1.15.1).

## [1.16.0] - 2026-07-03

### Changed
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
__title__ = "UiPath LangChain Client"
__description__ = "A Python client for interacting with UiPath's LLM services via LangChain."
__version__ = "1.16.0"
__version__ = "1.16.1"
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,6 @@
UiPathBaseChatModel,
UiPathBaseEmbeddings,
)
from uipath_langchain_client.clients.bedrock.model_resolution import (
apply_backing_model_detection_hints,
)
from uipath_langchain_client.settings import (
API_FLAVOR_TO_VENDOR_TYPE,
BYOM_TO_ROUTING_FLAVOR,
Expand Down Expand Up @@ -221,6 +218,10 @@ def get_chat_model(
**model_kwargs,
)

from uipath_langchain_client.clients.bedrock.model_resolution import (
apply_backing_model_detection_hints,
)

apply_backing_model_detection_hints(model_kwargs, model_info)

if api_flavor == ApiFlavor.INVOKE:
Expand Down
56 changes: 56 additions & 0 deletions tests/langchain/features/test_optional_extras.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
"""The package must import without optional provider extras installed."""

import subprocess
import sys

_OPTIONAL_MODULES = [
"anthropic",
"google.genai",
"langchain_anthropic",
"langchain_aws",
"langchain_azure_ai",
"langchain_fireworks",
"langchain_google_genai",
"langchain_google_vertexai",
"langchain_litellm",
"langchain_openai",
"litellm",
"openai",
]

_IMPORT_WITH_BLOCKED_EXTRAS = """
import sys

blocked = set(sys.argv[1:])


class _BlockOptionalDeps:
def find_spec(self, name, path=None, target=None):
if any(name == module or name.startswith(module + ".") for module in blocked):
raise ImportError(f"blocked optional dependency: {name}")
return None


sys.meta_path.insert(0, _BlockOptionalDeps())

import uipath_langchain_client

providers = [
name
for name in sys.modules
if name.startswith("uipath_langchain_client.clients.")
and not name.startswith("uipath_langchain_client.clients.normalized")
]
assert not providers, providers
print("OK")
"""


def test_package_imports_without_optional_extras():
result = subprocess.run(
[sys.executable, "-c", _IMPORT_WITH_BLOCKED_EXTRAS, *_OPTIONAL_MODULES],
capture_output=True,
text=True,
)
assert result.returncode == 0, result.stderr
assert result.stdout.strip() == "OK"
Loading