Repository navigation
refactor(chat): remove the legacy LLM clients - #1193
Merged
Merged
Conversation
andreiancuta-uipath
force-pushed
the
aa/remove-legacy-llm-clients
branch
from
November 4, 2026 16:33
c58997d to
c2bde2a
Compare
vldcmp-uipath
approved these changes
Nov 5, 2026
There was a problem hiding this comment.
🔵 Needs a closer look
The required uipath-agents-python migration and coordinated release ordering cannot be verified from this snapshot, leaving compatibility with consumers of the removed legacy APIs unresolved.
No open issues 🎉
What changed in this PR
This PR completes the SDK’s migration to uipath_langchain_client, removing the legacy chat and embeddings implementations while preserving public model and provider enum exports.
Changes:
- Makes both factories use the shared client package unconditionally and removes the named
use_new_llm_clientsparameter. - Deletes legacy clients, supporting utilities, and their tests; updates remaining tests and documentation.
- Relocates public enums into
chat/and bumps the package version to0.19.0.
| File | Description |
|---|---|
uv.lock |
Updates the package version to 0.19.0. |
tests/test_no_circular_imports.py |
Removes exclusions for deleted legacy modules. |
tests/chat/test_url_resolution.py |
Deletes legacy URL-resolution tests. |
tests/chat/test_trace_context_callback.py |
Removes legacy transport tests; retains callback coverage. |
tests/chat/test_openai_url_rewrite.py |
Deletes legacy OpenAI URL-rewrite tests. |
tests/chat/test_openai_tool_call_extras.py |
Deletes legacy tool-call metadata tests. |
tests/chat/test_header_encoding.py |
Deletes legacy header-encoding tests. |
tests/chat/test_context_headers.py |
Deletes legacy context-header tests. |
tests/chat/test_chat_model_factory.py |
Removes legacy factory tests and updates retained coverage. |
tests/chat/test_chat_model_factory_model_settings.py |
Retains settings-forwarding coverage without legacy switching. |
tests/chat/test_chat_model_factory_agenthub.py |
Retains AgentHub configuration forwarding tests. |
tests/chat/test_bedrock.py |
Deletes legacy Bedrock client tests. |
tests/chat/test_attachment_baggage.py |
Removes legacy transport baggage coverage. |
tests/chat/retryers/test_retryers.py |
Deletes legacy retry-strategy tests. |
tests/chat/retryers/__init__.py |
Removes the legacy retry-test package marker. |
tests/agent/tools/internal_tools/test_analyze_files_tool.py |
Renames a test and clarifies its raw-provider-error docstring. |
tests/agent/test_llm.py |
Updates test naming and comments for raw provider errors. |
tests/agent/react/test_llm_node.py |
Renames raw-provider-error tests and updates comments. |
src/uipath_langchain/embeddings/embeddings_factory.py |
Always delegates upstream and exposes routing_mode explicitly. |
src/uipath_langchain/embeddings/_legacy/embeddings.py |
Deletes legacy embeddings implementations. |
src/uipath_langchain/embeddings/_legacy/__init__.py |
Removes the legacy embeddings package. |
src/uipath_langchain/chat/types.py |
Houses the relocated provider and API-flavor enums. |
src/uipath_langchain/chat/supported_models.py |
Houses the relocated supported-model enums. |
src/uipath_langchain/chat/chat_model_factory.py |
Removes legacy dispatch and always delegates upstream. |
src/uipath_langchain/chat/_legacy/vertex.py |
Deletes the legacy Vertex client and transports. |
src/uipath_langchain/chat/_legacy/openai.py |
Deletes the legacy OpenAI client and transports. |
src/uipath_langchain/chat/_legacy/models.py |
Deletes legacy normalized and Azure chat models. |
src/uipath_langchain/chat/_legacy/license_ref_id.py |
Deletes legacy license-reference storage. |
src/uipath_langchain/chat/_legacy/http_client/url.py |
Deletes legacy gateway URL resolution. |
src/uipath_langchain/chat/_legacy/http_client/retryers/vertex.py |
Deletes legacy Vertex retry strategies. |
src/uipath_langchain/chat/_legacy/http_client/retryers/bedrock.py |
Deletes legacy Bedrock retry strategies. |
src/uipath_langchain/chat/_legacy/http_client/retryers/base.py |
Deletes shared legacy retry infrastructure. |
src/uipath_langchain/chat/_legacy/http_client/retryers/__init__.py |
Removes the legacy retry package marker. |
src/uipath_langchain/chat/_legacy/http_client/headers.py |
Deletes legacy request-header construction. |
src/uipath_langchain/chat/_legacy/http_client/header_capture.py |
Deletes legacy response-header capture. |
src/uipath_langchain/chat/_legacy/http_client/__init__.py |
Removes legacy HTTP helper exports. |
src/uipath_langchain/chat/_legacy/constants.py |
Deletes legacy gateway-header constants. |
src/uipath_langchain/chat/_legacy/chat_model_factory.py |
Deletes legacy model discovery and construction. |
src/uipath_langchain/chat/_legacy/bedrock.py |
Deletes legacy Bedrock clients and request handling. |
src/uipath_langchain/chat/_legacy/__init__.py |
Removes the legacy chat package. |
src/uipath_langchain/chat/__init__.py |
Redirects lazy enum exports to their new locations. |
src/uipath_langchain/agent/react/llm_node.py |
Clarifies an error-handling comment; behavior is unchanged. |
src/uipath_langchain/agent/react/conversational_output_node.py |
Clarifies an error-handling comment; behavior is unchanged. |
src/uipath_langchain/_utils/_sleep_policy.py |
Deletes legacy retry-logging support. |
src/uipath_langchain/_utils/_settings.py |
Deletes legacy client settings and token helpers. |
src/uipath_langchain/_utils/_request_mixin.py |
Deletes the legacy HTTP request mixin. |
src/uipath_langchain/_utils/_environment.py |
Removes the legacy-only timeout helper. |
src/uipath_langchain/_utils/__init__.py |
Removes the request-mixin export. |
SETUP.MD |
Updates helper-placement guidance after timeout-helper removal. |
pyproject.toml |
Bumps the package version to 0.19.0. |
CLAUDE.md |
Updates the shared-utilities architecture description. |
Review effort: Balanced
andreiancuta-uipath
force-pushed
the
aa/remove-legacy-llm-clients
branch
from
November 5, 2026 10:27
f25a90f to
8aefdcd
Compare
Delete uipath_langchain.chat._legacy, uipath_langchain.embeddings._legacy and the UiPathRequestMixin helpers they used. get_chat_model and get_embeddings always use uipath_langchain_client, and the use_new_llm_clients parameter is removed. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
andreiancuta-uipath
force-pushed
the
aa/remove-legacy-llm-clients
branch
from
November 5, 2026 10:35
8aefdcd to
297722e
Compare
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
andreiancuta-uipath
force-pushed
the
aa/remove-legacy-llm-clients
branch
from
November 5, 2026 10:35
297722e to
9d34872
Compare
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



Summary
Removes the legacy in-repo LLM clients that were kept behind the
EnabledNewLlmClientsfeature flag.get_chat_modelandget_embeddingsalways useuipath_langchain_client.uipath_langchain.chat._legacyanduipath_langchain.embeddings._legacy._utils/_request_mixin.py(UiPathRequestMixin),_utils/_settings.py,_utils/_sleep_policy.pyandget_default_timeout. Only the legacy clients used them.use_new_llm_clientsparameter fromget_chat_modelandget_embeddings.supported_models.pyandtypes.pyout of_legacyintochat/. The publicOpenAIModels,BedrockModels,GeminiModels,LLMProviderandAPIFlavorexports fromuipath_langchain.chatare unchanged.Behavior changes
get_embeddingsused the legacy client by default (use_new_llm_clients=False). It now always uses theuipath_langchain_clientfactory.get_chat_model(..., use_new_llm_clients=...)is no longer a named parameter. A caller that passes it will have it forwarded through**kwargsto the model constructor.Rollout
Merge UiPath/uipath-agents-python#866 first. It stops passing
use_new_llm_clientsand stops importinguipath_langchain.chat._legacy.license_ref_id. TheEnabledNewLlmClientsentries ingitops-centralized-clustercan be deleted after both PRs are deployed.Test plan
uv run pytest: 4122 passed.ruff check,ruff format,scripts/lint_httpx_client.py,mypy src tests: clean.uipath-agents-pythonnon-e2e suite (1378 tests) passes with this branch installed in editable mode, with fix(ci): prevent shell injection via PR title in custom-version workflows #866 applied.🤖 Generated with Claude Code