Skip to content

feat: Add uipath_langchain_client, refactor code to use the new client#634

Merged
ionut-mihalache-uipath merged 1 commit intomainfrom
feat/uipath_llm_client
Apr 23, 2026
Merged

feat: Add uipath_langchain_client, refactor code to use the new client#634
ionut-mihalache-uipath merged 1 commit intomainfrom
feat/uipath_llm_client

Conversation

@cosminacho
Copy link
Copy Markdown
Contributor

@cosminacho cosminacho commented Feb 26, 2026

This new client has 2 main components:

  1. uipath-llm-client
  • this is the core package on which uipath-langchain-client depends
  • it handles URL, headers and authentification for both AgentHub and LLMGateway
  • Encapsulates all the auth settings as well as retries, custom exceptions, byo stuff, custom headers for streaming etc into an httx.Client
  • it also has passthrough httpx clients for providers like openai, anthropic, gemini (using their clients)
  • can be added with: uv add "uipath-llm-client[openai, google, all]" etc. Without specifying extra dependencies it installs only the main httpx client that does the url, headers and auth stuff
  1. uipath-langchain-client
  • uses the httpx client from uipath-llm-client
  • the passthrough implementations are minimal, all passthrough clients use a httpx client to make requests, we can just use the httpx client created above and inject it in the langchain-client for that vendor
  • it also has a factory method which does a GET on the discovery endpoint and correctly instantiates the appropiate passthrough client for that model_name and the vendor detected

Summary of the Changes for this package:

  • Retrying moved to the uipath-langchain-client
  • Request Mixin removed because it’s on the uipath-langchain-client now as UiPathBaseLLMClient
  • Streaming fixes added to uipath-langchain-client
  • Auth headers, url creation and refresh token with uipath auth moved to uipath-langchain-client
  • All clients implement UiPathBaseChatModel which has api_config from where we can get vendor_type and api_flavor
  • Retryers are handled in uipath-langchain-client at transport level on the httpx client, so no need to hardcode for each provider
  • Factory is now in uipath-langchain-client (and it uses the discovery endpoint)
  • Gemini streaming fixes moved
  • Comprehensive tests are in the package, we can remove them from here
  • Also the normalized client is in the new client
  • merging generation info with response metadata in the client

Before merging this PR I think it's important to make sure that all the relevant components have been moved to the new client, and also that the new changes aren't breaking stuff that's working

Not tested yet:

  • on Bedrock: Convert file_blocks_to_anthropic_documents

Development Package

  • Use uipath pack --nolock to get the latest dev build from this PR (requires version range).
  • Add this package as a dependency in your pyproject.toml:
[project]
dependencies = [
  # Exact version:
  "uipath-langchain==0.10.0.dev1006344356",

  # Any version from PR
  "uipath-langchain>=0.10.0.dev1006340000,<0.10.0.dev1006350000"
]

[[tool.uv.index]]
name = "testpypi"
url = "https://test.pypi.org/simple/"
publish-url = "https://test.pypi.org/legacy/"
explicit = true

[tool.uv.sources]
uipath-langchain = { index = "testpypi" }

[tool.uv]
override-dependencies = [
    "uipath-langchain>=0.10.0.dev1006340000,<0.10.0.dev1006350000",
]

@cosminacho cosminacho force-pushed the feat/uipath_llm_client branch 20 times, most recently from ba8fc68 to 0455d90 Compare March 2, 2026 21:34
@cosminacho cosminacho force-pushed the feat/uipath_llm_client branch 4 times, most recently from 78278b5 to e92f41c Compare March 10, 2026 12:59
@cosminacho cosminacho force-pushed the feat/uipath_llm_client branch 2 times, most recently from f5ee4b8 to 0a73223 Compare March 12, 2026 12:45
@cosminacho cosminacho force-pushed the feat/uipath_llm_client branch 3 times, most recently from e76f2ab to e8f5c07 Compare March 12, 2026 17:03
Comment thread samples/chat-hitl-agent/graph.py Outdated
Comment thread testcases/company-research-agent/expected_traces.json
Comment thread tests/cli/mocks/joke_agent_with_guardrails.py
@ionmincu ionmincu self-requested a review March 18, 2026 09:21
@cosminacho cosminacho force-pushed the feat/uipath_llm_client branch 13 times, most recently from 7834fe5 to 9df8ac6 Compare March 19, 2026 10:47
Comment thread src/uipath_langchain/chat/http_client/headers.py
Comment thread src/uipath_langchain/chat/chat_model_factory.py Outdated
@cosminacho cosminacho force-pushed the feat/uipath_llm_client branch 3 times, most recently from 96cf3b1 to 58c7ca4 Compare March 20, 2026 08:36
Comment thread samples/chat-hitl-agent/graph.py
Comment thread testcases/multimodal-invoke/src/main.py
Comment thread testcases/multimodal-invoke/src/main.py
Comment thread pyrightconfig.json Outdated
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants