Skip to content

refactor(chat): remove the legacy LLM clients - #1193

Merged
andreiancuta-uipath merged 2 commits into
mainfrom
aa/remove-legacy-llm-clients
Nov 5, 2026
Merged

andreiancuta-uipath merged 2 commits into
mainfrom
aa/remove-legacy-llm-clients

Conversation

@andreiancuta-uipath

@andreiancuta-uipath andreiancuta-uipath commented Nov 4, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Removes the legacy in-repo LLM clients that were kept behind the EnabledNewLlmClients feature flag. get_chat_model and get_embeddings always use uipath_langchain_client.

  • Deletes uipath_langchain.chat._legacy and uipath_langchain.embeddings._legacy.
  • Deletes _utils/_request_mixin.py (UiPathRequestMixin), _utils/_settings.py, _utils/_sleep_policy.py and get_default_timeout. Only the legacy clients used them.
  • Removes the use_new_llm_clients parameter from get_chat_model and get_embeddings.
  • Moves supported_models.py and types.py out of _legacy into chat/. The public OpenAIModels, BedrockModels, GeminiModels, LLMProvider and APIFlavor exports from uipath_langchain.chat are unchanged.
  • Deletes the tests for the legacy modules.
  • Bumps the version to 0.19.0.

Behavior changes

  • get_embeddings used the legacy client by default (use_new_llm_clients=False). It now always uses the uipath_langchain_client factory.
  • get_chat_model(..., use_new_llm_clients=...) is no longer a named parameter. A caller that passes it will have it forwarded through **kwargs to the model constructor.

Rollout

Merge UiPath/uipath-agents-python#866 first. It stops passing use_new_llm_clients and stops importing uipath_langchain.chat._legacy.license_ref_id. The EnabledNewLlmClients entries in gitops-centralized-cluster can be deleted after both PRs are deployed.

Test plan

🤖 Generated with Claude Code

@andreiancuta-uipath
andreiancuta-uipath force-pushed the aa/remove-legacy-llm-clients branch from c58997d to c2bde2a Compare November 4, 2026 16:33
@andreiancuta-uipath
andreiancuta-uipath marked this pull request as ready for review November 5, 2026 10:22
Copilot AI balanced review requested due to automatic review settings November 5, 2026 10:22

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔵 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_clients parameter.
  • Deletes legacy clients, supporting utilities, and their tests; updates remaining tests and documentation.
  • Relocates public enums into chat/ and bumps the package version to 0.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
andreiancuta-uipath force-pushed the aa/remove-legacy-llm-clients branch from f25a90f to 8aefdcd Compare November 5, 2026 10:27
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
andreiancuta-uipath force-pushed the aa/remove-legacy-llm-clients branch from 8aefdcd to 297722e Compare November 5, 2026 10:35
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@andreiancuta-uipath
andreiancuta-uipath force-pushed the aa/remove-legacy-llm-clients branch from 297722e to 9d34872 Compare November 5, 2026 10:35
@sonarqubecloud

sonarqubecloud Bot commented Nov 5, 2026

Copy link
Copy Markdown

@andreiancuta-uipath
andreiancuta-uipath merged commit f5a5df8 into main Nov 5, 2026
47 checks passed
@andreiancuta-uipath
andreiancuta-uipath deleted the aa/remove-legacy-llm-clients branch November 5, 2026 10:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants